-
Notifications
You must be signed in to change notification settings - Fork 65
apollo_gateway: expose l2_gas_price towards reject on insufficient gas price #7712
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
apollo_gateway: expose l2_gas_price towards reject on insufficient gas price #7712
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ayeletstarkware
left a comment
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.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @alonh5)
crates/apollo_gateway/src/stateful_transaction_validator.rs line 113 at r1 (raw file):
// StatefulTransactionValidator and update it only once a new block is created. let latest_block_info = get_latest_block_info(state_reader_factory)?; let l2_gas_price = latest_block_info.gas_prices.strk_gas_prices.l2_gas_price;
Consider calling these lines outside this function (in process_tx or in a helper function)? because this function instantiates a blockifier stateful validator and the l2 gas price is not a part of it (?)
OR, change the func name
Code quote:
let latest_block_info = get_latest_block_info(state_reader_factory)?;
let l2_gas_price = latest_block_info.gas_prices.strk_gas_prices.l2_gas_price;crates/apollo_gateway/src/stateful_transaction_validator.rs line 130 at r1 (raw file):
); let blockifier_statefult_validator =
Suggestion:
blockifier_stateful_validatorb6aa95b to
a1cf12f
Compare
|
Artifacts upload workflows: |
ArniStarkware
left a comment
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.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @alonh5)
crates/apollo_gateway/src/stateful_transaction_validator.rs line 113 at r1 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
Consider calling these lines outside this function (in
process_txor in a helper function)? because this function instantiates a blockifier stateful validator and the l2 gas price is not a part of it (?)
OR, change the func name
Done.
crates/apollo_gateway/src/stateful_transaction_validator.rs line 130 at r1 (raw file):
); let blockifier_statefult_validator =
stale
ayeletstarkware
left a comment
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @alonh5)
alonh5
left a comment
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
alonh5
left a comment
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
a discussion (no related file):
Please add @ShahakShama and @dan-starkware as reviewers to this stack
ShahakShama
left a comment
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @dan-starkware)
crates/apollo_gateway/src/gateway.rs line 209 at r2 (raw file):
// threshold. let _l2_gas_price = validator.block_context().block_info().gas_prices.strk_gas_prices.l2_gas_price;
You have the next_l2_gas_price inside the block header. Why not use it?
a1cf12f to
2d41454
Compare
ArniStarkware
left a comment
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.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @alonh5, @ayeletstarkware, @dan-starkware, and @ShahakShama)
crates/apollo_gateway/src/gateway.rs line 209 at r2 (raw file):
Previously, ShahakShama wrote…
You have the next_l2_gas_price inside the block header. Why not use it?
-
I see that the gateway's state reader will always produce a
SyncStateReader. The type ofStateReaderFactoryallows us to produce anRpcStateReader. It might no longer be supported, but a refactor is required for us to count on it at this point in the code.RpcStateReaderdoes not have the fieldnext_l2_gas_priceIIUC. -
I don't want to make other blocking calls to the state to the state reader. There is a call to
get_block_info. This call is blocking on an async action:
let block = block_on(self.state_sync_client.get_block(self.block_number))
Again, we can refactor theSyncStateReaderto expose this interface, and hopefully do fewer blocking calls, but this requires a refactor. -
I didn't want to break the abstraction (a lot), so I used the existing executor.
Possible solution - create a wrapper to BlockInfo that also holds (an optional?) next_l2_gas_price.
Anyway - sounds like work for another day. Correct? Added a todo.
ArniStarkware
left a comment
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.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @alonh5, @ayeletstarkware, @dan-starkware, and @ShahakShama)
a discussion (no related file):
Previously, alonh5 (Alon Haramati) wrote…
Please add @ShahakShama and @dan-starkware as reviewers to this stack
Now merging into main-v0.14.0. This comment is no longer relevant.
ShahakShama
left a comment
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5, @ayeletstarkware, and @dan-starkware)
2d41454 to
a21723c
Compare
415c316 to
bfaf4cb
Compare
|
Benchmark movements: No major performance changes detected. |
ayeletstarkware
left a comment
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.
Reviewed 2 of 4 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @dan-starkware)
ArniStarkware
left a comment
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.
Dismissed @alonh5 from a discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @alonh5 and @dan-starkware)

No description provided.