-
Notifications
You must be signed in to change notification settings - Fork 2
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
STR-804 Rework L1 access from OL STF #469
Draft
delbonis
wants to merge
26
commits into
main
Choose a base branch
from
STR-291-stf-refacs
base: main
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.
Draft
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0038b07
chaintsn: started refactoring for epoch-level bookkeeping
delbonis a6f232b
chaintsn, state: changed exec update handling to use withdrawals queu…
delbonis 1d76049
chaintsn: fixed test
delbonis e5c14e0
chaintsn, state: split out some state types to epoch-level state
delbonis c949be3
state: reworked `WriteBatch` related types
delbonis 4b09eae
misc: reworked epoch state relationships some more
delbonis feb53e3
state: reworked `StateCache` more to remove state ops from system
delbonis 2b62f07
misc: fixed a bunch of compilation issues
delbonis 39265c7
state: fixed overwriting epoch state, fixed broken tests
delbonis 9f745cf
chaintsn: renamed `process_l1_view_update`
delbonis 3e026a3
proof-impl/cl-stf: fix something
delbonis dfb9e9a
chaintsn: fix broken test
delbonis 2f4e640
misc: fixed a bunch more unit tests
delbonis be96a5c
state: removing unnecessary `StateOp`s
delbonis 4ed9165
chaintsn, consensus-logic: rework `L1Segment` rules to only be presen…
delbonis 44c5d53
state: fix accessors on block types
delbonis 59edcba
state: fix ZST issue
delbonis dc54aff
fntest: shortened epoch length, added new `wait_until_checkpoint` uti…
delbonis ef18a90
misc: cleanups to improve testing
delbonis e58f189
misc: rework a LOT of types
delbonis cd6df53
misc: heavy refactoring on status types and finalization code paths
delbonis 71f124d
misc: integrated epoch transition into slot transition, refactored so…
delbonis 62b4e39
status: fixed hot spinning when waiting for new client state
delbonis 14d6c29
status: fixed it a little more
delbonis 9fb5e5c
chaintsn, consensus-logic: fixed slot not advancing past end of secon…
delbonis ff4adb3
misc: changed a few things to try to address broken things
delbonis 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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! Utils for reasoning about chain slots. | ||
|
||
use strata_primitives::params::RollupParams; | ||
|
||
pub fn get_slot_expected_epoch(slot: u64, params: &RollupParams) -> u64 { | ||
slot / params.target_l2_batch_size as u64 | ||
} | ||
|
||
pub fn get_epoch_initial_slot(epoch: u64, params: &RollupParams) -> u64 { | ||
epoch * params.target_l2_batch_size | ||
} | ||
|
||
pub fn get_epoch_final_slot(epoch: u64, params: &RollupParams) -> u64 { | ||
let epoch_init_slot = get_epoch_initial_slot(epoch, params); | ||
epoch_init_slot + (params.target_l2_batch_size - 1) | ||
} | ||
|
||
pub fn is_epoch_init_slot(slot: u64, params: &RollupParams) -> bool { | ||
let epoch = get_slot_expected_epoch(slot, params); | ||
slot == get_epoch_initial_slot(epoch, params) | ||
} | ||
|
||
pub fn is_epoch_final_slot(slot: u64, params: &RollupParams) -> bool { | ||
let epoch = get_slot_expected_epoch(slot, params); | ||
slot == get_epoch_final_slot(epoch, params) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is simpler?