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

[EVM] Add tx replacement #1192

Open
wants to merge 60 commits into
base: evm
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
dc3b332
Add EVM module & types/keeper (#1052)
codchen Sep 21, 2023
82c4be4
EVM ante handler for signature verification (#1059)
codchen Sep 22, 2023
e71284a
[EVM] Add gas check ante handler (#1067)
codchen Oct 2, 2023
dc0f028
[EVM] implement balance related methods for state interface (#1068)
codchen Oct 2, 2023
4fc5e43
Add state-related function implementations in EVM state interface (#1…
codchen Oct 2, 2023
55bd47e
[EVM] add remaining state interface functions (#1075)
codchen Oct 2, 2023
44d80a2
[EVM] add access list getter/setters (#1078)
codchen Oct 3, 2023
cc07dbf
[EVM] implement message server that processes EVM transactions (#1083)
codchen Oct 9, 2023
3efee16
update linter (#1060) (#1092)
codchen Oct 9, 2023
ac2f910
[EVM] add bank precompile (#1088)
codchen Oct 10, 2023
48391f0
[EVM] add API platform (#1093)
codchen Oct 11, 2023
0eaea1c
[EVM] RPC endpoint getBlockByHash (#1094)
codchen Oct 11, 2023
931e7ec
[EVM] add getBlockByNumber endpoint (#1098)
codchen Oct 12, 2023
a5a116d
[EVM] add endpoints to get block transaction count (#1099)
codchen Oct 12, 2023
8ea91fe
[EVM] add getTransactionReceipt (#1100)
codchen Oct 13, 2023
2e7be7a
[EVM] add getTransactions endpoints (#1101)
codchen Oct 17, 2023
87130e6
[EVM] add endpoint to get transaction count by address (#1103)
codchen Oct 17, 2023
fa324c1
[EVM] fix gas logic (#1104)
codchen Oct 19, 2023
2f3ef35
[EVM] add endpoint to return fee history (#1106)
codchen Oct 19, 2023
2cc2a74
[EVM] add info endpoints (#1107)
codchen Oct 19, 2023
fb337b3
[EVM] eth state endpoints (#1105)
jewei1997 Oct 19, 2023
c9cc4a0
[EVM] add subscription utility (#1109)
codchen Oct 23, 2023
fc9f6f7
[EVM] add endpoint to send transaction (#1108)
codchen Oct 23, 2023
7120e9d
[EVM] get simulation endpoints (#1110)
codchen Oct 25, 2023
68e65c4
[EVM] add getProof endpoint (#1114)
codchen Oct 27, 2023
1c8a631
[EVM] ETH Log Filter Endpoints (#1116)
jewei1997 Oct 31, 2023
841847e
[EVM] return gas info in message handler correctly (#1115)
codchen Nov 1, 2023
df1753f
EVM Module Integration (#1122)
codchen Nov 3, 2023
20edb22
[EVM] add transaction type to associate account (#1126)
codchen Nov 7, 2023
a461c39
[EVM] convert balance decimal points (#1128)
codchen Nov 7, 2023
d60396a
[EVM] ETH block filter endpoint (#1127)
jewei1997 Nov 8, 2023
9460114
[EVM] surface VM error (#1130)
codchen Nov 9, 2023
be8a9dd
[EVM] add ACL dependencies (#1129)
codchen Nov 9, 2023
7934261
[EVM] several bug fixes (#1136)
codchen Nov 13, 2023
c80fa34
[EVM] add `wasmd` precompile (#1139)
codchen Nov 14, 2023
1c33db0
[EVM] add bank metadata precompile functions (#1140)
codchen Nov 14, 2023
1a2be22
[EVM] subscription based eth endpoints (#1132)
jewei1997 Nov 15, 2023
454eba5
[EVM] handle gapped nonce in CheckTx (#1142)
codchen Nov 17, 2023
9d7c401
[EVM] fix getProof (#1145)
codchen Nov 17, 2023
09887d9
[EVM] add deps for EVM ante handlers (#1149)
codchen Nov 22, 2023
716a0b2
[EVM] denormalize intermediary and coinbase accounts (#1153)
codchen Nov 22, 2023
0b024d7
EVM ERC20 Template Contract (#1146)
jewei1997 Nov 28, 2023
8bd3a45
[EVM] seid command to deploy erc20 contract for a native sei token (#…
jewei1997 Dec 1, 2023
cff9f16
[EVM] preprocess EVM transactions and define granular access operatio…
codchen Dec 5, 2023
f4ea986
[EVM] --slow config for send raw txn (#1165)
jewei1997 Dec 5, 2023
122ae3c
[EVM] add ERC-721 -> CW-721 interoperability contract (#1162)
codchen Dec 6, 2023
33116aa
[EVM] allow passing in private key hex for address association (#1166)
codchen Dec 6, 2023
057f37e
[EVM] Sign and Accounts endpoints (#1167)
codchen Dec 12, 2023
d08a479
bump base geth version (#1172)
codchen Dec 13, 2023
d048f8c
Use pending transactions to handle higher nonce txs gracefully (#1175)
codchen Dec 18, 2023
c124d4a
[EVM] fix logs disappearing issue (#1178)
codchen Dec 19, 2023
64a5f79
Use better error message (#1179)
codchen Dec 19, 2023
a7e8d10
Fix empty uncle hash (#1183)
stevenlanders Dec 26, 2023
b3a5a7e
Fix getTxByHash for pending txs (#1181)
codchen Dec 26, 2023
b5362ae
[EVM] show bank send in GetBlock response (#1187)
codchen Dec 26, 2023
0580149
[EVM] add stateless checks (#1188)
codchen Dec 27, 2023
306971d
add tx replacement
stevenlanders Dec 28, 2023
0cbead3
fix lint
stevenlanders Dec 28, 2023
fcccead
update nonce/address injection
stevenlanders Dec 29, 2023
88e3864
fix issue with sending non-legacy txs
stevenlanders Dec 29, 2023
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/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: '1.21'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/compatiblity_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.21'

- name: Check Latest Dependencies
run: |
git clone https://github.com/sei-protocol/sei-cosmos.git
git clone https://github.com/sei-protocol/sei-tendermint.git
git clone https://github.com/sei-protocol/sei-iavl.git
git clone https://github.com/sei-protocol/go-ethereum.git
go mod edit -replace github.com/cosmos/iavl=./sei-iavl
go mod edit -replace github.com/tendermint/tendermint=./sei-tendermint
go mod edit -replace github.com/cosmos/cosmos-sdk=./sei-cosmos
go mod edit -replace github.com/ethereum/go-ethereum=./go-ethereum
go mod tidy
make install
40 changes: 40 additions & 0 deletions .github/workflows/forge-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Forge test

on:
pull_request:
push:
branches:
- main
- evm
- release/**

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: '1.21'

- name: Fuzz Place Order Msg
run: go test github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver -fuzz FuzzPlaceOrders -fuzztime 30s
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: '1.21.3'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.47.2
version: latest
args: --timeout 10m0s
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: '1.21'

- name: Start 4 node docker cluster
run: make clean && INVARIANT_CHECK_INTERVAL=10 make docker-cluster-start &
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "**.go"
branches:
- main
- evm
- release/**

jobs:
Expand All @@ -18,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.21"
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6
with:
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.21'

# Download all coverage reports from the 'tests' job
- name: Download coverage reports
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ release/
.vscode/
.DS_Store
build/
cache/

Local .terraform directories
# Local .terraform directories
**/.terraform

# .tfstate files
Expand Down Expand Up @@ -44,4 +45,7 @@ integration_test/**/*.txt

# Coverage Files
coverage.html
coverage.out
coverage.out

# example artifacts
example/cosmwasm/echo/target
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "contracts/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
16 changes: 8 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
# - depguard ## see https://github.com/golangci/golangci-lint/issues/3906
- dogsled
- exportloopref
- errcheck
- goconst
- gocritic
# - gocritic
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
# - nakedret
- prealloc
- staticcheck
- structcheck
# - structcheck ## author abandoned project
- stylecheck
- revive
- typecheck
# - typecheck
- unconvert
- unused
- unparam
# - unused
# - unparam
- misspell
- nolintlint
# - nolintlint ## does not work with IDEs like VSCode which automatically insert leading spaces

issues:
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker build . -t sei-protocol/sei:latest
# docker run --rm -it sei-protocol/sei:latest /bin/sh
FROM golang:1.20-alpine AS go-builder
FROM golang:1.21-alpine AS go-builder

# this comes from standard alpine nightly file
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile
Expand Down
5 changes: 4 additions & 1 deletion aclmapping/dependency_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
aclkeeper "github.com/cosmos/cosmos-sdk/x/accesscontrol/keeper"
aclbankmapping "github.com/sei-protocol/sei-chain/aclmapping/bank"
acldexmapping "github.com/sei-protocol/sei-chain/aclmapping/dex"
aclevmmapping "github.com/sei-protocol/sei-chain/aclmapping/evm"
acloraclemapping "github.com/sei-protocol/sei-chain/aclmapping/oracle"
acltokenfactorymapping "github.com/sei-protocol/sei-chain/aclmapping/tokenfactory"
aclwasmmapping "github.com/sei-protocol/sei-chain/aclmapping/wasm"
evmkeeper "github.com/sei-protocol/sei-chain/x/evm/keeper"
)

type CustomDependencyGenerator struct{}
Expand All @@ -15,7 +17,7 @@ func NewCustomDependencyGenerator() CustomDependencyGenerator {
return CustomDependencyGenerator{}
}

func (customDepGen CustomDependencyGenerator) GetCustomDependencyGenerators() aclkeeper.DependencyGeneratorMap {
func (customDepGen CustomDependencyGenerator) GetCustomDependencyGenerators(evmKeeper evmkeeper.Keeper) aclkeeper.DependencyGeneratorMap {
dependencyGeneratorMap := make(aclkeeper.DependencyGeneratorMap)
wasmDependencyGenerators := aclwasmmapping.NewWasmDependencyGenerator()

Expand All @@ -24,6 +26,7 @@ func (customDepGen CustomDependencyGenerator) GetCustomDependencyGenerators() ac
dependencyGeneratorMap = dependencyGeneratorMap.Merge(acltokenfactorymapping.GetTokenFactoryDependencyGenerators())
dependencyGeneratorMap = dependencyGeneratorMap.Merge(wasmDependencyGenerators.GetWasmDependencyGenerators())
dependencyGeneratorMap = dependencyGeneratorMap.Merge(acloraclemapping.GetOracleDependencyGenerator())
dependencyGeneratorMap = dependencyGeneratorMap.Merge(aclevmmapping.GetEVMDependencyGenerators(evmKeeper))

return dependencyGeneratorMap
}
4 changes: 2 additions & 2 deletions aclmapping/dex/mappings.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func GetLongShortOrderBookOps(contractAddr string, priceDenom string, assetDenom
}
}

func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) {
func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, _ sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) {
placeOrdersMsg, ok := msg.(*dextypes.MsgPlaceOrders)
if !ok {
return []sdkacltypes.AccessOperation{}, ErrPlaceOrdersGenerator
Expand Down Expand Up @@ -160,7 +160,7 @@ func DexPlaceOrdersDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context,
return aclOps, nil
}

func DexCancelOrdersDependencyGenerator(keeper aclkeeper.Keeper, ctx sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) {
func DexCancelOrdersDependencyGenerator(_ aclkeeper.Keeper, _ sdk.Context, msg sdk.Msg) ([]sdkacltypes.AccessOperation, error) {
cancelOrdersMsg, ok := msg.(*dextypes.MsgCancelOrders)
if !ok {
return []sdkacltypes.AccessOperation{}, ErrPlaceOrdersGenerator
Expand Down
2 changes: 1 addition & 1 deletion aclmapping/dex/mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (suite *KeeperTestSuite) TestMsgCancelOrder() {
func TestGeneratorInvalidMessageTypes(t *testing.T) {
tm := time.Now().UTC()
valPub := secp256k1.GenPrivKey().PubKey()
testWrapper := app.NewTestWrapper(t, tm, valPub)
testWrapper := app.NewTestWrapper(t, tm, valPub, false)

oracleVote := oracletypes.MsgAggregateExchangeRateVote{
ExchangeRates: "1usei",
Expand Down
Loading
Loading