-
Notifications
You must be signed in to change notification settings - Fork 55
feat(iota-core): gas price feedback mechanism for transactions cancelled due to congestion #7456
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
Merged
roman1e2f5p8s
merged 5 commits into
develop
from
protocol-research/feat/gas-price-feedback
Jul 29, 2025
Merged
feat(iota-core): gas price feedback mechanism for transactions cancelled due to congestion #7456
roman1e2f5p8s
merged 5 commits into
develop
from
protocol-research/feat/gas-price-feedback
Jul 29, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 6 Skipped Deployments
|
alexsporn
reviewed
Jun 23, 2025
alexsporn
reviewed
Jun 23, 2025
alexsporn
reviewed
Jun 23, 2025
12 tasks
alexsporn
pushed a commit
that referenced
this pull request
Jun 23, 2025
…k feature flag; downgrade toml_edit version (#7501) # Description of change - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. ## Links to any relevant issues ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes ### Release Notes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
roman1e2f5p8s
added a commit
that referenced
this pull request
Jul 28, 2025
…k feature flag; downgrade toml_edit version (#7501) - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
402f3f2 to
fb83781
Compare
roman1e2f5p8s
added a commit
that referenced
this pull request
Jul 28, 2025
…k feature flag; downgrade toml_edit version (#7501) - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
fb83781 to
c7c8969
Compare
thibault-martinez
approved these changes
Jul 28, 2025
Member
thibault-martinez
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.
Approving dev-tools
roman1e2f5p8s
added a commit
that referenced
this pull request
Jul 28, 2025
…k feature flag; downgrade toml_edit version (#7501) - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: Signed-off-by: Roman Overko <[email protected]>
c7c8969 to
035d5bd
Compare
035d5bd to
ffa47ff
Compare
TheMrAI
approved these changes
Jul 28, 2025
miker83z
approved these changes
Jul 28, 2025
cyberphysic4l
approved these changes
Jul 28, 2025
muXxer
approved these changes
Jul 28, 2025
ffa47ff to
11dc642
Compare
Contributor
Author
|
Changed year in Copyright to 2025. |
roman1e2f5p8s
added a commit
that referenced
this pull request
Jul 29, 2025
…k feature flag; downgrade toml_edit version (#7501) - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: Signed-off-by: Roman Overko <[email protected]>
11dc642 to
284bb82
Compare
…for transactions cancelled due to congestion (#6280) This PR adds a gas price feedback mechanism for transactions cancelled due to shared object congestion. For more detail, see the corresponding issue. Closes #6206 Breaking change (fix or feature that would cause existing functionality to not work as expected). The most crucial changes, I believe, that require thorough reviews from the code owners include: - Embedding the suggested gas price for cancelled transactions into the sequence number of congested shared objects: https://github.com/iotaledger/iota/blob/9bd3ea8f0c4b306d79e12b25cdaa07729f17038a/crates/iota-types/src/base_types.rs#L1209-L1220 - Adding a new execution failure status: https://github.com/iotaledger/iota/blob/467bfae0bb8c2e1f2d28911dd366142d468b762b/crates/iota-types/src/execution_status.rs#L200-L210 I did not run all the existing tests locally, but those that required changes were modified to pass: ```console cargo simtest -p iota-core unit_tests congestion_control_tests::test_congestion_control_execution_cancellation cargo simtest -p iota-core test_consensus_handler_congestion_control_transaction_cancellation cargo simtest -p iota-benchmark test_simulated_load_large_consensus_commit_prologue_size cargo test -p iota-core authority::shared_object_congestion_tracker::object_cost_tests cargo test -p iota-core authority::shared_object_version_manager::tests::test_assign_versions_from_consensus_with_cancellation cargo test -p iota-core transaction_manager_with_cancelled_transactions ``` Additionally, run ```console UPDATE=1 cargo test -p iota-rest-api test::openapi_spec cargo -q run --example generate-format -- print > crates/iota-core/tests/staged/iota.yaml ``` - [x] I have followed the contribution guidelines for this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes --------- Co-authored-by: Andrew Cullen <[email protected]> Co-authored-by: Thoralf-M <[email protected]> Co-authored-by: Vlad Semenov <[email protected]> Signed-off-by: Roman Overko <[email protected]>
…k feature flag; downgrade toml_edit version (#7501) - `iota-core`: Place the new feature flag `congested_objects_gas_price_feedback_mechanism` at the bottom. - `iota-execution`: Downgrade `toml_edit` to `0.22`. It seems it was unnecessary bumped to `0.22.27` on the feature branch. See first three comments in #7456. - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: Signed-off-by: Roman Overko <[email protected]>
…mits (#7624) # Description of change This PR extend the gas price feedback mechanism to use the data from multiple consensus commit rounds for the suggested gas price calculations. Instead of calculating the suggested gas price using the data from a single commit round (the one in which the transaction is cancelled), in this PR, we calculate the suggested gas price at each commit a transaction is deferred, save the suggested gas price to the deferred transactions table, and update it every time a lower suggested gas price is found. ## Links to any relevant issues Closes #6353. ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes ### Release Notes - [x] Protocol: - [x] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: muXxer <[email protected]> Signed-off-by: Roman Overko <[email protected]>
…or gas price feedback mechanism (#6490) This PR add a `SuggestedGasPriceCalculator` component that collects congestion data from a single commit in order to calculate a suggested gas price for transactions deferred/cancelled due to shared object congestion. The component works similarly to `SharedObjectCongestionTracker` in the sense that a new instance of `SuggestedGasPriceCalculator` is created for each consensus commit round. The calculator supports suggested gas price calculations for both new (#5763) and old `SharedObjectCongestionTracker` (configured by the `congestion_control_min_free_execution_slot` feature flag), as well as for any currently available `PerObjectCongestionControlMode` mode. Calculated suggested gas prices are intended for use in the gas price feedback mechanism #6280 for transactions cancelled due to shared object congestion. Closes #6351. ```console cargo test -p iota-core authority::suggested_gas_price_calculator ``` - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes - [x] Protocol: - [x] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: Andrew <[email protected]> Co-authored-by: cuileri <[email protected]> Co-authored-by: Andrew Cullen <[email protected]> Signed-off-by: Roman Overko <[email protected]>
…7906) - This PR adds unit tests to test the gas price feedback mechanism. The aim is to test all the components: the mechanism itself, calculations of suggested gas price and its propagation across multiple commits. - Instead of panic, the calculator will now suggest reference gas price (or max clearing gas price) if transaction duration exceeds `max_execution_duration_per_commit`. - Renamed `congested_objects_gas_price_feedback_mechanism` feature flag to `congestion_control_gas_price_feedback_mechanism`. ```console cargo simtest -p iota-core unit_tests gas_price_feedback_tests ``` - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [x] Patch-specific tests (correctness, functionality coverage) - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: Signed-off-by: Roman Overko <[email protected]>
284bb82 to
ccadcd2
Compare
polinikita
approved these changes
Jul 29, 2025
kodemartin
approved these changes
Jul 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
This PR introduces and implements a gas price feedback mechanism for shared object transactions cancelled due to congestion. The goal of the gas price feedback mechanism is to inform the senders of cancelled transactions about suggested gas prices they should have paid in order for their transactions to be scheduled for execution instead of being deferred/cancelled.
Note
This is a long-living feature branch. The PR contains the changes have been individually reviewed before squash-merging.
Important
This PR should be merged into
developwithout squashing as it already contains squashed PRs.Links to any relevant issues
How the change has been tested
Release Notes
AuthorityEpochTablesnow includes a new tabledeferred_transactions_v2, which additionally holds suggested gas price for deferred transactions across multiple consensus commit rounds. At each consensus commit round, nodes also run a suggested gas price calculator that keeps track of congestion info and calculates the suggested gas price if the mechanism is enabled.ExecutionError(and its equivalentExecutionFailureStatus) now contains a new variantExecutionCancelledDueToSharedObjectCongestionV2, which (besides congested objects) contains suggested gas price.