Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c049c44
fix: upgrade dependencies
expertdicer Apr 25, 2025
1f31fd2
fix app and upgrade dependencies
expertdicer Apr 25, 2025
0f8bf6d
fix tokenfactory module
expertdicer Apr 25, 2025
b2b1d21
partially fix modules
expertdicer Apr 25, 2025
15a2606
partially fix cmd
expertdicer Apr 25, 2025
271b468
use ExecTxResult
expertdicer Apr 25, 2025
a88048d
fix cmd
expertdicer Apr 25, 2025
cb42e34
fix DecodeBase64Cmd
expertdicer Apr 28, 2025
6d5dd50
fix testnetwork
expertdicer Apr 28, 2025
e08d07b
fix evm unit test
expertdicer Apr 28, 2025
62656f3
fix start cmd and rosseta config
expertdicer Apr 28, 2025
affac4d
use servercmtlog and use correct abci types
expertdicer Apr 28, 2025
7c380e3
update wasmvm version in Makefile
expertdicer Apr 28, 2025
f01274e
add service annotation and signer
expertdicer Apr 29, 2025
9546a3b
make proto gen
expertdicer Apr 29, 2025
d504df1
fix interface for evm
expertdicer Apr 29, 2025
a7e45c9
EthereumTx getsigner func
expertdicer Apr 29, 2025
e6205b1
add capability keeper and query router for icaHostKeeper
expertdicer Apr 29, 2025
c9a469e
fix cmd and use autocli
expertdicer Apr 29, 2025
c2ef777
use GetModuleAccount
expertdicer May 5, 2025
581b228
implement SchemaProvider
expertdicer May 5, 2025
781cde8
fix init cmd
expertdicer May 5, 2025
93fe689
add Preblocker
expertdicer May 5, 2025
d0429fe
fix RegisterSwaggerAPI
expertdicer May 5, 2025
54a49ff
use correct GenDocProvider
expertdicer May 5, 2025
905ab95
fix localnet
expertdicer May 5, 2025
6ce2523
Merge branch 'main' into expertdicer/feat/v50
expertdicer May 5, 2025
b99f897
fix v2.4.0 upgrade
expertdicer May 5, 2025
6513da4
use servercmtlog
expertdicer May 5, 2025
14926a4
fix: add Capability module
expertdicer May 6, 2025
f81cdb9
add appCodec for wasm MsgHandlerArgs
expertdicer May 6, 2025
95df03f
implement sdk.AccountI for EthAccount
expertdicer May 6, 2025
1270920
GenDocProvider for testnetwork
expertdicer May 6, 2025
4f0f022
use testing tempdir
expertdicer May 6, 2025
5864044
fix test
expertdicer May 7, 2025
9f14eec
add tempdir for ibc testing
expertdicer May 7, 2025
4576786
correct chain id from context
expertdicer May 7, 2025
4667b6a
fix tests
expertdicer May 7, 2025
9015412
implement HasAddressCodec for NibiruBankKeeper
expertdicer May 7, 2025
0ef6e4b
fix tests
expertdicer May 9, 2025
18ce4e5
fix oracle and genmsg tests
expertdicer May 9, 2025
8562c60
continue fix tests
expertdicer May 12, 2025
401fd2e
continue fix tests
expertdicer May 13, 2025
576272e
Merge branch 'main' into expertdicer/feat/v50
expertdicer May 13, 2025
62067f9
rename libwasmvm saved name
expertdicer May 13, 2025
e791017
fix chaosnet
expertdicer May 13, 2025
918442a
lint
expertdicer May 13, 2025
0eac8a6
lint
expertdicer May 13, 2025
bd20e3c
seal devgas amino and lint
expertdicer May 13, 2025
052965f
fix BlockBloom event in backend
expertdicer May 19, 2025
46087d1
sanitize event
expertdicer May 19, 2025
66f445a
update changelog
expertdicer May 19, 2025
4c9a0cf
Merge branch 'main' into expertdicer/feat/v50
expertdicer May 20, 2025
523d709
adding msgResponses in DispatchMsg
expertdicer May 23, 2025
9bb1f14
use NewContextLegacy
expertdicer May 27, 2025
0609d6b
Merge branch 'main' into expertdicer/feat/v50
expertdicer May 27, 2025
60eaa00
update v2.4.0 upgrade
expertdicer May 27, 2025
ec23456
correct query cli
expertdicer May 27, 2025
f4f6a8b
Merge branch 'expertdicer/feat/v50' of https://github.com/NibiruChain…
expertdicer May 29, 2025
dc127aa
using tempdir for simulation tests
expertdicer May 30, 2025
b16aeef
lint and fix simulation tests
expertdicer May 30, 2025
82e0e56
Merge branch 'main' into expertdicer/feat/v50
expertdicer Jun 1, 2025
901ebdf
TxDataV2 and correct GetSigners for MsgEthereumTx
expertdicer Jun 2, 2025
4754bb2
Merge branch 'main' into expertdicer/feat/v50
expertdicer Jun 4, 2025
26acbaa
refactor(devgas): remove validate basic and use directly in msg server
expertdicer Jun 9, 2025
39524af
refactor(evm): use ValidateBasic directly in msg server
expertdicer Jun 9, 2025
e4f7071
refactor(inflation): use ValidateBasic directly in msg server
expertdicer Jun 9, 2025
4bf5ff4
refactor(oracle): use ValidateBasic directly in msg server
expertdicer Jun 9, 2025
a424610
refactor(sudo): use ValidateBasic directly in msg server
expertdicer Jun 9, 2025
acd2d92
refactor(tokenfactory): use ValidateBasic directly in msg server
expertdicer Jun 9, 2025
496c9e4
Merge branch 'main' into expertdicer/feat/v50
expertdicer Jun 10, 2025
8d158e0
chore: remove unused cli test
expertdicer Jun 10, 2025
911d3cd
chore: lint
expertdicer Jun 10, 2025
feb8e02
free up space
expertdicer Jun 16, 2025
3b07a5b
use cache in golangci-lint workflow
expertdicer Jun 17, 2025
567cf31
add skip-cache
expertdicer Jun 17, 2025
f3a05c1
Merge branch 'main' into expertdicer/feat/v50
onikonychev Jul 24, 2025
7224540
build: whitespace deployment
Unique-Divine Sep 16, 2025
654474c
Merge branch 'main' into expertdicer/feat/v50
expertdicer Sep 22, 2025
e94a3a0
Merge branch 'main' into expertdicer/feat/v50
expertdicer Sep 22, 2025
0126ab2
add signer for MsgConvertEvmToCoin and make proto-gen
expertdicer Sep 22, 2025
a741699
Merge branch 'expertdicer/feat/v50' of https://github.com/NibiruChain…
expertdicer Sep 22, 2025
816a01c
Refactor WASM query test and update dependencies and update tests
expertdicer Sep 23, 2025
ab55b2f
Update genesis test to use new context for initialization
expertdicer Sep 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --fix=false
args: --fix=false --timeout=10m

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ jobs:
path: ${{ steps.go-cache-paths.outputs.go-mod-cache }}
key: go-mod-cache-${{ hashFiles('**/go.sum') }}

- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
docker system prune -af

- name: "Run all integration tests."
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
run: make test-coverage-integration
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

<!--
NOTE: The brackets around the word "Unreleased" are required to pass the CI test
- [#2308](https://github.com/NibiruChain/nibiru/pull/2308) - feat: cosmos v50 upgrade
<!--
NOTE: The brackets around the word "Unreleased" are required to pass the [CI test
that checks if we updated the changelog. This is a convention from the [keep a
changelog format](https://keepachangelog.com/en/1.0.0/).
See https://github.com/dangoslen/changelog-enforcer.
Expand Down
63 changes: 63 additions & 0 deletions api/eth/evm/v1/access_list_tx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package evmv1

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
gethcore "github.com/ethereum/go-ethereum/core/types"

ethutils "github.com/NibiruChain/nibiru/v2/utils"
)

// GetChainID returns the chain id field from the AccessListTx
func (tx *AccessListTx) GetChainID() *big.Int {
return stringToBigInt(tx.GetChainId())
}

// GetAccessList returns the AccessList field.
func (tx *AccessListTx) GetAccessList() gethcore.AccessList {
if tx.Accesses == nil {
return nil
}
var ethAccessList gethcore.AccessList

for _, tuple := range tx.Accesses {
storageKeys := make([]common.Hash, len(tuple.StorageKeys))

for i := range tuple.StorageKeys {
storageKeys[i] = common.HexToHash(tuple.StorageKeys[i])
}

ethAccessList = append(ethAccessList, gethcore.AccessTuple{
Address: common.HexToAddress(tuple.Address),
StorageKeys: storageKeys,
})
}

return ethAccessList
}

// AsEthereumData returns an AccessListTx transaction tx from the proto-formatted
// TxData defined on the Cosmos EVM.
func (tx *AccessListTx) AsEthereumData() gethcore.TxData {
v, r, s := tx.GetRawSignatureValues()
return &gethcore.AccessListTx{
ChainID: tx.GetChainID(),
Nonce: tx.GetNonce(),
GasPrice: stringToBigInt(tx.GetGasPrice()),
Gas: tx.GetGas(),
To: stringToAddress(tx.GetTo()),
Value: stringToBigInt(tx.GetValue()),
Data: tx.GetData(),
AccessList: tx.GetAccessList(),
V: v,
R: r,
S: s,
}
}

// GetRawSignatureValues returns the V, R, S signature values of the transaction.
// The return values should not be modified by the caller.
func (tx *AccessListTx) GetRawSignatureValues() (v, r, s *big.Int) {
return ethutils.RawSignatureValues(tx.V, tx.R, tx.S)
}
64 changes: 64 additions & 0 deletions api/eth/evm/v1/dynamic_fee_tx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package evmv1

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
gethcore "github.com/ethereum/go-ethereum/core/types"

ethutils "github.com/NibiruChain/nibiru/v2/utils"
)

// GetChainID returns the chain id field from the DynamicFeeTx
func (tx *DynamicFeeTx) GetChainID() *big.Int {
return stringToBigInt(tx.GetChainId())
}

// AsEthereumData returns an DynamicFeeTx transaction tx from the proto-formatted
// TxData defined on the Cosmos EVM.
func (tx *DynamicFeeTx) AsEthereumData() gethcore.TxData {
v, r, s := tx.GetRawSignatureValues()
return &gethcore.DynamicFeeTx{
ChainID: tx.GetChainID(),
Nonce: tx.GetNonce(),
GasTipCap: stringToBigInt(tx.GetGasTipCap()),
GasFeeCap: stringToBigInt(tx.GetGasFeeCap()),
Gas: tx.GetGas(),
To: stringToAddress(tx.GetTo()),
Value: stringToBigInt(tx.GetValue()),
Data: tx.GetData(),
AccessList: tx.GetAccessList(),
V: v,
R: r,
S: s,
}
}

// GetAccessList returns the AccessList field.
func (tx *DynamicFeeTx) GetAccessList() gethcore.AccessList {
if tx.Accesses == nil {
return nil
}
var ethAccessList gethcore.AccessList

for _, tuple := range tx.Accesses {
storageKeys := make([]common.Hash, len(tuple.StorageKeys))

for i := range tuple.StorageKeys {
storageKeys[i] = common.HexToHash(tuple.StorageKeys[i])
}

ethAccessList = append(ethAccessList, gethcore.AccessTuple{
Address: common.HexToAddress(tuple.Address),
StorageKeys: storageKeys,
})
}

return ethAccessList
}

// GetRawSignatureValues returns the V, R, S signature values of the transaction.
// The return values should not be modified by the caller.
func (tx *DynamicFeeTx) GetRawSignatureValues() (v, r, s *big.Int) {
return ethutils.RawSignatureValues(tx.V, tx.R, tx.S)
}
45 changes: 45 additions & 0 deletions api/eth/evm/v1/legacy_tx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright Tharsis Labs Ltd.(Evmos)
// SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)
package evmv1

import (
"math/big"

gethcore "github.com/ethereum/go-ethereum/core/types"

ethutils "github.com/NibiruChain/nibiru/v2/utils"
)

// GetChainID returns the chain id field from the derived signature values
func (tx *LegacyTx) GetChainID() *big.Int {
v, _, _ := tx.GetRawSignatureValues()
return ethutils.DeriveChainID(v)
}

// AsEthereumData returns an LegacyTx transaction tx from the proto-formatted
// TxData defined on the Cosmos EVM.
func (tx *LegacyTx) AsEthereumData() gethcore.TxData {
v, r, s := tx.GetRawSignatureValues()
return &gethcore.LegacyTx{
Nonce: tx.GetNonce(),
GasPrice: stringToBigInt(tx.GetGasPrice()),
Gas: tx.GetGas(),
To: stringToAddress(tx.GetTo()),
Value: stringToBigInt(tx.GetValue()),
Data: tx.GetData(),
V: v,
R: r,
S: s,
}
}

// GetRawSignatureValues returns the V, R, S signature values of the transaction.
// The return values should not be modified by the caller.
func (tx *LegacyTx) GetRawSignatureValues() (v, r, s *big.Int) {
return ethutils.RawSignatureValues(tx.V, tx.R, tx.S)
}

// GetAccessList returns nil
func (tx *LegacyTx) GetAccessList() gethcore.AccessList {
return nil
}
55 changes: 55 additions & 0 deletions api/eth/evm/v1/msg.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package evmv1

import (
fmt "fmt"

"github.com/ethereum/go-ethereum/common"
gethcore "github.com/ethereum/go-ethereum/core/types"

protov2 "google.golang.org/protobuf/proto"
)

// supportedTxs holds the Ethereum transaction types
// supported by Nibiru.
// Use a function to return a new pointer and avoid
// possible reuse or racing conditions when using the same pointer
var supportedTxs = map[string]func() TxDataV2{
"/eth.evm.v1.DynamicFeeTx": func() TxDataV2 { return &DynamicFeeTx{} },
"/eth.evm.v1.AccessListTx": func() TxDataV2 { return &AccessListTx{} },
"/eth.evm.v1.LegacyTx": func() TxDataV2 { return &LegacyTx{} },
}

// getSender extracts the sender address from the signature values using the latest signer for the given chainID.
func getSender(txData TxDataV2) (common.Address, error) {
signer := gethcore.LatestSignerForChainID(txData.GetChainID())
from, err := signer.Sender(gethcore.NewTx(txData.AsEthereumData()))
if err != nil {
return common.Address{}, err
}
return from, nil
}

func EthereumTxGetSigners(msg protov2.Message) ([][]byte, error) {
msgEthereumTx, ok := msg.(*MsgEthereumTx)
if !ok {
return nil, fmt.Errorf("invalid type, expected MsgConvertERC20 and got %T", msg)
}

txDataFn, found := supportedTxs[msgEthereumTx.Data.TypeUrl]
if !found {
return nil, fmt.Errorf("invalid TypeUrl %s", msgEthereumTx.Data.TypeUrl)
}
txData := txDataFn()

// msgEthTx.Data is a message (DynamicFeeTx, LegacyTx or AccessListTx)
if err := msgEthereumTx.Data.UnmarshalTo(txData); err != nil {
return nil, err
}

sender, err := getSender(txData)
if err != nil {
return nil, err
}

return [][]byte{sender.Bytes()}, nil
}
Loading
Loading