Skip to content

Commit acbf6d7

Browse files
committed
Merge branch 'main' into releases/v2.0.0
2 parents 479cb05 + 1ae53e4 commit acbf6d7

File tree

83 files changed

+2408
-1037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2408
-1037
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ jobs:
5353
run: make test-coverage-integration
5454

5555
- name: "Upload coverage reports to Codecov"
56-
uses: codecov/codecov-action@v4
56+
uses: codecov/codecov-action@v5
5757
env:
5858
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/proto-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# timeout-minutes: 5
2323
# steps:
2424
# - uses: actions/checkout@v4
25-
# - uses: bufbuild/buf-setup-action@v1.46.0
25+
# - uses: bufbuild/buf-setup-action@v1.47.2
2626
# - uses: bufbuild/buf-lint-action@v1
2727
# with:
2828
# input: "proto"
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
steps:
3333
- uses: actions/checkout@v4
34-
- uses: bufbuild/buf-setup-action@v1.46.0
34+
- uses: bufbuild/buf-setup-action@v1.47.2
3535
with:
3636
github_token: ${{ github.token }}
3737
- uses: bufbuild/buf-breaking-action@v1

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/jod

CHANGELOG.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4242

4343
### Nibiru EVM
4444

45-
#### Nibiru EVM | Before Audit 2 [Nov, 2024]
45+
- [#2119](https://github.com/NibiruChain/nibiru/pull/2119) - fix(evm): Guarantee
46+
that gas consumed during any send operation of the "NibiruBankKeeper" depends
47+
only on the "bankkeeper.BaseKeeper"'s gas consumption.
48+
- [#2120](https://github.com/NibiruChain/nibiru/pull/2120) - fix: Use canonical hexadecimal strings for Eip155 address encoding
49+
- [#2122](https://github.com/NibiruChain/nibiru/pull/2122) - test(evm): more bank extension tests and EVM ABCI integration tests to prevent regressions
50+
- [#2124](https://github.com/NibiruChain/nibiru/pull/2124) - refactor(evm):
51+
Remove unnecessary argument in the `VerifyFee` function, which returns the token
52+
payment required based on the effective fee from the tx data. Improve
53+
documentation.
54+
- [#2125](https://github.com/NibiruChain/nibiru/pull/2125) - feat(evm-precompile):Emit EVM events created to reflect the ABCI events that occur outside the EVM to make sure that block explorers and indexers can find indexed ABCI event information.
55+
- [#2129](https://github.com/NibiruChain/nibiru/pull/2129) - fix(evm): issue with infinite recursion in erc20 funtoken contracts
56+
- [#2134](https://github.com/NibiruChain/nibiru/pull/2134) - fix(evm): query of NIBI should use bank state, not the StateDB
57+
58+
#### Nibiru EVM | Before Audit 2 - 2024-12-06
4659

4760
The codebase went through a third-party [Code4rena
4861
Zenith](https://code4rena.com/zenith) Audit, running from 2024-10-07 until
4962
2024-11-01 and including both a primary review period and mitigation/remission
50-
period. This section describes code changes that occured after that audit in
63+
period. This section describes code changes that occurred after that audit in
5164
preparation for a second audit starting in November 2024.
5265

5366
- [#2074](https://github.com/NibiruChain/nibiru/pull/2074) - fix(evm-keeper): better utilize ERC20 metadata during FunToken creation. The bank metadata for a new FunToken mapping ties a connection between the Bank Coin's `DenomUnit` and the ERC20 contract metadata like the name, decimals, and symbol. This change brings parity between EVM wallets, such as MetaMask, and Interchain wallets like Keplr and Leap.
5467
- [#2076](https://github.com/NibiruChain/nibiru/pull/2076) - fix(evm-gas-fees):
5568
Use effective gas price in RefundGas and make sure that units are properly
56-
reflected on all occurences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059)
69+
reflected on all occurrences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059)
5770
and the [related comments from @Unique-Divine and @berndartmueller](https://github.com/NibiruChain/nibiru/issues/2059#issuecomment-2408625724).
58-
- [#2084](https://github.com/NibiruChain/nibiru/pull/2084) - feat(evm-forge): foundry support and template for Nibiru EVM develoment
71+
- [#2084](https://github.com/NibiruChain/nibiru/pull/2084) - feat(evm-forge): foundry support and template for Nibiru EVM development
5972
- [#2086](https://github.com/NibiruChain/nibiru/pull/2086) - fix(evm-precomples):
6073
Fix state consistency in precompile execution by ensuring proper journaling of
6174
state changes in the StateDB. This pull request makes sure that state is
@@ -106,12 +119,18 @@ about the expected resulting balance for the transfer recipient.
106119
- [#2101](https://github.com/NibiruChain/nibiru/pull/2101) - fix(evm): tx receipt proper marshalling
107120
- [#2105](https://github.com/NibiruChain/nibiru/pull/2105) - test(evm): precompile call with revert
108121
- [#2106](https://github.com/NibiruChain/nibiru/pull/2106) - chore: scheduled basic e2e tests for evm testnet endpoint
109-
- [#2107](https://github.com/NibiruChain/nibiru/pull/2107) -
110-
feat(evm-funtoken-precompile): Implement methods: balance, bankBalance, whoAmI
122+
- [#2107](https://github.com/NibiruChain/nibiru/pull/2107) - feat(evm-funtoken-precompile): Implement methods: balance, bankBalance, whoAmI
111123
- [#2108](https://github.com/NibiruChain/nibiru/pull/2108) - fix(evm): removed deprecated root key from eth_getTransactionReceipt
112124
- [#2110](https://github.com/NibiruChain/nibiru/pull/2110) - fix(evm): Restore StateDB to its state prior to ApplyEvmMsg call to ensure deterministic gas usage. This fixes an issue where the StateDB pointer field in NibiruBankKeeper was being updated during readonly query endpoints like eth_estimateGas, leading to non-deterministic gas usage in subsequent transactions.
113125
- [#2111](https://github.com/NibiruChain/nibiru/pull/2111) - fix: e2e-evm-cron.yml
114126
- [#2114](https://github.com/NibiruChain/nibiru/pull/2114) - fix(evm): make gas cost zero in conditional bank keeper flow
127+
- [#2116](https://github.com/NibiruChain/nibiru/pull/2116) - fix(precompile-funtoken.go): Fixes a bug where the err != nil check is missing in the bankBalance precompile method
128+
- [#2117](https://github.com/NibiruChain/nibiru/pull/2117) - fix(oracle): The
129+
timestamps resulting from ctx.WithBlock* don't actually correspond to the block
130+
header information from specified blocks in the chain's history, so the oracle
131+
exchange rates need a way to correctly retrieve this information. This change
132+
fixes that discrepancy, giving the expected block timestamp for the EVM's oracle
133+
precompiled contract. The change also simplifies and corrects the code in x/oracle.
115134

116135
#### Nibiru EVM | Before Audit 1 - 2024-10-18
117136

@@ -237,11 +256,11 @@ feat(evm-funtoken-precompile): Implement methods: balance, bankBalance, whoAmI
237256
- Bump `github.com/grpc-ecosystem/grpc-gateway/v2` from 2.18.1 to 2.19.1 ([#1767](https://github.com/NibiruChain/nibiru/pull/1767), [#1782](https://github.com/NibiruChain/nibiru/pull/1782))
238257
- Bump `robinraju/release-downloader` from 1.8 to 1.11 ([#1783](https://github.com/NibiruChain/nibiru/pull/1783), [#1839](https://github.com/NibiruChain/nibiru/pull/1839), [#1948](https://github.com/NibiruChain/nibiru/pull/1948))
239258
- Bump `github.com/prometheus/client_golang` from 1.17.0 to 1.18.0 ([#1750](https://github.com/NibiruChain/nibiru/pull/1750))
240-
- Bump `golang.org/x/crypto` from 0.15.0 to 0.17.0 ([#1724](https://github.com/NibiruChain/nibiru/pull/1724), [#1843](https://github.com/NibiruChain/nibiru/pull/1843))
259+
- Bump `golang.org/x/crypto` from 0.15.0 to 0.31.0 ([#1724](https://github.com/NibiruChain/nibiru/pull/1724), [#1843](https://github.com/NibiruChain/nibiru/pull/1843), [#2123](https://github.com/NibiruChain/nibiru/pull/2123))
241260
- Bump `github.com/holiman/uint256` from 1.2.3 to 1.2.4 ([#1730](https://github.com/NibiruChain/nibiru/pull/1730))
242261
- Bump `github.com/dvsekhvalnov/jose2go` from 1.5.0 to 1.6.0 ([#1733](https://github.com/NibiruChain/nibiru/pull/1733))
243262
- Bump `github.com/spf13/cast` from 1.5.1 to 1.6.0 ([#1689](https://github.com/NibiruChain/nibiru/pull/1689))
244-
- Bump `cosmossdk.io/math` from 1.1.2 to 1.2.0 ([#1676](https://github.com/NibiruChain/nibiru/pull/1676))
263+
- Bump `cosmossdk.io/math` from 1.1.2 to 1.4.0 ([#1676](https://github.com/NibiruChain/nibiru/pull/1676), [#2115](https://github.com/NibiruChain/nibiru/pull/2115))
245264
- Bump `github.com/grpc-ecosystem/grpc-gateway/v2` from 2.18.0 to 2.18.1 ([#1675](https://github.com/NibiruChain/nibiru/pull/1675))
246265
- Bump `actions/setup-go` from 4 to 5 ([#1696](https://github.com/NibiruChain/nibiru/pull/1696))
247266
- Bump `golang` from 1.19 to 1.21 ([#1698](https://github.com/NibiruChain/nibiru/pull/1698))
@@ -253,10 +272,11 @@ feat(evm-funtoken-precompile): Implement methods: balance, bankBalance, whoAmI
253272
- Bump `github.com/hashicorp/go-getter` from 1.7.1 to 1.7.5 ([#1858](https://github.com/NibiruChain/nibiru/pull/1858), [#1938](https://github.com/NibiruChain/nibiru/pull/1938))
254273
- Bump `github.com/btcsuite/btcd` from 0.23.3 to 0.24.2 ([#1862](https://github.com/NibiruChain/nibiru/pull/1862), [#2070](https://github.com/NibiruChain/nibiru/pull/2070))
255274
- Bump `pozetroninc/github-action-get-latest-release` from 0.7.0 to 0.8.0 ([#1863](https://github.com/NibiruChain/nibiru/pull/1863))
256-
- Bump `bufbuild/buf-setup-action` from 1.30.1 to 1.46.0 ([#1891](https://github.com/NibiruChain/nibiru/pull/1891), [#1900](https://github.com/NibiruChain/nibiru/pull/1900), [#1923](https://github.com/NibiruChain/nibiru/pull/1923), [#1972](https://github.com/NibiruChain/nibiru/pull/1972), [#1974](https://github.com/NibiruChain/nibiru/pull/1974), [#1988](https://github.com/NibiruChain/nibiru/pull/1988), [#2043](https://github.com/NibiruChain/nibiru/pull/2043), [#2057](https://github.com/NibiruChain/nibiru/pull/2057), [#2062](https://github.com/NibiruChain/nibiru/pull/2062), [#2069](https://github.com/NibiruChain/nibiru/pull/2069), [#2102](https://github.com/NibiruChain/nibiru/pull/2102))
275+
- Bump `bufbuild/buf-setup-action` from 1.30.1 to 1.47.2 ([#1891](https://github.com/NibiruChain/nibiru/pull/1891), [#1900](https://github.com/NibiruChain/nibiru/pull/1900), [#1923](https://github.com/NibiruChain/nibiru/pull/1923), [#1972](https://github.com/NibiruChain/nibiru/pull/1972), [#1974](https://github.com/NibiruChain/nibiru/pull/1974), [#1988](https://github.com/NibiruChain/nibiru/pull/1988), [#2043](https://github.com/NibiruChain/nibiru/pull/2043), [#2057](https://github.com/NibiruChain/nibiru/pull/2057), [#2062](https://github.com/NibiruChain/nibiru/pull/2062), [#2069](https://github.com/NibiruChain/nibiru/pull/2069), [#2102](https://github.com/NibiruChain/nibiru/pull/2102), [#2113](https://github.com/NibiruChain/nibiru/pull/2113))
257276
- Bump `axios` from 1.7.3 to 1.7.4 ([#2016](https://github.com/NibiruChain/nibiru/pull/2016))
258277
- Bump `github.com/CosmWasm/wasmvm` from 1.5.0 to 1.5.5 ([#2047](https://github.com/NibiruChain/nibiru/pull/2047))
259278
- Bump `docker/build-push-action` from 5 to 6 ([#1924](https://github.com/NibiruChain/nibiru/pull/1924))
279+
- Bump `codecov/codecov-action` from 4 to 5 ([#2112](https://github.com/NibiruChain/nibiru/pull/2112))
260280

261281
## [v1.5.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.5.0) - 2024-06-21
262282

app/ante/commission_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package ante_test
22

33
import (
4-
"testing"
5-
64
"cosmossdk.io/math"
75
sdkclienttx "github.com/cosmos/cosmos-sdk/client/tx"
86
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -109,7 +107,7 @@ func (s *AnteTestSuite) TestAnteDecoratorStakingCommission() {
109107
wantErr: ante.ErrMaxValidatorCommission.Error(),
110108
},
111109
} {
112-
s.T().Run(tc.name, func(t *testing.T) {
110+
s.Run(tc.name, func() {
113111
txGasCoins := sdk.NewCoins(
114112
sdk.NewCoin("unibi", math.NewInt(1_000)),
115113
sdk.NewCoin("utoken", math.NewInt(500)),

app/ante/fixed_gas_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/cosmos/cosmos-sdk/testutil/testdata"
1212
sdk "github.com/cosmos/cosmos-sdk/types"
1313
"github.com/cosmos/cosmos-sdk/x/auth/signing"
14-
"github.com/cosmos/cosmos-sdk/x/bank/types"
14+
bank "github.com/cosmos/cosmos-sdk/x/bank/types"
1515

1616
"github.com/NibiruChain/nibiru/v2/app/ante"
1717
"github.com/NibiruChain/nibiru/v2/app/appconst"
@@ -62,7 +62,7 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
6262
Feeder: addr.String(),
6363
Validator: addr.String(),
6464
},
65-
&types.MsgSend{
65+
&bank.MsgSend{
6666
FromAddress: addr.String(),
6767
ToAddress: addr.String(),
6868
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
@@ -74,7 +74,7 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
7474
{
7575
name: "Two messages in a transaction, one of them is an oracle vote message should fail (with MsgAggregateExchangeRatePrevote) permutation 2",
7676
messages: []sdk.Msg{
77-
&types.MsgSend{
77+
&bank.MsgSend{
7878
FromAddress: addr.String(),
7979
ToAddress: addr.String(),
8080
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
@@ -97,7 +97,7 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
9797
Feeder: addr.String(),
9898
Validator: addr.String(),
9999
},
100-
&types.MsgSend{
100+
&bank.MsgSend{
101101
FromAddress: addr.String(),
102102
ToAddress: addr.String(),
103103
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
@@ -109,7 +109,7 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
109109
{
110110
name: "Two messages in a transaction, one of them is an oracle vote message should fail (with MsgAggregateExchangeRateVote) permutation 2",
111111
messages: []sdk.Msg{
112-
&types.MsgSend{
112+
&bank.MsgSend{
113113
FromAddress: addr.String(),
114114
ToAddress: addr.String(),
115115
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
@@ -169,7 +169,7 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
169169
Feeder: addr.String(),
170170
Validator: addr.String(),
171171
},
172-
&types.MsgSend{
172+
&bank.MsgSend{
173173
FromAddress: addr.String(),
174174
ToAddress: addr.String(),
175175
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
@@ -186,25 +186,25 @@ func (suite *AnteTestSuite) TestOraclePostPriceTransactionsHaveFixedPrice() {
186186
{
187187
name: "Other two messages",
188188
messages: []sdk.Msg{
189-
&types.MsgSend{
189+
&bank.MsgSend{
190190
FromAddress: addr.String(),
191191
ToAddress: addr.String(),
192192
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 100)),
193193
},
194-
&types.MsgSend{
194+
&bank.MsgSend{
195195
FromAddress: addr.String(),
196196
ToAddress: addr.String(),
197197
Amount: sdk.NewCoins(sdk.NewInt64Coin(appconst.BondDenom, 200)),
198198
},
199199
},
200-
expectedGas: 67193,
200+
expectedGas: 38175,
201201
expectedErr: nil,
202202
},
203203
}
204204

205205
for _, tc := range tests {
206206
tc := tc
207-
suite.T().Run(tc.name, func(t *testing.T) {
207+
suite.Run(tc.name, func() {
208208
suite.SetupTest() // setup
209209
suite.txBuilder = suite.clientCtx.TxConfig.NewTxBuilder()
210210

app/evmante/evmante_gas_consume.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ func (anteDec AnteDecEthGasConsume) AnteHandle(
9999

100100
fees, err := keeper.VerifyFee(
101101
txData,
102-
evm.EVMBankDenom,
103102
baseFeeMicronibiPerGas,
104103
ctx.IsCheckTx(),
105104
)

app/evmante/suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (s *TestSuite) TestGenesis() {
6060
wantErr: "min_commission must be positive",
6161
},
6262
} {
63-
s.T().Run(tc.name, func(t *testing.T) {
63+
s.Run(tc.name, func() {
6464
genStakingJson := s.encCfg.Codec.MustMarshalJSON(tc.gen)
6565
err := app.StakingModule{}.ValidateGenesis(
6666
s.encCfg.Codec,

app/modules_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (s *TestSuite) TestGenesis() {
6060
wantErr: "min_commission must be positive",
6161
},
6262
} {
63-
s.T().Run(tc.name, func(t *testing.T) {
63+
s.Run(tc.name, func() {
6464
genStakingJson := s.encCfg.Codec.MustMarshalJSON(tc.gen)
6565
err := app.StakingModule{}.ValidateGenesis(
6666
s.encCfg.Codec,

app/wasmext/stargate_query.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ func WasmAcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries {
120120

121121
// nibiru oracle
122122
"/nibiru.oracle.v1.Query/ExchangeRate": new(oracle.QueryExchangeRateResponse),
123-
"/nibiru.oracle.v1.Query/DatedExchangeRate": new(oracle.QueryDatedExchangeRateResponse),
124123
"/nibiru.oracle.v1.Query/ExchangeRateTwap": new(oracle.QueryExchangeRateResponse),
125124
"/nibiru.oracle.v1.Query/ExchangeRates": new(oracle.QueryExchangeRatesResponse),
126125
"/nibiru.oracle.v1.Query/Actives": new(oracle.QueryActivesResponse),

0 commit comments

Comments
 (0)