-
Notifications
You must be signed in to change notification settings - Fork 5
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-929 Core STF refactors #469
Draft
delbonis
wants to merge
55
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
55 commits
Select commit
Hold shift + click to select a range
c273378
chaintsn: started refactoring for epoch-level bookkeeping
delbonis cf1191c
chaintsn, state: changed exec update handling to use withdrawals queu…
delbonis ad8fbe2
chaintsn: fixed test
delbonis 1c7bd8b
chaintsn, state: split out some state types to epoch-level state
delbonis 6994510
state: reworked `WriteBatch` related types
delbonis 4461947
misc: reworked epoch state relationships some more
delbonis 406cf53
state: reworked `StateCache` more to remove state ops from system
delbonis 8e94d9d
misc: fixed a bunch of compilation issues
delbonis 7616ff1
state: fixed overwriting epoch state, fixed broken tests
delbonis bbfaca1
chaintsn: renamed `process_l1_view_update`
delbonis 08a6213
proof-impl/cl-stf: fix something
delbonis 03ff171
chaintsn: fix broken test
delbonis f60b458
misc: fixed a bunch more unit tests
delbonis 177bcca
state: removing unnecessary `StateOp`s
delbonis 08a553a
chaintsn, consensus-logic: rework `L1Segment` rules to only be presen…
delbonis d116caf
state: fix accessors on block types
delbonis 20693de
state: fix ZST issue
delbonis 23562da
fntest: shortened epoch length, added new `wait_until_checkpoint` uti…
delbonis 199556e
misc: cleanups to improve testing
delbonis 5f7bd5d
misc: rework a LOT of types
delbonis 4c534ef
misc: heavy refactoring on status types and finalization code paths
delbonis 1ffc939
misc: integrated epoch transition into slot transition, refactored so…
delbonis b7f6a26
status: fixed hot spinning when waiting for new client state
delbonis bf79419
status: fixed it a little more
delbonis 074f4a4
chaintsn, consensus-logic: fixed slot not advancing past end of secon…
delbonis c09c860
misc: changed a few things to try to address broken things
delbonis d66769a
prover-client: fixed rebase mistakes
delbonis 4c3bfc6
fntest: fix broken fstring
delbonis 7e42b41
misc: stripping out most of the L1 block bookkeeping logic in CSM
delbonis 3f1531c
fntest/fw: fixed batch field lookup (`idx` -> `epoch`)
delbonis 501681d
misc: reworked a few things to make it more coherent, changed CSM che…
delbonis 569815c
misc: refactored bookkeeping on write batches and accepting L1 blocks
delbonis a018dbd
fntest/fw: fix bash syntax
delbonis cfe2ca9
misc: I think I fixed the root of the state overwrite issue now
delbonis ce2f3b5
misc: reworked broken tests to reflect new design
delbonis 6efb099
strata-client: fixed RPC breakage after rebase
delbonis d66e9cb
fntest: fixed btcio_read sometimes flaking
delbonis ca17169
fntest: fixed sync_genesis, converted some logs to prints (not sure w…
delbonis 767aee0
fntest: converted sync_genesis_with_btcblocks to use its own env too
delbonis 3f48ca7
fntest: added LOG_LEVEL envvar default as INFO, updated sync_genesis …
delbonis 3d85580
fntest: tweaked rpc_recent_blocks to maybe make it flake less
delbonis 3ebd783
state: removed `ClientStateWrite`, reworked types, added wrapper for …
delbonis ba39397
consensus-logic, db, misc: reworked more components to reflect tip-le…
delbonis 3ee6127
primitives: added Display impl for L1BlockCommitment, should have inc…
delbonis b22d437
rocksdb-store: cleaned up references to client state database
delbonis 08c9511
misc: fixed remaining references that needed to be updated
delbonis 5654633
consensus-logic: partly fixed CSM unit tests
delbonis 79416f3
consensus-logic: fixed CSM test
delbonis f38e213
rocksdb-store: fixed constructing bootstrap client state
delbonis 50545a7
state: started removing CSM chain tip related fns
delbonis 096649a
consensus-logic: reworked FCM to reflect chain tip and type changes
delbonis 1d1cfab
state: added FCM state type
delbonis 44adbf7
misc: refactoring duties
delbonis b0db0e1
primitives, state: moved EpochCommitment to primitives crate
delbonis c556bd4
misc: added more work on duty2 subsystem
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
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.
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?