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

Take into account used gas during block production and include more transactions if we can #1220

Merged
merged 5 commits into from
Jun 21, 2023

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Jun 20, 2023

The PR implements #1217 for the beta 3 testnet

@xgreenx xgreenx requested a review from a team June 20, 2023 19:34
@xgreenx xgreenx self-assigned this Jun 20, 2023
) -> Self {
Self {
txpool,
_block_height: block_height,
Copy link
Member

@Voxelot Voxelot Jun 21, 2023

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?

Copy link
Collaborator Author

@xgreenx xgreenx Jun 21, 2023

Choose a reason for hiding this comment

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

Yes:) The code before did the same
image

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>,
Copy link
Contributor

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

Comment on lines +187 to +200
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),
};

Copy link
Contributor

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

Copy link
Collaborator Author

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=)

xgreenx and others added 2 commits June 21, 2023 15:14
Copy link
Contributor

@leviathanbeak leviathanbeak left a 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 :)

@xgreenx xgreenx requested review from Voxelot, leviathanbeak and a team June 21, 2023 16:01
@xgreenx xgreenx merged commit b58b84e into release/v0.17.13 Jun 21, 2023
20 checks passed
@xgreenx xgreenx deleted the release/gas-limit-fix branch June 21, 2023 19:41
@Voxelot Voxelot mentioned this pull request Jun 21, 2023
xgreenx added a commit that referenced this pull request Jun 22, 2023
… more transaction (#1223)

Closes #1217 for the
`master`.

Release `0.17.13` was packed with the same change
#1220

---------

Co-authored-by: Elvis <elvisdedic@outlook.com>
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.

None yet

3 participants