Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fd683d5
chore(core/types): code restructure to accomodate future libevm changes
qdm12 Feb 20, 2025
825153e
chore(all): remove vmerrs package
ceyonur Feb 24, 2025
9752746
chore(core/types): header JSON and RLP serialization hooks
Feb 25, 2025
5d6e078
chore(core/types): `Header` libevm `PostCopy` hook
qdm12 Feb 25, 2025
a1f212a
chore(core/types): remove block.go and import `Block` and `Body` from…
qdm12 Feb 28, 2025
38a9521
chore(core/rawdb): add `ExampleInspectDatabase` to check custom behavior
qdm12 Feb 28, 2025
292f3df
chore(core/rawdb): `InspectDatabase` uses libevm
qdm12 Mar 2, 2025
2768dd5
chore(core/rawdb): use libevm core/rawdb
qdm12 Mar 5, 2025
a183ff8
fix(core/evm): set difficulty post shanghai to 0
Mar 5, 2025
0ffb624
chore(rawdb): migration to plugin/evm/rawdb
qdm12 Mar 11, 2025
c74aa9e
refactor(core/types): add `WithHeaderExtra` helper function
qdm12 Mar 11, 2025
8664cbf
chore(ci): check gencodec generated files are up to date
qdm12 Mar 11, 2025
821575f
refactor(core/rawdb): table-driven `InspectDatabase` config
qdm12 Mar 11, 2025
dc4f237
chore(plugin/evm): log libevm version during VM init
ARR4N Mar 14, 2025
bded714
refactor(core/types): separate subnet-evm and upstream identifiers
qdm12 Mar 19, 2025
c5a9a76
chore: remove unused `libevm` directory
ARR4N Mar 14, 2025
f5364a1
chore: disallow direct `libevm/params` import
ARR4N Mar 14, 2025
b45b79a
refactor: use upstream `core/types`
ARR4N Mar 14, 2025
d393209
refactor: move `core/types` to `plugin/evm/types`
ARR4N Mar 14, 2025
4395f6e
chore(rawdb): move plugin/evm/rawdb to plugin/evm/customrawdb
qdm12 Mar 26, 2025
fa576f0
chore(interfaces): use upstream code
qdm12 Mar 26, 2025
d6e4708
chore(types): move plugin/evm/types to plugin/evm/customtypes
qdm12 Mar 26, 2025
08e92ea
chore(all): final changes to the libevm branch
qdm12 Mar 28, 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
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
run: echo "TIMEOUT=1200s" >> "$GITHUB_ENV"
- run: go mod download
shell: bash
- name: fjl/gencodec generated files are up to date
run: |
grep -lr -E '^// Code generated by github\.com\/fjl\/gencodec\. DO NOT EDIT\.$' . | xargs -r rm
go generate -run "github.com/fjl/gencodec" ./...
git add --intent-to-add --all
git diff --exit-code
- name: Mocks are up to date
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
"github.com/ava-labs/libevm/accounts/external"
"github.com/ava-labs/libevm/accounts/keystore"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/log"
"github.com/ava-labs/subnet-evm/core/types"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
20 changes: 10 additions & 10 deletions accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
"errors"
"math/big"

ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/ava-labs/libevm/core/types"
)

var (
Expand Down Expand Up @@ -64,7 +64,7 @@ type ContractCaller interface {

// CallContract executes an Ethereum contract call with the specified data as the
// input.
CallContract(ctx context.Context, call interfaces.CallMsg, blockNumber *big.Int) ([]byte, error)
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
}

// AcceptedContractCaller defines methods to perform contract calls on the pending state.
Expand All @@ -75,7 +75,7 @@ type AcceptedContractCaller interface {
AcceptedCodeAt(ctx context.Context, contract common.Address) ([]byte, error)

// AcceptedCallContract executes an Ethereum contract call against the accepted state.
AcceptedCallContract(ctx context.Context, call interfaces.CallMsg) ([]byte, error)
AcceptedCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
}

// BlockHashContractCaller defines methods to perform contract calls on a specific block hash.
Expand All @@ -86,18 +86,18 @@ type BlockHashContractCaller interface {
CodeAtHash(ctx context.Context, contract common.Address, blockHash common.Hash) ([]byte, error)

// CallContractAtHash executes an Ethereum contract call against the state at the specified block hash.
CallContractAtHash(ctx context.Context, call interfaces.CallMsg, blockHash common.Hash) ([]byte, error)
CallContractAtHash(ctx context.Context, call ethereum.CallMsg, blockHash common.Hash) ([]byte, error)
}

// ContractTransactor defines the methods needed to allow operating with a contract
// on a write only basis. Besides the transacting method, the remainder are helpers
// used when the user does not provide some needed values, but rather leaves it up
// to the transactor to decide.
type ContractTransactor interface {
interfaces.GasEstimator
interfaces.GasPricer
interfaces.GasPricer1559
interfaces.TransactionSender
ethereum.GasEstimator
ethereum.GasPricer
ethereum.GasPricer1559
ethereum.TransactionSender

// HeaderByNumber returns a block header from the current canonical chain. If
// number is nil, the latest known header is returned.
Expand All @@ -119,7 +119,7 @@ type DeployBackend interface {
// ContractFilterer defines the methods needed to access log events using one-off
// queries or continuous event subscriptions.
type ContractFilterer interface {
interfaces.LogFilterer
ethereum.LogFilterer
}

// ContractBackend defines the methods needed to work with contracts on a read-write basis.
Expand Down
19 changes: 10 additions & 9 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ package backends
import (
"context"

ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/ethclient/simulated"
"github.com/ava-labs/subnet-evm/interfaces"
)
Expand All @@ -42,14 +43,14 @@ var (
_ bind.ContractBackend = (*SimulatedBackend)(nil)
_ bind.DeployBackend = (*SimulatedBackend)(nil)

_ interfaces.ChainReader = (*SimulatedBackend)(nil)
_ interfaces.ChainStateReader = (*SimulatedBackend)(nil)
_ interfaces.TransactionReader = (*SimulatedBackend)(nil)
_ interfaces.TransactionSender = (*SimulatedBackend)(nil)
_ interfaces.ContractCaller = (*SimulatedBackend)(nil)
_ interfaces.GasEstimator = (*SimulatedBackend)(nil)
_ interfaces.GasPricer = (*SimulatedBackend)(nil)
_ interfaces.LogFilterer = (*SimulatedBackend)(nil)
_ ethereum.ChainReader = (*SimulatedBackend)(nil)
_ ethereum.ChainStateReader = (*SimulatedBackend)(nil)
_ ethereum.TransactionReader = (*SimulatedBackend)(nil)
_ ethereum.TransactionSender = (*SimulatedBackend)(nil)
_ ethereum.ContractCaller = (*SimulatedBackend)(nil)
_ ethereum.GasEstimator = (*SimulatedBackend)(nil)
_ ethereum.GasPricer = (*SimulatedBackend)(nil)
_ ethereum.LogFilterer = (*SimulatedBackend)(nil)
_ interfaces.AcceptedStateReader = (*SimulatedBackend)(nil)
_ interfaces.AcceptedContractCaller = (*SimulatedBackend)(nil)
)
Expand Down
12 changes: 6 additions & 6 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ import (
"strings"
"sync"

ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/event"
"github.com/ava-labs/subnet-evm/accounts/abi"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/ava-labs/subnet-evm/rpc"
)

Expand Down Expand Up @@ -179,7 +179,7 @@ func (c *BoundContract) Call(opts *CallOpts, results *[]interface{}, method stri
return err
}
var (
msg = interfaces.CallMsg{From: opts.From, To: &c.address, Data: input}
msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input}
ctx = ensureContext(opts.Context)
code []byte
output []byte
Expand Down Expand Up @@ -374,7 +374,7 @@ func (c *BoundContract) estimateGasLimit(opts *TransactOpts, contract *common.Ad
return 0, ErrNoCode
}
}
msg := interfaces.CallMsg{
msg := ethereum.CallMsg{
From: opts.From,
To: contract,
GasPrice: gasPrice,
Expand Down Expand Up @@ -458,7 +458,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
// Start the background filtering
logs := make(chan types.Log, 128)

config := interfaces.FilterQuery{
config := ethereum.FilterQuery{
Addresses: []common.Address{c.address},
Topics: topics,
FromBlock: new(big.Int).SetUint64(opts.Start),
Expand Down Expand Up @@ -507,7 +507,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter
// Start the background filtering
logs := make(chan types.Log, 128)

config := interfaces.FilterQuery{
config := ethereum.FilterQuery{
Addresses: []common.Address{c.address},
Topics: topics,
}
Expand Down
12 changes: 6 additions & 6 deletions accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ import (
"strings"
"testing"

ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/hexutil"
"github.com/ava-labs/libevm/core/types"
"github.com/ava-labs/libevm/crypto"
"github.com/ava-labs/libevm/rlp"
"github.com/ava-labs/subnet-evm/accounts/abi"
"github.com/ava-labs/subnet-evm/accounts/abi/bind"
"github.com/ava-labs/subnet-evm/core/types"
"github.com/ava-labs/subnet-evm/interfaces"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -77,7 +77,7 @@ func (mt *mockTransactor) SuggestGasTipCap(ctx context.Context) (*big.Int, error
return mt.gasTipCap, nil
}

func (mt *mockTransactor) EstimateGas(ctx context.Context, call interfaces.CallMsg) (gas uint64, err error) {
func (mt *mockTransactor) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) {
return 0, nil
}

Expand All @@ -99,7 +99,7 @@ func (mc *mockCaller) CodeAt(ctx context.Context, contract common.Address, block
return mc.codeAtBytes, mc.codeAtErr
}

func (mc *mockCaller) CallContract(ctx context.Context, call interfaces.CallMsg, blockNumber *big.Int) ([]byte, error) {
func (mc *mockCaller) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
mc.callContractBlockNumber = blockNumber
return mc.callContractBytes, mc.callContractErr
}
Expand All @@ -119,7 +119,7 @@ func (mc *mockAcceptedCaller) AcceptedCodeAt(ctx context.Context, contract commo
return mc.acceptedCodeAtBytes, mc.acceptedCodeAtErr
}

func (mc *mockAcceptedCaller) AcceptedCallContract(ctx context.Context, call interfaces.CallMsg) ([]byte, error) {
func (mc *mockAcceptedCaller) AcceptedCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
mc.acceptedCallContractCalled = true
return mc.acceptedCallContractBytes, mc.acceptedCallContractErr
}
Expand All @@ -139,7 +139,7 @@ func (mc *mockBlockHashCaller) CodeAtHash(ctx context.Context, contract common.A
return mc.codeAtHashBytes, mc.codeAtHashErr
}

func (mc *mockBlockHashCaller) CallContractAtHash(ctx context.Context, call interfaces.CallMsg, hash common.Hash) ([]byte, error) {
func (mc *mockBlockHashCaller) CallContractAtHash(ctx context.Context, call ethereum.CallMsg, hash common.Hash) ([]byte, error) {
mc.callContractAtHashCalled = true
return mc.callContractAtHashBytes, mc.callContractAtHashErr
}
Expand Down
Loading
Loading