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

fix(block_production): continue pending block now reexecutes the previous transactions #411

Merged
merged 5 commits into from
Dec 17, 2024

Conversation

cchudant
Copy link
Member

Pull Request type

  • Bugfix
  • Refactoring (no functional changes, no API changes)

What is the current behavior?

We had a hacky way of continuing the pending block state on restart.

What is the new behavior?

Now, we re-add all the transactions from the pending block into the mempool when restarting with a priority.

I also did some refactoring here and there:

  • added a backend get_converted_class method - BlockifierStateAdaptor, rpc to_blockifier_transaction & cie use that now instead of the duplicate code we used to have
  • some helper functions to get from converted classes to blockifier class info format, remove some duplicate code
  • removed the rpc to_blockifier_transaction logic (used for trace txs). It is now inside the primitives & shared with other places in the codebase.
  • mempool_tx_max_age is now optional & defaults to no limit (this limit doesn't really make sense for FCFS-style sequencing anyway)
  • moved devnet e2e tests inside their own file
  • block timestamp in block headers have now a wrapper type, because a plain u64 was confusing :)

Does this introduce a breaking change?

No, db remains unchanged.

@cchudant
Copy link
Member Author

note: the file change count is 45 which seems like a lot, but most files have a 1-line change. I don't believe this is a large PR

@jbcaron jbcaron added bug Report an issue or unexpected behavior sequencer Related to the sequencing logic and implementation labels Dec 10, 2024
Comment on lines +115 to +117
/// Get class info + sierra compiled when it's a sierra class.
// Note/TODO: "ConvertedClass" is the name of the type that has info + sierra compiled, and it is used for blockifier
// convertion & storage. We should rename it, as this feels like undecipherable madara-specific jargon at this point.
Copy link
Member

Choose a reason for hiding this comment

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

We could rename it to ResolvedClass or CanonicalClass

Copy link
Member Author

Choose a reason for hiding this comment

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

why canonical?

@@ -26,53 +26,26 @@ pub enum Error {
///
/// **note:** this function does not support deploy transaction
/// because it is not supported by blockifier
pub fn to_blockifier_transactions(
pub fn to_blockifier_transaction(
Copy link
Member

Choose a reason for hiding this comment

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

👍

crates/client/rpc/src/utils/transaction.rs Outdated Show resolved Hide resolved
@antiyro antiyro merged commit 237f31c into main Dec 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report an issue or unexpected behavior sequencer Related to the sequencing logic and implementation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants