-
Notifications
You must be signed in to change notification settings - Fork 435
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
Support the Arbitrum BoLD Challenge Protocol in Nitro #2362
Open
amsanghi
wants to merge
604
commits into
master
Choose a base branch
from
bold-review
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,542
−352
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… into sepolia-tooling-merge
… into sepolia-tooling-merge
… blocks are valid
tsahee
reviewed
Aug 9, 2024
eljobe
changed the title
Support the Arbitrum BOLD Challenge Protocol in Nitro
Support the Arbitrum BoLD Challenge Protocol in Nitro
Sep 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
s
Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This PR includes the Arbitrum BoLD challenge protocol as part of a Nitro node, enabled optionally. The goal is to have Nitro
master
capable of supporting BoLD challenges on Arbitrum Sepolia once the upgrade occurs and on the existing BoLD testnet.BoLD, standing for Bounded Liquidity Delay, is a protocol for resolving disputes over execution of the Arbitrum inbox. The BoLD protocol allows for permissionless validation of Arbitrum One and Nova. It also ensures an upper-bound on withdrawal delays from L2 to L1.
To learn more about the basics of BoLD, see the gentle introduction here, or the research paper here. A presentation explaining what the BoLD software does and how it works can be found here
BoLD Software Responsibilities
BoLD is a modular component of Nitro nodes that can do the following tasks:
All of these responsibilities are performed by the BoLD challenge manager service, which is currently included as a git submodule of Nitro, with its git repository OffchainLabs/bold, with long term plans to port it fully intro Nitro.
Supporting BoLD in Nitro
In order for Nitro to support this BoLD module, Nitro has to provide a dependency to the bold challenge manager that defines the following methods:
We implement these methods in
staker/bold_state_provider.go
and also add a new RPC method to the validation node calledGetMachineHashesWithStepSize
that can execute an Arbitrator machine at a start program counter and collect machine hashes in increments ofstep_size
as required by BoLD.We also implement a new
challengecache
package which can cache hashes retrieved from the validation node in a filesystem hierarchy for fast access by the Nitro node during BoLD challenges. This cache is required for efficient computation of challenge moves, and is a new addition. It stores hashes as bytes in files nested by challenge level hierarchy.Switching from Old Protocol to BoLD at Runtime
To change from the old staker to the BoLD staker at runtime, we provide a new service called
MultiProtocolStaker
, which holds a reference to the old, L1 staker, and the new BoLD staker and can swap to BoLD once it is supported. The way it works is it checks if the rollup contract supports a certain method calledExtraChallengeBlocks
. If the method is unsupported, the Nitro validator should be switching to BoLD.Changelog Summary
Git / Deps
Arbitrator
Nitro Node
StakeToken
address field to the L2 chain info JSONMultiProtocolStaker
instead of aStaker
which is aware of BoLD and can switch protocolschallengecache
package to cache hashes obtained from validation node computation to be used when making moves in BoLDValidation Node API
GetMachineHashesWithStepSize
method that can execute Arbitrator machines at specific program counters, step through them in custom step sizes, and collect machine hashes along the wayMulti Protocol Staker Definition
Testing
TestChallengeProtocolBOLD
which runs a complete challenge, with an L1 node two different L2 nodes disagreeing about the execution of a certain batch posted to the Arbitrum inbox. It uses the BoLD dispute protocol to fully resolve the challengeTestChallengeProtocolBOLD_StateProvider
which tests the invariants of thebold_state_provider.go
implementation needed by the BoLD challenge managerMissing Features