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

Remove caching of checkpoints from the Inbox #523

Merged
merged 14 commits into from
Jun 3, 2022
Merged

Conversation

asaj
Copy link
Contributor

@asaj asaj commented Jun 1, 2022

This PR removes cached checkpoints from Inbox. Instead, checkpoints are expected to be verified in the same transaction as message processing.

Rationale:

  1. With the move to fraud proofs that require merkle proofs in Only cache Outbox checkpoints for fraud proofs #475, there is a vulnerability with cached checkpoints where validators cache a fraudulent checkpoint but do not attempt to process messages against it until they're un-bonded. This is easily mitigated by requiring a proof against that checkpoint, but that is counter-productive to the idea of cached checkpoints as a way to save gas.
  2. Removing the notion of cached checkpoints reduces complexity of the off-chain agents.
  3. Gas savings can still be achieved by batch-processing multiple messages against the same checkpoint.

Other changes:

  • Remove leafIndex and proof from the Inbox.Process event, and the unused InboxValidatorManager.Quorum event. These were included to allow fraud proofs to be constructed more easily, but it doesn't make sense to incur the extra gas costs until validators are bonded
  • Rename BadRecipientHandle to BadRecipient2 for consistency

@asaj asaj marked this pull request as ready for review June 1, 2022 21:42
@asaj asaj requested review from yorhodes and tkporter June 1, 2022 21:42
Copy link
Member

@yorhodes yorhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sweet, so many net red changes lately 🧨

solidity/core/contracts/Inbox.sol Show resolved Hide resolved
solidity/core/contracts/Inbox.sol Show resolved Hide resolved
solidity/core/contracts/Inbox.sol Outdated Show resolved Hide resolved
solidity/core/contracts/Outbox.sol Outdated Show resolved Hide resolved
typescript/utils/src/types.ts Outdated Show resolved Hide resolved
asaj and others added 6 commits June 2, 2022 20:46
Co-authored-by: Yorke Rhodes <yorke@useabacus.network>
…t.ts

Co-authored-by: Yorke Rhodes <yorke@useabacus.network>
…abacus-monorepo into asaj/inbox-checkpoints-2
@asaj asaj enabled auto-merge (squash) June 3, 2022 02:17
@asaj asaj merged commit 81b66b5 into main Jun 3, 2022
@asaj asaj deleted the asaj/inbox-checkpoints-2 branch June 3, 2022 02:17
@asaj asaj mentioned this pull request Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants