-
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
base: main
Are you sure you want to change the base?
v6.3 Release #2575
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (15.38%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2575 +/- ##
==========================================
- Coverage 46.17% 43.39% -2.79%
==========================================
Files 1171 1799 +628
Lines 101445 147630 +46185
==========================================
+ Hits 46841 64059 +17218
- Misses 50510 77937 +27427
- Partials 4094 5634 +1540
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 <jeremy.t.wei@gmail.com>
- 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.
## Describe your changes and provide context Cosmos simulation logics were removed in an earlier commit https://github.com/sei-protocol/sei-chain/pull/2507/files#diff-0f1d2976054440336a576d47a44a37b80cdf6701dd9113012bce0e3c425819b7 However these logics are still needed by Cosmos-based wallets, so we cannot remove them just yet. ## Testing performed to validate your change add back old logics
| sigs := make([]signing.SignatureV2, len(priv)) | ||
|
|
||
| // create a random length memo | ||
| r := rand.New(rand.NewSource(time.Now().UnixNano())) |
Check warning
Code scanning / CodeQL
Calling the system time Warning
| func RandomizedGenState(simState *module.SimulationState) { | ||
| mintDenom := sdk.DefaultBondDenom | ||
| randomProvision := uint64(rand.Int63n(1000000)) //nolint:gosec | ||
| currentDate := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
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.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Describe your changes and provide context
Testing performed to validate your change