Skip to content

Conversation

@philipsu522
Copy link
Contributor

Describe your changes and provide context

Testing performed to validate your change

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedDec 3, 2025, 5:59 PM

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.25%. Comparing base (0156e75) to head (d88a375).

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
sei-chain 42.37% <ø> (-0.03%) ⬇️
sei-cosmos 40.15% <ø> (?)
sei-db 44.92% <ø> (+0.03%) ⬆️
sei-ibc-go 56.39% <ø> (ø)
sei-tendermint 47.58% <ø> (+0.04%) ⬆️
sei-wasmd 42.61% <ø> (+0.01%) ⬆️
sei-wasmvm 39.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 636 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

stevenlanders and others added 6 commits December 3, 2025 12:58
## 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants