Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICS28: vsc will not mature if there are no updates from provider #739

Closed
danwt opened this issue May 17, 2022 · 2 comments
Closed

ICS28: vsc will not mature if there are no updates from provider #739

danwt opened this issue May 17, 2022 · 2 comments
Assignees
Labels
app Application layer.

Comments

@danwt
Copy link
Contributor

danwt commented May 17, 2022

a6bc8d1

It seems that if the early return is taken in consumer::EndBlock

  if pendingChanges.IsEmpty() {
    // do nothing
    return []
  }
 ..
  if providerChannel != "" {
    UnbondMaturePackets()
  }

then the UnbondMaturePackets will never be called. If there are no changes for many blocks, the provider will never receive the maturity.

// CCF: Consumer Chain Function
// implements the AppModule interface
function EndBlock(): [ValidatorUpdate] {
if getCurrentHeight() - lastDistributionTransferHeight >= BlocksPerDistributionTransfer {
DistributeRewards()
}
if pendingChanges.IsEmpty() {
// do nothing
return []
}
// aggregate the pending changes
changes = pendingChanges.Aggregate()
// Note: in the implementation, the aggregation is done directly
// when receiving a VSCPacket via the AccumulateChanges method.
// remove all pending changes
pendingChanges.RemoveAll()
// update validatorSet
UpdateValidatorSet(changes)
// unbond mature packets if the CCV channel is established
if providerChannel != "" {
UnbondMaturePackets()
}
// return the validator set updates to the consensus engine
return changes

@danwt danwt assigned danwt and mpoke and unassigned danwt May 17, 2022
@danwt
Copy link
Contributor Author

danwt commented May 17, 2022

There's a good chance I've made a mistake in my understanding here, if so, please feel free to close the issue :)

@danwt danwt moved this to Todo in Replicated Security May 17, 2022
@danwt danwt changed the title ICS028: packet will not mature if no updates ICS028: vsc will not mature if there are no updates from provider May 17, 2022
@mpoke
Copy link
Contributor

mpoke commented May 19, 2022

@danwt Nice catch. Could you please open an issue also on the implementation side?

@mpoke mpoke added the app Application layer. label May 19, 2022
@mpoke mpoke changed the title ICS028: vsc will not mature if there are no updates from provider ICS28: vsc will not mature if there are no updates from provider May 19, 2022
@mpoke mpoke moved this from Todo to Waiting for review in Replicated Security May 19, 2022
@mpoke mpoke closed this as completed May 20, 2022
Repository owner moved this from Waiting for review to Done in Replicated Security May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Application layer.
Projects
Status: Backlog
Status: Done
Development

No branches or pull requests

2 participants