-
Notifications
You must be signed in to change notification settings - Fork 21
Handle L1Block Sync Events #197
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
85b288a
add l1_reorg_safe_depth to RollupParams
prajwolrg 5640a9e
feat: handle SyncAction::FinalizeBlock
prajwolrg a4a02d1
feat: read l1_reorg_safe_depth from config
prajwolrg dbf8224
client_transition: test SyncEvent::L1Block
prajwolrg 141bdef
client_transition: test SyncEvent::L1Revert
prajwolrg 0ea9d18
client_transition: test new state
prajwolrg e99c73d
test-utils: generate l2 chain state and l1 chain
prajwolrg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| use alpen_express_primitives::{ | ||
| block_credential, | ||
| buf::Buf32, | ||
| params::{Params, RollupParams, RunParams}, | ||
| }; | ||
| use alpen_express_state::client_state::ClientState; | ||
|
|
||
| pub fn gen_params() -> Params { | ||
| Params { | ||
| rollup: RollupParams { | ||
| block_time: 1000, | ||
| cred_rule: block_credential::CredRule::Unchecked, | ||
| horizon_l1_height: 3, | ||
| genesis_l1_height: 5, | ||
| evm_genesis_block_hash: Buf32( | ||
| "0x37ad61cff1367467a98cf7c54c4ac99e989f1fbb1bc1e646235e90c065c565ba" | ||
| .parse() | ||
| .unwrap(), | ||
| ), | ||
| evm_genesis_block_state_root: Buf32( | ||
| "0x351714af72d74259f45cd7eab0b04527cd40e74836a45abcae50f92d919d988f" | ||
| .parse() | ||
| .unwrap(), | ||
| ), | ||
| l1_reorg_safe_depth: 5, | ||
| }, | ||
| run: RunParams { | ||
| l1_follow_distance: 3, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
| pub fn gen_client_state(params: Option<&Params>) -> ClientState { | ||
| let params = match params { | ||
| Some(p) => p, | ||
| None => &gen_params(), | ||
| }; | ||
| ClientState::from_genesis_params( | ||
| params.rollup.genesis_l1_height, | ||
| params.rollup.genesis_l1_height, | ||
| ) | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.