-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Take into account used gas during block production and include more transactions if we can #1220
Conversation
…ransactions if we can
) -> Self { | ||
Self { | ||
txpool, | ||
_block_height: block_height, |
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.
Looks like block_height isnt used, is the idea for adding it here to enable selecting txs based on maturity requirements in the future?
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.
Co-authored-by: Elvis <elvisdedic@outlook.com>
/// Executes the block and returns the result of execution with uncommitted database | ||
/// transaction. | ||
fn execute_without_commit( | ||
&self, | ||
block: ExecutionBlock, | ||
) -> ExecutorResult<UncommittedResult<StorageTransaction<Database>>>; | ||
block: Components<Self::TxSource>, |
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.
nit: block: Components<T>
sounds a bit off, either updating the argument or maybe renaming Components
to something like BlockComponents
because the current name is not descriptive enough imo
let component = match block { | ||
ExecutionBlock::DryRun(block) => ExecutionTypes::DryRun(Components { | ||
header_to_produce: block.header, | ||
transactions_source: OnceTransactionsSource::new(block.transactions), | ||
gas_limit: u64::MAX, | ||
}), | ||
ExecutionBlock::Production(block) => ExecutionTypes::Production(Components { | ||
header_to_produce: block.header, | ||
transactions_source: OnceTransactionsSource::new(block.transactions), | ||
gas_limit: u64::MAX, | ||
}), | ||
ExecutionBlock::Validation(block) => ExecutionTypes::Validation(block), | ||
}; | ||
|
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.
nit: maybe this From<ExecutionBlock>
could be extracted
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.
It is only used once here for unit tests, and it is better to do that explicitly because it does not apply to other places=)
Co-authored-by: Elvis <elvisdedic@outlook.com>
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.
happy to approve once small nits are handled :)
…ase/gas-limit-fix
The PR implements #1217 for the beta 3 testnet