-
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
Dry run in the past #2661
Dry run in the past #2661
Conversation
One test is failing due to a pthread issue (that I cannot reproduce locally). I'll have to setup a linux env to figure this one out, unless someone already knows what's the issue. |
Let me see if I can reproduce it on one of my Linux machines. |
Which test? All I can see is |
|
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.
Looks good to me=) Small things to fix and good to go form my side=D
crates/fuel-core/src/schema/tx.rs
Outdated
if block_height.is_some() && !config.debug { | ||
return Err(anyhow::anyhow!( | ||
"The `blockHeight` parameter requires the `--debug` option" | ||
) | ||
.into()); | ||
} |
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 still uses --debug
and .debug
.
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.
Fixed in 2245cc1
let allow_historical_execution = config.combined_db_config.database_type | ||
== DbType::RocksDb | ||
&& config.historical_execution; |
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 think we need allow it on config level for the whole fuel-core
, including the GraphQL and other services.
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.
Okay I cannot reproduce this locally either. I tried both the latest version, on 52a981a and on 07013c7. I'll proceed with reviewing and assume this was caused cosmic background radiation. |
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.
Looks good to me 👍
} | ||
|
||
#[tokio::test(flavor = "multi_thread")] | ||
async fn dry_run__correct_utxoid_state_in_past_blocks() -> anyhow::Result<()> { |
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.
Nit: It would be nice to add "Given" "When" "Then" sections to this test.
@@ -760,7 +760,7 @@ type Mutation { | |||
""" | |||
Execute a dry-run of multiple transactions using a fork of current state, no changes are committed. | |||
""" | |||
dryRun(txs: [HexString!]!, utxoValidation: Boolean, gasPrice: U64): [DryRunTransactionExecutionStatus!]! | |||
dryRun(txs: [HexString!]!, utxoValidation: Boolean, gasPrice: U64, blockHeight: U32): [DryRunTransactionExecutionStatus!]! |
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.
Perhaps we should consider combining the utxoValidation
, gasPrice
and blockHeight
args into a single input struct. This would allow us to add more fields in the future without breaking the API (though currently it's still breaking if we use the new arg in the client until we resolve #2676).
If you think this sounds sensible, we could create a follow-up issue for it.
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.
The extra args are already optional, isn't that already good enough? But it's good to consider the forward compatibility. I'm not sure if a struct would help in this case?
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.
A couple of post-merge questions and comments.
Closes #2062
Description
Support dry running in past blocks. It's behind the
--historical-execution
flag.Checklist
Before requesting review
After merging, notify other teams