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

Consensus worker task impl #34

Merged
merged 23 commits into from
Jun 7, 2024
Merged

Consensus worker task impl #34

merged 23 commits into from
Jun 7, 2024

Conversation

delbonis
Copy link
Contributor

@delbonis delbonis commented May 22, 2024

This is just a skeleton, there's some stuff coming from earlier PRs dripping into this PR. Will rebase.

Resolves: #16

@delbonis delbonis force-pushed the feature/consensus-loop branch 2 times, most recently from 257c55c to 35b387c Compare May 29, 2024 18:28
@delbonis delbonis force-pushed the feature/consensus-loop branch 2 times, most recently from 2e8be28 to aa36fb8 Compare June 5, 2024 21:17
@delbonis delbonis force-pushed the feature/consensus-loop branch from aa36fb8 to e1f6be6 Compare June 5, 2024 21:20
Comment on lines +68 to +69
fn process_ct_msg<D: Database, E: ExecEngineCtl>(
ctm: ChainTipMessage,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the function and args are quit abbreviated: what do you think of process_chaintip_message(message: ChainTipMessage...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make naming changes in another cleanup pass, there's also too many things that are "trackers".

Copy link
Contributor

@bewakes bewakes left a comment

Choose a reason for hiding this comment

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

This looks good. And is huge! Some queries and comments and a couple of nitpicks.

Regarding the nitpicks, I feel like at some places the names are a bit too abbreviated.

crates/consensus-logic/src/chain_tip.rs Outdated Show resolved Hide resolved
crates/consensus-logic/src/chain_tip.rs Show resolved Hide resolved
crates/consensus-logic/src/chain_tip.rs Show resolved Hide resolved
// Insert block into pending block tracker and figure out if we
// should switch to it as a potential head. This returns if we
// created a new tip instead of advancing an existing tip.
let cur_tip = cstate.chain_state().chain_tip_blockid();
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought this would be same as csstate.finalized_tip. What's the difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finalized is what's been proven on chain. The current tip is where we expect new blocks to be attached and what we treat as the current state. We take it out here since we need to figure out after attaching the block to the pending blocks tree if we're going to switch from the current block to that and how. This is still a bit unfinished and we'll have more sophisticated logic after we've figured out the rest of the block signing mechanics.

Comment on lines +25 to +29
params: Arc<Params>,

/// Underlying database hierarchy that writes ultimately end up on.
// TODO should we move this out?
database: Arc<D>,
Copy link
Contributor

Choose a reason for hiding this comment

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

params and database could be out I guess. As I understand, params will be constant during the worker running and is not specific to worker itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still reworking this, I'm planning on a type that specifically manages the current state and splits up the data some more. Not going to act on any of this yet until it's time for more general cleanup.

crates/evmctl/src/messages.rs Show resolved Hide resolved
crates/primitives/src/params.rs Show resolved Hide resolved
@delbonis delbonis marked this pull request as ready for review June 7, 2024 21:36
@delbonis delbonis merged commit 5c74694 into master Jun 7, 2024
@storopoli storopoli deleted the feature/consensus-loop branch November 28, 2024 10:37
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.

Initial state machine impl
3 participants