-
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
fix(da_compression): invalid decompression of utxo id and CoinConfig fix #2593
Conversation
82db7e1
to
ea8f325
Compare
Co-Authored-by: green <xgreenx9999@gmail.com> test: mint tx monkeypatch fix: clippy fix: undo backward compat breaking change fix: p2p test helpers overlapping output_index fix f
ea8f325
to
bc0849a
Compare
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.
Thank you for spotting and fixing this! 🙏
crates/compression/src/decompress.rs
Outdated
let transaction_count = transactions.len(); | ||
|
||
// patch mint transaction | ||
for tx in transactions.iter_mut() { |
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.
Last transition is always mint, I think we can assume it and avoid iteration.
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.
addressed in 1afd5d8
crates/compression/src/decompress.rs
Outdated
// we should probably include the mint TxPointer in the compression if we decide to support | ||
// multiple assets for mints, i.e more than 1 mint tx per 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.
To support multiple assets to pay for fee, we will just introduce MintV2, with vector of assets and fee.
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.
addressed in a379fdc
@@ -157,6 +121,54 @@ impl GenesisCommitment for Coin { | |||
} | |||
} | |||
|
|||
#[cfg(feature = "test-helpers")] | |||
pub mod coin_config_helpers { |
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.
This code not only used in tests, it is used in production in the case of state config.
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.
I see it used in 2 places in chain-config/src/config/state.rs
, random_testnet()
and local_testnet()
both of which are hidden behind test-helpers. is the code you're talking about in a different repo?
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.
Hmm, maybe we don't use it anymore in the state config, then okay=) It would be nice to put the section in decompression under the same feature flag too then
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.
cool
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.
addressed in e9eb633
let mut bytes = [0u8; 32]; | ||
let tx_index = c.tx_pointer.tx_index(); | ||
bytes[..std::mem::size_of_val(&tx_index)] | ||
.copy_from_slice(&tx_index.to_be_bytes()); | ||
return Ok(fuel_core_types::fuel_tx::UtxoId::new( | ||
bytes[..size_of::<u16>()].copy_from_slice(&c.output_index.to_be_bytes()); | ||
|
||
let utxo_id = fuel_core_types::fuel_tx::UtxoId::new( | ||
fuel_core_types::fuel_tx::TxId::from(bytes), | ||
0, | ||
)); | ||
c.output_index, | ||
); |
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 would be nice to use the same function here and in CoinConfigGenerator
. Could you reuse it in both places please to connect them?
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.
addressed in e9eb633
## Version v0.41.1 * fault_proving(compression): include block_id in da compressed block headers by @rymnc in #2551 * chore: Add myself and Andrea as codeowner for graphql API + related crates by @netrome in #2570 * fix(integration_tests): remove flake from produce_block__l1_committed_block_affects_gas_price by @rymnc in #2566 * bugfix: Improve the `BlockCommitterHttpApi` client to use `url` apis better by @MitchTurner in #2599 * Fix version compatibility error by @AurelienFT in #2608 * Improve error messages for responses from committer by @MitchTurner in #2609 * Update async processor tests by @rafal-ch in #2577 * The amount of returned dust coins is limited by factor relative to the amount of selected big coins by @rafal-ch in #2610 * fix(da_compression): invalid decompression of utxo id and CoinConfig fix by @rymnc in #2593 * Use latest gas price to estimate next price for tx pool checks by @MitchTurner in #2612 * Set Latest Recorded Height on startup by @MitchTurner in #2603 * Use latest gas price to estimate next block gas price during dry runs by @MitchTurner in #2615 * Check that fuel-core lib builds correctly without default features by @rafal-ch in #2594 * Expose indexation status in `NodeInfo` endpoint by @rafal-ch in #2595 **Full Changelog**: v0.41.0...v0.41.1
Linked Issues/PRs
some investigation related to why transaction ids were mismatching before compression and after decompression
Description
AI generated:
Code Organization:
crates/chain-config/src/config/coin.rs
: MovedCoinConfigGenerator
to a newcoin_config_helpers
module and updated its implementation to use aCoinCount
type.CoinConfigGenerator
across multiple files to use the newcoin_config_helpers
module. [1] [2] [3] [4] [5] [6] [7]Decompression Logic:
crates/compression/src/decompress.rs
: Modified the decompression logic to handle mint transactions correctly and ensure the TxPointer is set appropriately. [1] [2]Testing and Configuration:
tests/tests/da_compression.rs
: Enhanced the test for fetching DA compressed blocks from GraphQL by adding additional checks and ensuring the transactions' IDs match. [1] [2]Miscellaneous:
where
clauses to clean up the codebase. [1] [2] [3] [4] [5] [6]Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]