-
Notifications
You must be signed in to change notification settings - Fork 856
v6.3 Release #2575
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
Open
philipsu522
wants to merge
7
commits into
main
Choose a base branch
from
release/v6.3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
v6.3 Release #2575
Conversation
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
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2575 +/- ##
==========================================
- Coverage 46.17% 44.25% -1.93%
==========================================
Files 1171 1793 +622
Lines 101445 149468 +48023
==========================================
+ Hits 46841 66144 +19303
- Misses 50510 77444 +26934
- Partials 4094 5880 +1786
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
## Describe your changes and provide context - run `/scripts/benchmark.sh`, and it'll auto-produce 1000-tx blocks of evm transfers and measure tps ## Testing performed to validate your change - local testing - unit tests --------- Co-authored-by: Jeremy Wei <[email protected]>
- implement CreateContract() to mark account as created for EIP-6780 - previously, prefunded addresses bypassed EIP-6780 because CreateAccount() was not called when Exist() returned true - createContract() is called unconditionally during contract creation, ensuring proper AccountCreated flag is set" ## Describe your changes and provide context ## Testing performed to validate your change
* Also removed some unused code from BitArray * Also fixed bugs introduced in #2558
## Describe your changes and provide context ### Context Different precompile error messages lead to app hash. Reproduction suite: https://github.com/sei-protocol/sei-chain/pull/2545/files ### Mechanism `resultsHash` which is part of consensus is derived by hashing marshalled transaction results, only deterministic fields should be included during the marshalling [operation](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/abci/types/types.go#L199-L214) - [error code](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L429), [data](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L430), [gas_wanted](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L433), [gas_used](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L434). Initially I thought that the error code is being [decoded indeterministically](https://github.com/sei-protocol/sei-chain/blob/06a4e242bf80fff303be607734e121bd2f0f6916/sei-cosmos/types/errors/abci.go#L39) which turned out [untrue](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-cosmos/baseapp/abci.go#L283-L289). It turned out that the data field is indeterministic. Return data gets [populated with a stringified error ](https://github.com/sei-protocol/sei-chain/blob/07441d7bfcd7f9fc69119cf3002be7d6912b3a87/precompiles/common/precompiles.go#L159-L166)if the precompile errors out, this bubbles up as aforementioned [data](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L430), stringified error can among other things contain the path to executable by way of including the call stack. PR that introduced the issue - #1757. ### Potential Solutions One of the reasons ABCI decodes errors and excludes [log](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L293), [info](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L294), [events](https://github.com/sei-protocol/sei-chain/blob/fe95a1ff76a108ff37347a16ee6139509322e058/sei-tendermint/proto/tendermint/abci/types.proto#L297) fields from consensus is to guard from indeterminism. Ethereum on the other side discerns between two types of errors during transaction execution - vmerrors and consensus/client errors - vmerrors are not part of consensus in any way and errors coming from precompile runs fall into this category. Broadly there are a couple of ways to solve this: 1. Remove all inderterminism from errors - do not wrap errors, etc. - short term this will work for the specific scenario we encountered, long term we will have exactly the same issue because we will forget that changing an error message is an app hash break 2. Populate return data deterministically if a precompile errors out - this approach would be similar to what ABCI does by reducing errors to codes/codespaces by decoding them 3. Do not populate return data if a precompile errors out - precompiles that error out should never have side effects (to be confirmed) which makes this approach viable and it is the most right/Ethereum equivalent way of doing things ### Solution [1.] is a hotfix - which we already have - but not a long running solution as every precompile error message diff would lead to app hash break. [2.] does work but we've got no additional benefits from reducing precompile errors to error codes/spaces. Therefore picked [3.] What we lose by this solution is visibility into the specific error that happened - we can retain that by concatenate the error string to the execution reverted error. Comment on security concerns (proof by negation): This won't affect security - the only way in which including a precompile error message into consensus can boost security is by making sure the precompile run of every actor ended at exactly the same point - this can easily be bypassed (both with or without this PR) by a malicious actor executing the actual precompile and additional code besides that so guardrails should be elsewhere. ## Testing performed to validate your change Ran a local chain against the testing suite, also CI/CD.
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.
Describe your changes and provide context
Testing performed to validate your change