Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into bump_v1.12.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 24, 2024
2 parents 324f559 + 7e30762 commit f062265
Show file tree
Hide file tree
Showing 191 changed files with 8,222 additions and 13,246 deletions.
5 changes: 5 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# default: go, gomod2nix
# rocksdb: go, gomod2nix, librocksdb
# full: go, gomod2nix, librocksdb, python env
use flake .#full
TMPDIR=/tmp
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cleanup-runs:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
schedule:
- cron: '37 21 * * 4'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cleanup-runs:
runs-on: ubuntu-latest
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
push:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
golangci:
name: Run golangci-lint
Expand Down Expand Up @@ -57,7 +62,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: crypto-ethermint
Expand All @@ -73,7 +82,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: crypto-ethermint
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/markdown-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
paths:
- '**.md'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
markdown-link-check:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
paths:
- "proto/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Gosec:
permissions:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
- .github/workflows/semgrep.yml
schedule:
- cron: '0 0 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Update from: https://semgrep.dev/docs/semgrep-ci/sample-ci-configs/#github-actions
semgrep:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- develop
- release/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cleanup-runs:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -34,7 +38,7 @@ jobs:
run: |
make test-unit-cover
if: env.GIT_DIFF
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
fail_ci_if_error: true
Expand Down Expand Up @@ -93,9 +97,9 @@ jobs:
TESTS_TO_RUN: ${{ matrix.tests }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-22.11
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
Expand Down Expand Up @@ -132,7 +136,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/install-nix-action@v26
with:
nix_path: nixpkgs=channel:nixos-23.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v14
with:
name: crypto-ethermint
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ dependency-graph.png

# OpenZeppelin contracts
contracts/@openzeppelin/*

# direnv
/.envrc
/.direnv
48 changes: 47 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,59 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

### Features

* (evm) [#414](https://github.com/crypto-org-chain/ethermint/pull/414) Integrate go-block-stm for parallel tx execution.
* (block-stm) [#498](https://github.com/crypto-org-chain/ethermint/pull/498) Enable incarnation cache for block-stm executor.

### State Machine Breaking

* (rpc) [#443](https://github.com/crypto-org-chain/ethermint/pull/443) Keep behavior of random opcode as before.
* (app) [#451](https://github.com/crypto-org-chain/ethermint/pull/451) Disable block gas meter, it's not compatible with parallel tx execution. It's safe to do as long as we checks total gas-wanted against block gas limit in process proposal, which we do in default handler.
* (ante) [#493](https://github.com/crypto-org-chain/ethermint/pull/493) Align gasWanted for process proposal mode, [#500](https://github.com/crypto-org-chain/ethermint/pull/500) Check for overflow before adding gasLimit to gasWanted.
* (ante) [#506](https://github.com/crypto-org-chain/ethermint/pull/506) Disable MsgCreatePermanentLockedAccount and MsgCreatePeriodicVestingAccount messages.
* (ante) [#513](https://github.com/crypto-org-chain/ethermint/pull/513) Avoid unnecessary GetAccount and MakeSigner in ante handlers.

### Bug Fixes

- (ante) [#422](https://github.com/crypto-org-chain/ethermint/pull/422) vendor `NewDeductFeeDecorator` to re-use the custom `checkTxFeeWithValidatorMinGasPrices` method, so it'll repsect the `DefaultPriorityReduction` config.
- (feemarket) [#433](https://github.com/crypto-org-chain/ethermint/pull/433) Fix sdk int conversion panic with baseFee.
* (rpc) [#434](https://github.com/crypto-org-chain/ethermint/pull/434) No need gasPrice when patch gasUsed for `eth_getTransactionReceipt`.
* (rpc) [#439](https://github.com/crypto-org-chain/ethermint/pull/439), [#441](https://github.com/crypto-org-chain/ethermint/pull/441) Align trace response for failed tx with go-ethereum.
* (evm) [#463](https://github.com/crypto-org-chain/ethermint/pull/463) Avoid broken bank total supply when creates a validator.
* (cli) [#464](https://github.com/crypto-org-chain/ethermint/pull/464) Update client/v2 to include bug fixes.
* (evm) [#466](https://github.com/crypto-org-chain/ethermint/pull/466) Fix evm response patching.
* (rpc) [#473](https://github.com/crypto-org-chain/ethermint/pull/473) Avoid panic on invalid elasticity_multiplier.
* (rpc) [#474](https://github.com/crypto-org-chain/ethermint/pull/474), [#476](https://github.com/crypto-org-chain/ethermint/pull/441) Align genesis related cmd.
* (rpc) [#480](https://github.com/crypto-org-chain/ethermint/pull/480), [#482](https://github.com/crypto-org-chain/ethermint/pull/482) Fix parsed logs from old events.
* (rpc) [#488](https://github.com/crypto-org-chain/ethermint/pull/488) Fix handling of pending transactions related APIs.
* (rpc) [#501](https://github.com/crypto-org-chain/ethermint/pull/501) Avoid invalid chain id for signer error when rpc call before chain id set in BeginBlock.
* (block-stm) [#510](https://github.com/crypto-org-chain/ethermint/pull/510) Include a fix to avoid nondeterministic account set when stm workers execute in parallel.
* (rpc) [#521](https://github.com/crypto-org-chain/ethermint/pull/521) Align hash and miner in subscribe newHeads with eth_getBlockByNumber.
* (rpc) [#516](https://github.com/crypto-org-chain/ethermint/pull/516) Avoid method eth_chainId crashed due to nil pointer on IsEIP155 check.
* (cli) [#524](https://github.com/crypto-org-chain/ethermint/pull/524) Allow tx evm raw run for generate only when offline with evm-denom flag.

### Features
### Improvements

* (statedb) [#446](https://github.com/crypto-org-chain/ethermint/pull/446) Re-use the cache store implementation with sdk.
* (evm) [#447](https://github.com/crypto-org-chain/ethermint/pull/447) Deduct fee through virtual bank transfer.
* (evm) [#448](https://github.com/crypto-org-chain/ethermint/pull/448) Refactor the evm transfer to be more efficient.
* (evm) [#450](https://github.com/crypto-org-chain/ethermint/pull/450) Refactor transient stores to be compatible with parallel tx execution.
* (evm) [#454](https://github.com/crypto-org-chain/ethermint/pull/454) Migrate transient stores to object stores.
* (evm) [#461](https://github.com/crypto-org-chain/ethermint/pull/461) Remove custom signer getter, use the option in protobuf file instead.
* (evm) [#469](https://github.com/crypto-org-chain/ethermint/pull/469) More aggressive cache of common parameters in object store.
* (evm) [#470](https://github.com/crypto-org-chain/ethermint/pull/470) State machine always use `ethtypes.MakeSigner` based on current chain config and block number, this is
more accurate.
* (app) [#483](https://github.com/crypto-org-chain/ethermint/pull/483) Make keyring-backend client config accessible in app.
* (deps) [#489](https://github.com/crypto-org-chain/ethermint/pull/489) Update cosmos-sdk to `v0.50.7`.
* (rpc) [#491](https://github.com/crypto-org-chain/ethermint/pull/491) Avoid unnecessary tx decode in tx listener.
* [#496](https://github.com/crypto-org-chain/ethermint/pull/496) Set mempool MaxTx from config.
* (ante) [#497](https://github.com/crypto-org-chain/ethermint/pull/497) Enforce positive value check in eth transaction.
* (deps) [#505](https://github.com/crypto-org-chain/ethermint/pull/505) Update cometbft to v0.38.10.
* (ante) [#504](https://github.com/crypto-org-chain/ethermint/pull/504) Optimize AnteHandle method to skip checks if disabledMsgs is empty.
* [#517](https://github.com/crypto-org-chain/ethermint/pull/517) Add check for integer overflow to ensure safe conversion.
* [#522](https://github.com/crypto-org-chain/ethermint/pull/522) block-stm executor support optional pre-estimations.
* [#526](https://github.com/crypto-org-chain/ethermint/pull/526) Avoid unnecessary block result in header related api call.

## v0.21.x-cronos

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ endif

ifeq (, $(shell which go-bindata))
@echo "Installing go-bindata..."
@go get github.com/kevinburke/go-bindata/go-bindata
@go get github.com/kevinburke/go-bindata
else
@echo "go-bindata already installed; skipping..."
endif
Expand Down
15 changes: 8 additions & 7 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

"github.com/ethereum/go-ethereum/core/types"
ethparams "github.com/ethereum/go-ethereum/params"
"github.com/evmos/ethermint/app"
"github.com/evmos/ethermint/app/ante"
"github.com/evmos/ethermint/crypto/ethsecp256k1"
"github.com/evmos/ethermint/tests"
"github.com/evmos/ethermint/testutil"
evmtypes "github.com/evmos/ethermint/x/evm/types"

amino "github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -315,10 +315,10 @@ func (suite *AnteTestSuite) TestAnteHandler() {

txBuilder := suite.CreateTestTxBuilder(signedTx, privKey, 1, false)

txData, err := evmtypes.UnpackTxData(signedTx.Data)
suite.Require().NoError(err)
txData := signedTx.AsTransaction()
suite.Require().NotNil(txData)

expFee := txData.Fee()
expFee := signedTx.GetFee()
invalidFee := new(big.Int).Add(expFee, big.NewInt(1))
invalidFeeAmount := sdk.Coins{sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewIntFromBigInt(invalidFee))}
txBuilder.SetFeeAmount(invalidFeeAmount)
Expand Down Expand Up @@ -937,7 +937,8 @@ func (suite *AnteTestSuite) TestAnteHandler() {
suite.Run(tc.name, func() {
setup()

suite.ctx = suite.ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx).WithConsensusParams(*app.DefaultConsensusParams)
suite.ctx = suite.ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx).WithConsensusParams(*testutil.DefaultConsensusParams)
suite.app.EvmKeeper.RemoveParamsCache(suite.ctx)

// expConsumed := params.TxGasContractCreation + params.TxGas
_, err := suite.anteHandler(suite.ctx, tc.txFn(), false)
Expand Down Expand Up @@ -1207,7 +1208,7 @@ func (suite *AnteTestSuite) TestAnteHandlerWithDynamicTxFee() {
suite.Require().NoError(acc.SetSequence(1))
suite.app.AccountKeeper.SetAccount(suite.ctx, acc)

suite.ctx = suite.ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx).WithConsensusParams(*app.DefaultConsensusParams)
suite.ctx = suite.ctx.WithIsCheckTx(tc.checkTx).WithIsReCheckTx(tc.reCheckTx).WithConsensusParams(*testutil.DefaultConsensusParams)
suite.app.EvmKeeper.SetBalance(suite.ctx, addr, big.NewInt((ethparams.InitialBaseFee+10)*100000), evmtypes.DefaultEVMDenom)
_, err := suite.anteHandler(suite.ctx, tc.txFn(), false)
if tc.expPass {
Expand Down Expand Up @@ -1336,7 +1337,7 @@ func (suite *AnteTestSuite) TestAnteHandlerWithParams() {
suite.Require().NoError(acc.SetSequence(1))
suite.app.AccountKeeper.SetAccount(suite.ctx, acc)

suite.ctx = suite.ctx.WithIsCheckTx(true).WithConsensusParams(*app.DefaultConsensusParams)
suite.ctx = suite.ctx.WithIsCheckTx(true).WithConsensusParams(*testutil.DefaultConsensusParams)
suite.app.EvmKeeper.SetBalance(suite.ctx, addr, big.NewInt((ethparams.InitialBaseFee+10)*100000), evmtypes.DefaultEVMDenom)
_, err := suite.anteHandler(suite.ctx, tc.txFn(), false)
if tc.expErr == nil {
Expand Down
6 changes: 5 additions & 1 deletion app/ante/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ func NewAuthzLimiterDecorator(disabledMsgTypes []string) AuthzLimiterDecorator {
}

func (ald AuthzLimiterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
if len(ald.disabledMsgs) == 0 {
return next(ctx, tx, simulate)
}

if err := ald.checkDisabledMsgs(tx.GetMsgs(), false, 0); err != nil {
return ctx, errorsmod.Wrapf(errortypes.ErrUnauthorized, err.Error())
return ctx, errorsmod.Wrap(errortypes.ErrUnauthorized, err.Error())
}
return next(ctx, tx, simulate)
}
Expand Down
20 changes: 20 additions & 0 deletions app/ante/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,26 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
},
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
},
{
name: "a MsgGrant with MsgCreatePermanentLockedAccount typeURL on the authorization field is blocked",
msgs: []sdk.Msg{
newGenericMsgGrant(
testAddresses,
sdk.MsgTypeURL(&sdkvesting.MsgCreatePermanentLockedAccount{}),
),
},
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
},
{
name: "a MsgGrant with MsgCreatePeriodicVestingAccount typeURL on the authorization field is blocked",
msgs: []sdk.Msg{
newGenericMsgGrant(
testAddresses,
sdk.MsgTypeURL(&sdkvesting.MsgCreatePeriodicVestingAccount{}),
),
},
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
},
{
name: "a MsgGrant with MsgEthereumTx typeURL on the authorization field included on EIP712 tx is blocked",
msgs: []sdk.Msg{
Expand Down
1 change: 0 additions & 1 deletion app/ante/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func NewLegacyCosmosAnteHandlerEip712(ctx sdk.Context, options HandlerOptions, e
NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
authante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
NewGasWantedDecorator(options.FeeMarketKeeper, ethCfg, &feemarketParams),
}
decorators = append(decorators, extra...)
return sdk.ChainAnteDecorators(decorators...)
Expand Down
Loading

0 comments on commit f062265

Please sign in to comment.