Skip to content
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
4093a7d
use libevm: params, core/vm, eth/tracers/* + some of core/types (#662)
Nov 6, 2024
76724a3
rename: ethereum/go-ethereum -> ava-labs/libevm (#681)
Nov 7, 2024
fd99641
Remove IsProhibited (#682)
Nov 7, 2024
d7a7fce
libevm renaming nits (#683)
Nov 12, 2024
35736dd
Use upstream statedb (#669)
Nov 29, 2024
98f84c5
use libevm v1.13.14-0.1.0.rc-2 (#694)
Dec 2, 2024
826f074
fix passing options to Call (needed for native asset historical corre…
Dec 12, 2024
a7f7061
refactor: params.ChainConfigExtra & RulesExtra -> params/extras (#702)
Dec 18, 2024
0c04bd9
Merge branch 'master' into libevm (#739)
Jan 9, 2025
26c2828
depend on libevm not go-ethereum (#742)
Jan 9, 2025
d2ae72e
avoid import of params from plugin/evm/atomic (#743)
Jan 13, 2025
d30eb15
chore(core): split our code from state_processor.go in state_processo…
qdm12 Feb 7, 2025
f5c6526
chore(core/types): remove `Blocks`'s `Timestamp()` method (#749)
qdm12 Feb 7, 2025
a295e40
chore(all): minimal changes for libevm v1.13.14-0.2.0.rc.3 (#811)
Feb 20, 2025
96545dc
Merge branch 'master' into libevm (#812)
Feb 20, 2025
db1df28
chore(core/types): code restructure to accomodate future libevm chang…
qdm12 Feb 20, 2025
7a89e1d
Merge branch 'master' into libevm (#821)
ceyonur Feb 20, 2025
70c125b
Merge branch 'master' into libevm (#823)
qdm12 Feb 21, 2025
c82959b
remove vmerrs (#829)
ceyonur Feb 24, 2025
cb30d64
chore(core/types): header JSON and RLP serialization hooks (#746)
Feb 25, 2025
ab612d2
chore(core/types): `Header` libevm `PostCopy` hook (5) (#759)
qdm12 Feb 25, 2025
bd80c81
chore(core/types): remove block.go and import `Block` and `Body` from…
qdm12 Feb 28, 2025
ae791c4
chore(core/rawdb): add `ExampleInspectDatabase` to check custom behav…
qdm12 Feb 28, 2025
c35d58c
chore(core/rawdb): `InspectDatabase` uses libevm (8) (#791)
qdm12 Mar 2, 2025
f38d1e8
chore(core/rawdb): use libevm core/rawdb (#772)
qdm12 Mar 5, 2025
495f435
fix(core/evm): set difficulty post shanghai to 0 (#832)
Mar 5, 2025
6555349
fix(metrics): avoid conflicts between `coreth` and `libevm` (#860)
ARR4N Mar 7, 2025
51d6423
Merge branch 'master' into libevm (#828)
qdm12 Mar 7, 2025
b13b68e
chore(rawdb): migration to plugin/evm/rawdb (#851)
qdm12 Mar 11, 2025
450fdc3
chore(accounts/abi/bind): revert accidental changes to TestGetSenderN…
qdm12 Mar 11, 2025
377d67d
refactor(core/types): add `WithHeaderExtra` helper function (#855)
qdm12 Mar 11, 2025
0ce0390
chore(ci): check gencodec generated files are up to date (#856)
qdm12 Mar 11, 2025
8d305cd
refactor(core/rawdb): table-driven `InspectDatabase` config (#850)
qdm12 Mar 11, 2025
31b8559
Merge branch 'master' into libevm
ARR4N Mar 11, 2025
dd73f85
chore: log libevm version during VM init (#871)
ARR4N Mar 14, 2025
02d15ca
refactor(core/types): separate coreth and upstream identifiers (#872)
ARR4N Mar 14, 2025
dbfc302
chore: remove unused `libevm` directory (#876)
ARR4N Mar 14, 2025
89445c1
chore: disallow direct `libevm/params` import (#874)
ARR4N Mar 14, 2025
197a784
refactor: use upstream `core/types` (#875)
ARR4N Mar 14, 2025
33638ed
refactor: move `core/types` to `plugin/evm/types` (#877)
ARR4N Mar 14, 2025
9646fdd
chore(deps): use libevm avalanchego based on `v1.12.3-name-fortuna` (…
qdm12 Mar 26, 2025
de477e4
chore(rawdb): move plugin/evm/rawdb to plugin/evm/customrawdb (#888)
qdm12 Mar 26, 2025
86c7df2
chore(interfaces): use upstream code (#883)
qdm12 Mar 26, 2025
79f2af7
chore(deps): bump libevm to v1.13.14-0.2.0.rc.4 (#889)
qdm12 Mar 26, 2025
5f11af7
chore(types): move plugin/evm/types to plugin/evm/customtypes (#890)
qdm12 Mar 26, 2025
8f7795f
chore(all): final changes to the libevm branch (#862)
qdm12 Mar 28, 2025
d60e65e
Merge branch 'master' into libevm
qdm12 Mar 27, 2025
0d68be6
Merge branch 'master' into libevm
qdm12 Mar 31, 2025
aacce87
test(core/genesis): fix UT to be sensitive to `SetEthUpgrades` (#904)
Apr 7, 2025
7316fd8
fix(metrics/prometheus): skip `GaugeInfo` metric types (#910)
qdm12 Apr 8, 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
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
go mod edit -replace github.com/ava-labs/avalanchego=./avalanchego
go mod tidy
go clean -modcache # avoid conflicts with the golangci-lint-action cache
- run: ./scripts/lint_allowed_geth_imports.sh
- run: ./scripts/lint_allowed_eth_imports.sh
shell: bash
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down Expand Up @@ -97,6 +97,12 @@ jobs:
go generate -run "go.uber.org/mock/mockgen" ./...
git add --intent-to-add --all
git diff --exit-code
- 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
- run: ./scripts/build.sh evm
shell: bash
- run: ./scripts/build_test.sh
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"io"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/crypto"
)

// The ABI holds information about a contract's context and available
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abi_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ava-labs/libevm/common"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ import (
"strings"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/common/math"
"github.com/ava-labs/libevm/crypto"
"github.com/stretchr/testify/assert"
)

Expand Down
14 changes: 7 additions & 7 deletions accounts/abi/bind/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import (
"io"
"math/big"

"github.com/ava-labs/coreth/accounts"
"github.com/ava-labs/coreth/accounts/external"
"github.com/ava-labs/coreth/accounts/keystore"
"github.com/ava-labs/coreth/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/accounts"
"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"
)

// ErrNoChainID is returned whenever the user failed to specify a chain id.
Expand Down
22 changes: 11 additions & 11 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"

"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"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
21 changes: 11 additions & 10 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ import (
"context"

"github.com/ava-labs/coreth/accounts/abi/bind"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/ethclient/simulated"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
ethereum "github.com/ava-labs/libevm"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/types"
)

// Verify that SimulatedBackend implements required 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
24 changes: 12 additions & 12 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ import (
"sync"

"github.com/ava-labs/coreth/accounts/abi"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/interfaces"
"github.com/ava-labs/coreth/nativeasset"
"github.com/ava-labs/coreth/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
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"
)

const basefeeWiggleMultiplier = 2
Expand Down Expand Up @@ -197,7 +197,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 @@ -308,14 +308,14 @@ func wrapNativeAssetCall(opts *TransactOpts, contract *common.Address, input []b
return nil, nil, errNativeAssetDeployContract
}
// wrap input with native asset call params
input = vm.PackNativeAssetCallInput(
input = nativeasset.PackNativeAssetCallInput(
*contract,
opts.NativeAssetCall.AssetID,
opts.NativeAssetCall.AssetAmount,
input,
)
// target addr is now precompile
contract = &vm.NativeAssetCallAddr
contract = &nativeasset.NativeAssetCallAddr
}
return contract, input, nil
}
Expand Down Expand Up @@ -424,7 +424,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 @@ -513,7 +513,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 @@ -562,7 +562,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
26 changes: 13 additions & 13 deletions accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import (

"github.com/ava-labs/coreth/accounts/abi"
"github.com/ava-labs/coreth/accounts/abi/bind"
"github.com/ava-labs/coreth/core/types"
"github.com/ava-labs/coreth/core/vm"
"github.com/ava-labs/coreth/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ava-labs/coreth/nativeasset"
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/stretchr/testify/assert"
)

Expand Down Expand Up @@ -79,7 +79,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 @@ -101,7 +101,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 @@ -121,7 +121,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 @@ -141,7 +141,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 Expand Up @@ -404,8 +404,8 @@ func TestTransactNativeAssetCall(t *testing.T) {
nativeCallTx, err := bc.Transact(opts, methodName, arg1, arg2)
assert.Nil(err)
// verify transformations
assert.Equal(vm.NativeAssetCallAddr, *nativeCallTx.To())
unpackedAddr, unpackedAssetID, unpackedAssetAmount, unpackedData, err := vm.UnpackNativeAssetCallInput(nativeCallTx.Data())
assert.Equal(nativeasset.NativeAssetCallAddr, *nativeCallTx.To())
unpackedAddr, unpackedAssetID, unpackedAssetAmount, unpackedData, err := nativeasset.UnpackNativeAssetCallInput(nativeCallTx.Data())
assert.Nil(err)
assert.NotEmpty(unpackedData)
assert.Equal(unpackedData, normalCallTx.Data())
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"unicode"

"github.com/ava-labs/coreth/accounts/abi"
"github.com/ethereum/go-ethereum/log"
"github.com/ava-labs/libevm/log"
)

// Lang is a target programming language selector to generate bindings for.
Expand Down
Loading