Skip to content
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

imp(all): Bump to latest state on Evmos main (0402a01c) #69

Merged
merged 35 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e123488
4620e62d build(deps): bump github.com/cosmos/cosmos-db from 1.0.2 to …
MalteHerrmann Jan 24, 2025
a4abdbd
bump github.com/onsi/gomega from 1.35.1 to 1.36.0 (#3005)
MalteHerrmann Jan 24, 2025
d407bce
bf4e55e1 feat(precompile): Evidence precompile queries, tx and tests …
MalteHerrmann Jan 24, 2025
d648a51
d300b508 build(deps): bump google.golang.org/grpc from 1.68.0 to 1.68…
MalteHerrmann Jan 24, 2025
adb69b6
594d70f8 build(deps): bump golang.org/x/text from 0.20.0 to 0.21.0 (#…
MalteHerrmann Jan 24, 2025
7702921
06920d48 build(deps): bump golang.org/x/net from 0.31.0 to 0.32.0 (#3…
MalteHerrmann Jan 24, 2025
55f8ef6
a3faec1f chore: Move Evmos app init to initialization input (#3009)
MalteHerrmann Jan 24, 2025
d57149c
ec789b37 build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0 …
MalteHerrmann Jan 24, 2025
31be527
d13406bb build(deps): bump github.com/holiman/uint256 from 1.3.1 to 1…
MalteHerrmann Jan 24, 2025
cd9d58a
72f79777 build(deps): bump github.com/onsi/gomega from 1.36.0 to 1.36…
MalteHerrmann Jan 24, 2025
9baff5d
5332f68d build(deps): bump google.golang.org/grpc from 1.68.1 to 1.69…
MalteHerrmann Jan 24, 2025
7edca70
fb77d64a build(deps): bump cosmossdk.io/client/v2 from 2.0.0-beta.5 t…
MalteHerrmann Jan 24, 2025
953c948
9ee7cb20 feat(test): Add support for custom decimals to test suite. (…
MalteHerrmann Jan 24, 2025
dfe608c
38ee317f build(deps): bump cosmossdk.io/x/tx from 0.13.5 to 0.13.6 (#…
MalteHerrmann Jan 24, 2025
c028677
db3ebdf5 build(deps): bump google.golang.org/protobuf from 1.35.2 to …
MalteHerrmann Jan 24, 2025
a69c2d5
319151b8 build(deps): bump github.com/spf13/cast from 1.7.0 to 1.7.1 …
MalteHerrmann Jan 24, 2025
1095de6
6fb98191 build(deps): bump cosmossdk.io/x/tx from 0.13.6 to 0.13.7 (#…
MalteHerrmann Jan 24, 2025
f659414
b6ebb78e build(deps): bump github.com/cosmos/rosetta from 0.50.10 to …
MalteHerrmann Jan 24, 2025
6456e89
61d62899 build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 (#3…
MalteHerrmann Jan 24, 2025
fb31276
8e2dfe5d build(deps): bump google.golang.org/grpc from 1.69.0 to 1.69…
MalteHerrmann Jan 24, 2025
b608b5c
069ea8a3 build(deps): bump google.golang.org/protobuf from 1.36.0 to …
MalteHerrmann Jan 24, 2025
dfd38e7
abb39277 build(deps): bump github.com/onsi/gomega from 1.36.1 to 1.36…
MalteHerrmann Jan 24, 2025
76742bb
bf94d2df build(deps): bump github.com/cosmos/cosmos-db from 1.1.0 to …
MalteHerrmann Jan 24, 2025
4f974d2
245a2f45 build(deps): bump github.com/linxGnu/grocksdb from 1.9.7 to …
MalteHerrmann Jan 24, 2025
b43eab5
4dc76329 build(deps): bump bufbuild/buf-setup-action from 1.47.2 to 1…
MalteHerrmann Jan 24, 2025
968d54c
adbcf538 build(deps): bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2…
MalteHerrmann Jan 24, 2025
26d04ad
1a507391 test: add test case for eip712_legacy.go (#3041)
MalteHerrmann Jan 24, 2025
069d26b
9274fcad build(deps): bump bufbuild/buf-setup-action from 1.48.0 to 1…
MalteHerrmann Jan 24, 2025
f4c0c93
392b2279 build(deps): bump google.golang.org/protobuf from 1.36.1 to …
MalteHerrmann Jan 24, 2025
232e05c
116a676f build(deps): bump cosmossdk.io/math from 1.4.0 to 1.5.0 (#3050)
MalteHerrmann Jan 24, 2025
0107305
cb46d96d build(deps): bump golang.org/x/net from 0.33.0 to 0.34.0 (#3…
MalteHerrmann Jan 24, 2025
8e9b722
8f521208 feat(gov): Add Params query (#3002)
MalteHerrmann Jan 24, 2025
63cd37d
8a624d4f build(deps): bump bufbuild/buf-setup-action from 1.49.0 to 1…
MalteHerrmann Jan 24, 2025
9577393
0402a01c build(deps): bump golangci/golangci-lint-action from 6.1.1 t…
MalteHerrmann Jan 24, 2025
0cec992
add changelog entry
MalteHerrmann Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bsr-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.47.2
- uses: bufbuild/buf-setup-action@v1.50.0
# Push evmOS protos to the Buf Schema Registry
- uses: bufbuild/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
go.mod
go.sum
*.toml
- uses: golangci/golangci-lint-action@v6.1.1
- uses: golangci/golangci-lint-action@v6.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.47.2
- uses: bufbuild/buf-setup-action@v1.50.0
- uses: bufbuild/buf-lint-action@v1
with:
input: "proto"
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.47.2
- uses: bufbuild/buf-setup-action@v1.50.0
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
This changelog was created using the `clu` binary
(https://github.com/MalteHerrmann/changelog-utils).
-->

# Changelog

## Unreleased

### Improvements

- (all) [#69](https://github.com/evmos/os/pull/69) Bump to latest state on Evmos main (0402a01c).
- (erc20) [#57](https://github.com/evmos/os/pull/57) Reference EIP-7528 (native asset address) in default ERC-20 params.
- (all) [#60](https://github.com/evmos/os/pull/60) Apply latest changes from Evmos repo (f943af3b to b72a32d76).
- (cli) [#55](https://github.com/evmos/os/pull/55) Add missing list key types subcommand.
Expand Down
9 changes: 6 additions & 3 deletions ante/evm/06_account_verification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (suite *EvmAnteTestSuite) TestVerifyAccountBalance() {
keyring := testkeyring.New(2)
unitNetwork := network.NewUnitTestNetwork(
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
network.WithChainID(suite.chainID),
)
grpcHandler := grpc.NewIntegrationHandler(unitNetwork)
txFactory := factory.New(unitNetwork, grpcHandler)
Expand Down Expand Up @@ -53,10 +54,12 @@ func (suite *EvmAnteTestSuite) TestVerifyAccountBalance() {
suite.Require().NoError(err)

// Make tx cost greater than balance
balanceResp, err := grpcHandler.GetBalanceFromBank(senderKey.AccAddr, unitNetwork.GetBaseDenom())
balanceResp, err := grpcHandler.GetBalanceFromEVM(senderKey.AccAddr)
suite.Require().NoError(err)

invalidAmount := balanceResp.Balance.Amount.Add(math.NewInt(100))
balance, ok := math.NewIntFromString(balanceResp.Balance)
suite.Require().True(ok)
invalidAmount := balance.Add(math.NewInt(100))
txArgs.Amount = invalidAmount.BigInt()
return statedbAccount, txArgs
},
Expand Down Expand Up @@ -98,7 +101,7 @@ func (suite *EvmAnteTestSuite) TestVerifyAccountBalance() {
}

for _, tc := range testCases {
suite.Run(fmt.Sprintf("%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), tc.name), func() {
suite.Run(fmt.Sprintf("%v_%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), suite.chainID, tc.name), func() {
// Perform test logic
statedbAccount, txArgs := tc.generateAccountAndArgs()
txData, err := txArgs.ToTxData()
Expand Down
10 changes: 7 additions & 3 deletions ante/evm/07_can_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
func (suite *EvmAnteTestSuite) TestCanTransfer() {
keyring := testkeyring.New(1)
unitNetwork := network.NewUnitTestNetwork(
network.WithChainID(suite.chainID),
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
)
grpcHandler := grpc.NewIntegrationHandler(unitNetwork)
Expand All @@ -45,9 +46,12 @@ func (suite *EvmAnteTestSuite) TestCanTransfer() {
expectedError: errortypes.ErrInsufficientFunds,
isLondon: true,
malleate: func(txArgs *evmtypes.EvmTxArgs) {
balanceResp, err := grpcHandler.GetBalanceFromBank(senderKey.AccAddr, unitNetwork.GetBaseDenom())
balanceResp, err := grpcHandler.GetBalanceFromEVM(senderKey.AccAddr)
suite.Require().NoError(err)
invalidAmount := balanceResp.Balance.Amount.Add(math.NewInt(1)).BigInt()

balance, ok := math.NewIntFromString(balanceResp.Balance)
suite.Require().True(ok)
invalidAmount := balance.Add(math.NewInt(1)).BigInt()
txArgs.Amount = invalidAmount
},
},
Expand All @@ -61,7 +65,7 @@ func (suite *EvmAnteTestSuite) TestCanTransfer() {
}

for _, tc := range testCases {
suite.Run(fmt.Sprintf("%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), tc.name), func() {
suite.Run(fmt.Sprintf("%v_%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), suite.chainID, tc.name), func() {
baseFeeResp, err := grpcHandler.GetEvmBaseFee()
suite.Require().NoError(err)
ethCfg := unitNetwork.GetEVMChainConfig()
Expand Down
55 changes: 31 additions & 24 deletions ante/evm/08_gas_consume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package evm_test

import (
"fmt"

sdkmath "cosmossdk.io/math"
sdktypes "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -12,11 +14,13 @@ import (
"github.com/evmos/os/testutil/integration/os/grpc"
testkeyring "github.com/evmos/os/testutil/integration/os/keyring"
"github.com/evmos/os/testutil/integration/os/network"
evmtypes "github.com/evmos/os/x/evm/types"
)

func (suite *EvmAnteTestSuite) TestUpdateCumulativeGasWanted() {
keyring := testkeyring.New(1)
unitNetwork := network.NewUnitTestNetwork(
network.WithChainID(suite.chainID),
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
)

Expand Down Expand Up @@ -89,6 +93,7 @@ func (suite *EvmAnteTestSuite) TestUpdateCumulativeGasWanted() {
func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() {
keyring := testkeyring.New(1)
unitNetwork := network.NewUnitTestNetwork(
network.WithChainID(suite.chainID),
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
)
grpcHandler := grpc.NewIntegrationHandler(unitNetwork)
Expand All @@ -97,22 +102,20 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() {
testCases := []struct {
name string
expectedError string
fees sdktypes.Coins
feesAmt sdkmath.Int
getSender func() sdktypes.AccAddress
}{
{
name: "success: fees are zero and event emitted",
fees: sdktypes.Coins{},
name: "success: fees are zero and event emitted",
feesAmt: sdkmath.NewInt(0),
getSender: func() sdktypes.AccAddress {
// Return prefunded sender
return keyring.GetKey(0).AccAddr
},
},
{
name: "success: there are non zero fees, user has sufficient bank balances and event emitted",
fees: sdktypes.Coins{
sdktypes.NewCoin(unitNetwork.GetBaseDenom(), sdkmath.NewInt(1000)),
},
name: "success: there are non zero fees, user has sufficient bank balances and event emitted",
feesAmt: sdkmath.NewInt(1000),
getSender: func() sdktypes.AccAddress {
// Return prefunded sender
return keyring.GetKey(0).AccAddr
Expand All @@ -121,9 +124,7 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() {
{
name: "fail: insufficient user balance, event is NOT emitted",
expectedError: "failed to deduct transaction costs from user balance",
fees: sdktypes.Coins{
sdktypes.NewCoin(unitNetwork.GetBaseDenom(), sdkmath.NewInt(1000)),
},
feesAmt: sdkmath.NewInt(1000),
getSender: func() sdktypes.AccAddress {
// Set up account with too little balance (but not zero)
index := keyring.AddKey()
Expand All @@ -145,18 +146,23 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() {
}

for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.Run(fmt.Sprintf("%v_%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), suite.chainID, tc.name), func() {
sender := tc.getSender()
prevBalance, err := grpcHandler.GetAllBalances(
sender,
)

resp, err := grpcHandler.GetBalanceFromEVM(sender)
suite.Require().NoError(err)
prevBalance, ok := sdkmath.NewIntFromString(resp.Balance)
suite.Require().True(ok)

evmDecimals := evmtypes.GetEVMCoinDecimals()
feesAmt := tc.feesAmt.Mul(evmDecimals.ConversionFactor())
fees := sdktypes.NewCoins(sdktypes.NewCoin(unitNetwork.GetBaseDenom(), feesAmt))

// Function under test
err = evmante.ConsumeFeesAndEmitEvent(
unitNetwork.GetContext(),
unitNetwork.App.EVMKeeper,
tc.fees,
fees,
sender,
)

Expand All @@ -166,31 +172,32 @@ func (suite *EvmAnteTestSuite) TestConsumeGasAndEmitEvent() {

// Check events are not present
events := unitNetwork.GetContext().EventManager().Events()
suite.Require().Zero(len(events))
suite.Require().Zero(len(events), "required no events to be emitted")
} else {
suite.Require().NoError(err)

// Check fees are deducted
afterBalance, err := grpcHandler.GetAllBalances(
sender,
)
resp, err := grpcHandler.GetBalanceFromEVM(sender)
suite.Require().NoError(err)
expectedBalance := prevBalance.Balances.Sub(tc.fees...)
suite.Require().True(
expectedBalance.Equal(afterBalance.Balances),
)
afterBalance, ok := sdkmath.NewIntFromString(resp.Balance)
suite.Require().True(ok)

suite.Require().NoError(err)
expectedBalance := prevBalance.Sub(feesAmt)
suite.Require().True(expectedBalance.Equal(afterBalance), "expected different balance after fees deduction")

// Event to be emitted
expectedEvent := sdktypes.NewEvent(
sdktypes.EventTypeTx,
sdktypes.NewAttribute(sdktypes.AttributeKeyFee, tc.fees.String()),
sdktypes.NewAttribute(sdktypes.AttributeKeyFee, fees.String()),
)
// Check events are present
events := unitNetwork.GetContext().EventManager().Events()
suite.Require().NotZero(len(events))
suite.Require().Contains(
events,
expectedEvent,
"expected different events after fees deduction",
)
}

Expand Down
1 change: 1 addition & 0 deletions ante/evm/09_increment_sequence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
func (suite *EvmAnteTestSuite) TestIncrementSequence() {
keyring := testkeyring.New(1)
unitNetwork := network.NewUnitTestNetwork(
network.WithChainID(suite.chainID),
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
)
grpcHandler := grpc.NewIntegrationHandler(unitNetwork)
Expand Down
13 changes: 9 additions & 4 deletions ante/evm/10_gas_wanted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package evm_test

import (
"fmt"

storetypes "cosmossdk.io/store/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"

Expand All @@ -13,16 +15,18 @@ import (
testkeyring "github.com/evmos/os/testutil/integration/os/keyring"
"github.com/evmos/os/testutil/integration/os/network"
integrationutils "github.com/evmos/os/testutil/integration/os/utils"
evmtypes "github.com/evmos/os/x/evm/types"
)

func (suite *EvmAnteTestSuite) TestCheckGasWanted() {
keyring := testkeyring.New(1)
unitNetwork := network.NewUnitTestNetwork(
network.WithChainID(suite.chainID),
network.WithPreFundedAccounts(keyring.GetAllAccAddrs()...),
)
grpcHandler := grpc.NewIntegrationHandler(unitNetwork)
txFactory := factory.New(unitNetwork, grpcHandler)
commonGasLimit := uint64(100000)
commonGasLimit := uint64(100_000)

testCases := []struct {
name string
Expand Down Expand Up @@ -69,16 +73,17 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() {
// Set basefee param to false
feeMarketParams, err := grpcHandler.GetFeeMarketParams()
suite.Require().NoError(err)

feeMarketParams.Params.NoBaseFee = true
err = integrationutils.UpdateFeeMarketParams(integrationutils.UpdateParamsInput{
Tf: txFactory,
Network: unitNetwork,
Pk: keyring.GetPrivKey(0),
Params: feeMarketParams.Params,
})
suite.Require().NoError(err)
suite.Require().NoError(err, "expected no error when updating fee market params")

blockMeter := storetypes.NewGasMeter(commonGasLimit + 10000)
blockMeter := storetypes.NewGasMeter(commonGasLimit + 10_000)
return unitNetwork.GetContext().WithBlockGasMeter(blockMeter)
},
isLondon: true,
Expand All @@ -87,7 +92,7 @@ func (suite *EvmAnteTestSuite) TestCheckGasWanted() {
}

for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.Run(fmt.Sprintf("%v_%v_%v", evmtypes.GetTxTypeName(suite.ethTxType), suite.chainID, tc.name), func() {
sender := keyring.GetKey(0)
txArgs, err := txFactory.GenerateDefaultTxTypeArgs(
sender.Addr,
Expand Down
21 changes: 12 additions & 9 deletions ante/evm/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

gethtypes "github.com/ethereum/go-ethereum/core/types"
testconstants "github.com/evmos/os/testutil/constants"
"github.com/stretchr/testify/suite"
)

Expand All @@ -15,16 +16,18 @@ type EvmAnteTestSuite struct {

// To make sure that every tests is run with all the tx types
ethTxType int
chainID string
}

func TestEvmAnteTestSuite(t *testing.T) {
suite.Run(t, &EvmAnteTestSuite{
ethTxType: gethtypes.DynamicFeeTxType,
})
suite.Run(t, &EvmAnteTestSuite{
ethTxType: gethtypes.LegacyTxType,
})
suite.Run(t, &EvmAnteTestSuite{
ethTxType: gethtypes.AccessListTxType,
})
txTypes := []int{gethtypes.DynamicFeeTxType, gethtypes.LegacyTxType, gethtypes.AccessListTxType}
chainIDs := []string{testconstants.ExampleChainID, testconstants.SixDecimalsChainID}
for _, txType := range txTypes {
for _, chainID := range chainIDs {
suite.Run(t, &EvmAnteTestSuite{
ethTxType: txType,
chainID: chainID,
})
}
}
}
Loading
Loading