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

Standardise proposal creation process #1620

Open
wants to merge 9 commits into from

Conversation

86667
Copy link
Contributor

@86667 86667 commented Oct 11, 2024

Have leaders use the same proposal creation process whether via vote() (proposer for direct-chain with QC) or new_view() (proposer after previous block missed with AggQC). This closes #1320.

@86667 86667 linked an issue Oct 11, 2024 that may be closed by this pull request
@86667 86667 self-assigned this Oct 11, 2024
@86667 86667 marked this pull request as draft October 11, 2024 09:09
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood left a comment

Choose a reason for hiding this comment

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

This is much clearer, thank you :)

@86667 86667 force-pushed the 1320-wait-for-txns-before-proposing-an-empty-block-with-an-aggqc branch from 3fbacdd to f5becaf Compare October 14, 2024 11:39
@86667
Copy link
Contributor Author

86667 commented Oct 14, 2024

@JamesHinshelwood Thanks. This is ready for review now.

There is lots of state cloning going on which im not sure is necessary - will raise a separate PR with changes if so

@86667 86667 marked this pull request as ready for review October 14, 2024 11:49
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood left a comment

Choose a reason for hiding this comment

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

LGTM, thank you :)

Cloning State is generally okay, since the underlying DB is wrapped in an Arc so really you're just cloning the few extra bits we store along side it - The one thing to be cautious of there is not to make a bunch of pending change to the state, without calculating the root_hash() (thus keeping those changes in memory) and then cloning those. This is another reason I want to have:

  • One struct for state which we store and clone around
  • Another struct for the transient state on which we execute transactions and eventually get a root hash from

@86667 86667 added this pull request to the merge queue Oct 14, 2024
Any commits made after this event will not be merged.
github-merge-queue bot pushed a commit that referenced this pull request Oct 14, 2024
* feat: pass in qc and aggac to propose block if we have it

* feat: separate fn for adding qc and agg to early_block

* feat: pull out set timeout code into ready_for_block_proposal()

* fix: overwrite early_proposal if view no longer matches

* fix: consistency in function naming

* fix: set qc at beginning of early_block assembly

* fix: do not check votes for new view porposal

* fix: always fetch view value from proposal

* fix: do not attempt to create early proposal every time were ready to wait for timeout
@86667
Copy link
Contributor Author

86667 commented Oct 14, 2024

LGTM, thank you :)

Cloning State is generally okay, since the underlying DB is wrapped in an Arc so really you're just cloning the few extra bits we store along side it - The one thing to be cautious of there is not to make a bunch of pending change to the state, without calculating the root_hash() (thus keeping those changes in memory) and then cloning those. This is another reason I want to have:

  • One struct for state which we store and clone around
  • Another struct for the transient state on which we execute transactions and eventually get a root hash from

Yes agreed that would be cleaner - its too easy to make an error with the current code, as i did for these changes.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 14, 2024
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Oct 14, 2024
Any commits made after this event will not be merged.
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.

wait for txns before proposing an empty block with an AggQC
2 participants