-
Notifications
You must be signed in to change notification settings - Fork 346
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
precompile-utils refactor #2165
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nanocryk
added
A3-inprogress
Pull request is in progress. No review needed at this stage.
B0-silent
Changes should not be mentioned in any release notes
C3-medium
Elevates a release containing this PR to "medium priority".
D9-needsaudit👮
PR contains changes to fund-managing logic that should be properly reviewed and externally audited
breaking
Needs to be mentioned in breaking changes
labels
Mar 16, 2023
nanocryk
added
A0-pleasereview
Pull request needs code review.
and removed
A3-inprogress
Pull request is in progress. No review needed at this stage.
labels
Mar 17, 2023
librelois
reviewed
Apr 13, 2023
librelois
approved these changes
Apr 13, 2023
notlesh
approved these changes
Apr 17, 2023
notlesh
added
D1-audited👍
PR contains changes to fund-managing logic that has been properly reviewed and externally audited
and removed
D9-needsaudit👮
PR contains changes to fund-managing logic that should be properly reviewed and externally audited
labels
Apr 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A0-pleasereview
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
breaking
Needs to be mentioned in breaking changes
C3-medium
Elevates a release containing this PR to "medium priority".
D1-audited👍
PR contains changes to fund-managing logic that has been properly reviewed and externally audited
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Refactor
precompile-utils
in preparation of migrating it into frontier.Crate is re-organized to group features by domain:
solidity
: Conventions related to the Solidity language or ABIcodec
: Solidity data encoding, old::data
.EvmData
/EvmDataWriter
/EvmDataReader
are renamed intoCodec
/Writer
/Reader
, and are moved insidesolidity::codec
module.Codec
is re-exported insidesolidity
which itself is included in the prelude, such that using the prelude allows to usesolidity::Codec
.Codec
is not included directly in the prelude to avoid confusion withparity_scale_codec
.Codec
is both the trait and the derive macro.Reader
andWriter
are no longer re-exported in the prelude, instead functions likeencode_arguments
ordecode_arguments
should be used (with tuples for multiple values).modifier
: Checks related toview
andpayable
keywords in Solidity.revert
: Allow generating more detailed error message that can include "backtraces" inside struct/array decoding.evm
: Utils related more closely to EVM functionalitylogs
: Basic functions to create logs. A derive macro on structs would be better in the future.handle
: Contains an extension trait to add helpers onimpl PrecompileHandle
. Also contain an environmental used mainly to support re-entrancy with local XCM execution.costs
: few gas cost computation functions copied from the EVM. Should be made public instead inside the EVM itself.testing
: Provide functions and mocks to more easily write precompile tests. As encoding has been largely improvedexecute_returns_encoded
is shortened asexecute_returns
, while oldexecute_returns
is renamedexecute_returns_raw
. There shouldn't be a need to useexecute_returns_raw
but I leave it just in case.substrate
: Allows dispatching Substrate call with weight to gas convertion and proper gas checks and recording.precompile_set
: Allows constructing a precompile set from other precompiles or precompile sets with opt-out security checks.Left for future PRs
Implement derive macro from events.