refactor: align precompile reverts with Solidity errors#1099
Open
nowooj wants to merge 7 commits intocosmos:mainfrom
Open
refactor: align precompile reverts with Solidity errors#1099nowooj wants to merge 7 commits intocosmos:mainfrom
nowooj wants to merge 7 commits intocosmos:mainfrom
Conversation
|
PR author is not in the allowed authors list. |
Author
|
Rebase on main |
0c7c32b to
2e1567f
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Precompile failures no longer rely primarily on string reasons. Failures are now returned as Solidity custom errors encoded from each module’s
abi.json, viaNewRevertWithSolidityErrorandReturnRevertErrorinprecompiles/common, including interpreter return data where applicable.The ERC-20 precompile drops the split
IERC20/IERC20Metadatasetup in favor ofERC20I, combining OpenZeppelinIERC20Metadata, IERC6093IERC20Errors, and the sharedIPrecompileinterface. Other precompiles (bank, distribution, gov, ics02, ics20, slashing, staking, etc.) were updated for interfaces,errors.go, and regeneratedabi.json.Tooling: Solidity 0.8.26, Hardhat
evmVersion: cancun, and OpenZeppelin v5, with contracts recompiled and artifacts aligned to Hardhat 3 (hh3-artifact-1).Tests: Go integration tests and Solidity suites (
revert_cases, ERC20) assert custom error selectors / revert data where relevant.Review focus:
precompiles/common/revert.go, use ofNewRevertWithSolidityErrorin each module’serrors.go/tx.go/query.go, and consistency betweenERC20I.soland generatedabi.json.Breaking change: Call sites that assumed only
Error(string)reverts may need to decode standard custom errors instead.Closes: #954
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
mainbranch