-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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 optional args to dev inspect on fullnode #15679
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
3fd4e5a
to
153b872
Compare
153b872
to
690eec6
Compare
690eec6
to
9a0a47e
Compare
37d034e
to
1e04c1e
Compare
1e04c1e
to
df03fd5
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.
Thanks @emmazzz, this looks great! Take a look at the comment about the check_transaction_for_signing
test, I don't think that should be guarded, but otherwise good to go!
crates/sui-core/src/authority.rs
Outdated
} else { | ||
if transaction.gas().is_empty() { |
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: collapse the else
and if
here?
transaction.gas().to_vec() | ||
}; | ||
|
||
let (gas_status, checked_input_objects) = if skip_checks { |
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.
There seems to be some interesting nuances between the interfaces for these various kinds of check (e.g. some of these APIs seem to expect the gas object in the inputs, some not, etc etc). It's probably something we can simplify (later), but for now, can you add some comments to this part to call out those differences?
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.
Yup, this is precisely why I did not collapse the else
and if
- not collapsing them would make the conditions more clear and code more readable imo. I'll add some comments explaining this.
gas_price.map(|i| *i), | ||
gas_budget.map(|i| *i), |
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.
Could this be done with .copied
?
gas_price.map(|i| *i), | |
gas_budget.map(|i| *i), | |
gas_price.copied(), | |
gas_budget.copied(), |
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 map
here is for converting an Option<BigInt<u64>>
to an Option<u64>
.
gas_budget.map(|i| *i), | ||
gas_sponsor, | ||
gas_objects, | ||
epoch.map(|i| *i), |
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.
Ditto
a8ae7f8
to
a986649
Compare
## Description This PR makes two changes: - Added an option to dev inspect arguments to return the raw transaction data. This is needed to implement dry run from graphql side. - In a previous PR #15679 , I started using the unused `epoch` parameter as transaction expiration epoch for dev inspect, which is apparently wrong. This `epoch` was supposed to be for running a txn in a previous epoch, which was never implemented. So this PR reverted that change and kept ignoring `epoch`. ## Test Plan Existing tests. --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [x] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes Added an option to return raw transaction data for dev inspect.
Description
For graphql we would like to combine dry run and dev inspect functionality, and any behavior difference between the two should be made toggleable via user provided options, which will look a lot like the newly added struct
DevInspectArgs
in this PR. This PR modifies the dev inspect code to make implementing new dev inspect easier. It also adds optional additional args to dev inspect APIs.Test Plan
existing tests
If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.
Type of Change (Check all that apply)
Release notes
Add optional additional parameters to
dev_inspect_transaction_block
including gas_budget, gas_objects, gas_sponsor and skip_checks.