-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add more graceful handling of the huge number of transactions during production #2114
Comments
I'll start working on this one, will probably add more comments with questions to get context |
What is a FTI transaction? |
FTI - Force transaction inclusion. You can submit the transaction to L1 instead of L2(maybe someone censorships your transaction), and it will be included when the block producer increases the DA block height. FTI - is a regular transaction that just comes from L1, instead of TxPool. |
…2199) Closes #1887 Closes FuelLabs/fuel-vm#797 Related #2114 Related #2133 This PR contains several small breaking changes to the WASM interface: - Get the module to execute WASM byte code from the storage first, an fallback to the built-in version in the case of the `FUEL_ALWAYS_USE_WASM`. - Added `host_v1` with a new `peek_next_txs_size` method, that accepts `tx_number_limit` and `size_limit`. - Added new variant of the return type to pass the validation result. It removes block serialization and deserialization and should improve performance. - Added a V1 execution result type that uses `JSONError` instead of postcard serialized error. It adds flexibility of how variants of the error can be managed. More information about it in FuelLabs/fuel-vm#797. The change also moves `TooManyOutputs` error to the top. It shows that `JSONError` works as expected. - Use a WASM generated bytecode for the local testnet since we always want to use the latest version compatible with native execution. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here - #2198 - #2200 --------- Co-authored-by: Rafał Chabowski <[email protected]> Co-authored-by: Hannes Karppila <[email protected]>
…ed (#2182) ## Linked Issues/PRs <!-- List of related issues/PRs --> Part of #2114 ## Description - Add a new argument `transactions_limit: u16` to the function `TxSource::next()`. - Changes the logic of the block production to never exceed `u16::MAX` transactions (included FTI transactions and mint transactions) when selecting L2 transacitons. The number of transactions can still exceed `u16::MAX` when selecting transactions from L1. This is addressed in #2189. - Changes the implementation of all TxSource adapters to fetch a number of transactions below or equal to the `transaction_limit`. - Introduces a new WASM host function to peek the next transactions size for a number of transactions below a specified limit. Breaks forward compatibility of the genesis transition function. See https://github.com/FuelLabs/fuel-core/blob/8eeae5d6730d34ae06390b7797478bb98fd07987/version-compatibility/forkless-upgrade/README.md ## TODO: - [x] Check that requirements are met - [x] Implementation for the WasmTxSource is missing (only the argument has been added) - [ ] Integration Tests ## Checklist - [ x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else?
…tions from L1 (#2189) ## Linked Issues/PRs <!-- List of related issues/PRs --> Part of #2114 ## Description When producing a block, we want to make sure that we never include more than 65_536 transactions. To this end, we select the DA height for including Forced transactions so that no more than 65_535 transactions will ever be included. Changes: - A new function for the RelayerPort to get the number of forced transactions at a given level - Refactor the function `select_new_da_height` to return early if more than 65_535 transactions will be included. - Test the changes to the `select_new_da_height` function. - ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Green Baneling <[email protected]>
…ed (#2182) ## Linked Issues/PRs <!-- List of related issues/PRs --> Part of #2114 ## Description - Add a new argument `transactions_limit: u16` to the function `TxSource::next()`. - Changes the logic of the block production to never exceed `u16::MAX` transactions (included FTI transactions and mint transactions) when selecting L2 transacitons. The number of transactions can still exceed `u16::MAX` when selecting transactions from L1. This is addressed in #2189. - Changes the implementation of all TxSource adapters to fetch a number of transactions below or equal to the `transaction_limit`. - Introduces a new WASM host function to peek the next transactions size for a number of transactions below a specified limit. Breaks forward compatibility of the genesis transition function. See https://github.com/FuelLabs/fuel-core/blob/8eeae5d6730d34ae06390b7797478bb98fd07987/version-compatibility/forkless-upgrade/README.md ## TODO: - [x] Check that requirements are met - [x] Implementation for the WasmTxSource is missing (only the argument has been added) - [ ] Integration Tests ## Checklist - [ x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else?
…tions from L1 (#2189) ## Linked Issues/PRs <!-- List of related issues/PRs --> Part of #2114 ## Description When producing a block, we want to make sure that we never include more than 65_536 transactions. To this end, we select the DA height for including Forced transactions so that no more than 65_535 transactions will ever be included. Changes: - A new function for the RelayerPort to get the number of forced transactions at a given level - Refactor the function `select_new_da_height` to return early if more than 65_535 transactions will be included. - Test the changes to the `select_new_da_height` function. - ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Green Baneling <[email protected]>
Reopening, Still need to update the minimal gas price |
The total number of allowed transactions per block is
65535
due to theTxPointer
limitations.Our current network configuration handles it.
But since we plan to have many custom rollups that use
fuel-core
. It would be nice to add more graceful handling of a huge number of transitions.We have several places where we need to handle it:
TxPool
based on the remaining gas. We need to also take into account the remaining number of transaction slots. Note: FTI transactions also occupy slots.1
https://github.com/FuelLabs/fuel-bridge/pull/215/files#diff-cf9b39d4822d2f60928e44960317ad86812ccf644704cfdd364279ba02e673acR10. Maybe10_000
is not bad as a default value.The text was updated successfully, but these errors were encountered: