-
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: Fix commit error on GraphQL service startup #1802
Conversation
…thub.com/FuelLabs/fuel-core into bvrooman/fix/fix-graphql-service-startup
@@ -141,6 +142,14 @@ where | |||
Ok(new_tx_count) | |||
} | |||
|
|||
fn get_tx_count(&self) -> StorageResult<u64> { | |||
const TX_COUNT: &str = "total_tx_count"; |
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 move it on one level upper. And reuse inside of the increase_tx_count
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.
By one level up, do you mean the Transactional
trait?
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 mean reuse one constant in two functions=) Define it on file level instead of function level
…bvrooman/fix/fix-graphql-service-startup
db_tx.commit()?; | ||
graphql_metrics().total_txs_count.set(total_tx_count as i64); | ||
{ | ||
let db_tx = self.database.transaction(); |
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.
if we aren't doing a commit here, do we still need a transaction?
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.
No, we don't, but it will require changing of constraints for the port=D I'm okay with using transaction for now to just fix the issue and release a new fuel-core
with the fix=)
## Version v0.24.2 ### Changed #### Breaking - [#1798](#1798): add nonce to relayed transactions and also hash full messages in the inbox root. ### Fixed - [#1802](#1802): Fixed a runtime panic that occurred when restarting a node. The panic was caused by an invalid database commit while loading an existing off-chain database. The invalid commit is removed in this PR. - [#1803](#1803): Produce block when da height haven't changed. - [#1795](#1795): Fixed the building of the `fuel-core-wasm-executor` to work outside of the `fuel-core` context. The change uses the path to the manifest file of the `fuel-core-upgradable-executor` to build the `fuel-core-wasm-executor` instead of relying on the workspace. ## What's Changed * Weekly `cargo update` by @github-actions in #1794 * Improvements for the `fuel-core-upgradable-executor` build script by @xgreenx in #1795 * Use full hash for messages in inbox_root and add nonce to relayed transactions by @Voxelot in #1798 * Modify block producer to take into account the total gas used by the L1 transactions by @MitchTurner in #1785 * Fix: Produce block when da height haven't changed by @xgreenx in #1803 * fix: Fix commit error on GraphQL service startup by @bvrooman in #1802 **Full Changelog**: v0.24.1...v0.24.2
## Version v0.24.2 ### Changed #### Breaking - [#1798](FuelLabs/fuel-core#1798): add nonce to relayed transactions and also hash full messages in the inbox root. ### Fixed - [#1802](FuelLabs/fuel-core#1802): Fixed a runtime panic that occurred when restarting a node. The panic was caused by an invalid database commit while loading an existing off-chain database. The invalid commit is removed in this PR. - [#1803](FuelLabs/fuel-core#1803): Produce block when da height haven't changed. - [#1795](FuelLabs/fuel-core#1795): Fixed the building of the `fuel-core-wasm-executor` to work outside of the `fuel-core` context. The change uses the path to the manifest file of the `fuel-core-upgradable-executor` to build the `fuel-core-wasm-executor` instead of relying on the workspace. ## What's Changed * Weekly `cargo update` by @github-actions in FuelLabs/fuel-core#1794 * Improvements for the `fuel-core-upgradable-executor` build script by @xgreenx in FuelLabs/fuel-core#1795 * Use full hash for messages in inbox_root and add nonce to relayed transactions by @Voxelot in FuelLabs/fuel-core#1798 * Modify block producer to take into account the total gas used by the L1 transactions by @MitchTurner in FuelLabs/fuel-core#1785 * Fix: Produce block when da height haven't changed by @xgreenx in FuelLabs/fuel-core#1803 * fix: Fix commit error on GraphQL service startup by @bvrooman in FuelLabs/fuel-core#1802 **Full Changelog**: FuelLabs/fuel-core@v0.24.1...v0.24.2
Related issues:
fuel-core 0.24.1
#1801This PR removes the unnecessary DB commit that occurs during startup of the GraphQL API service. Because the committed transaction has no corresponding change in block height, the state transition fails and throws an error. This error then causes startup of the Fuel node to fail.
This can currently happen in local and production builds, but we did not have coverage for this in test. This is because this requires loading the off-chain database using something like
CombinedDatabase::open(...)
, while most tests in the codebase use a default off-chain database, i.e.from_database
:This PR introduces a test that performs the following steps:
Before removing the commit, this test failed with the observed failure:
With the code change, this test passes.