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

Solidity method to execute checkpoint low-fat #277

Closed
Tracked by #211 ...
aakoshh opened this issue Oct 2, 2023 · 0 comments
Closed
Tracked by #211 ...

Solidity method to execute checkpoint low-fat #277

aakoshh opened this issue Oct 2, 2023 · 0 comments

Comments

@aakoshh
Copy link
Contributor

aakoshh commented Oct 2, 2023

This is a variant of #278 for the use case when Fendermint is used to run the parent subnet.

The differences are:

  • The relayers don't send the cross messages along with the checkpoint
  • The checkpoint contains a CID of messages, not a keccak256 over their ABI encoded form
  • Fendermint will resolve the CID and execute separately

The idea is that we need a method like this on the SubnetActor:

fn submit_checkpoint(
  checkpoint: BottomUpCheckpoint, 
  signatures: Vec<Signature>, 
)

The method should:

  1. Hash the checkpoint and validate all signatures against it, recovering the public keys from them
  2. Check that all public keys (or FVM addresses derived from them) are part of the currently expected validator set
  3. Check that the total power of all signatories is sufficient for a quorum.
  4. Check that the checkpointed height is the expected one
  5. Reward the relayer for their service - see the other story for notes
  6. If this is the first time the checkpoint is submitted, execute the messages, or put them in the execution queue.
  7. Update the next expected configuration number
  8. Mark the checkpoint as relayed but not executed

So basically it should validate and register the checkpoint, but it won't have messages to execute. Notably it will not try to validate the CID against the messages because Fendermint will do that by the virtue of trying to resolve it. The BottomUpCheckpoint has to make cross_messages_hash wide enough to accept a CID as well as a 32 byte hash.

Then, Fendermint will do the CID resolution and propose the checkpoint for execution when the data is available.

It will use the mechanism in #212 to execute when the majority of validators agree that the data is ready. In Fendermint, they will execute these messages implicitly by passing them as a batch to Solidity, (or telling Solidity how much gas it can spend on executing messages from a queue in the current block), delegating the responsibility of charging for it to Solidity, but removing the need for the relayer to foot the bill.

@jsoares jsoares transferred this issue from consensus-shipyard/fendermint Dec 19, 2023
@jsoares jsoares closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants