Update import path

This commit is contained in:
2023-12-17 03:07:22 +01:00
parent 9e0b39db4a
commit fd08c47bd9
485 changed files with 2006 additions and 2001 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
# ref. https://goreleaser.com/customization/build/
builds:
- id: subnet-evm
- id: evm
main: ./plugin
binary: subnet-evm
binary: evm
flags:
- -v
ldflags: -X github.com/luxdefi/subnet-evm/plugin/evm.Version=v{{.Version}}
ldflags: -X github.com/luxdefi/evm/plugin/evm.Version=v{{.Version}}
goos:
- linux
- darwin
@@ -34,4 +34,4 @@ release:
# Default is extracted from the origin remote URL or empty if its private hosted.
github:
owner: luxdefi
name: subnet-evm
name: evm
+17 -17
View File
@@ -1,19 +1,19 @@
# Subnet EVM
# EVM
[![Build + Test + Release](https://github.com/luxdefi/subnet-evm/actions/workflows/lint-tests-release.yml/badge.svg)](https://github.com/luxdefi/subnet-evm/actions/workflows/lint-tests-release.yml)
[![CodeQL](https://github.com/luxdefi/subnet-evm/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/luxdefi/subnet-evm/actions/workflows/codeql-analysis.yml)
[![Build + Test + Release](https://github.com/luxdefi/evm/actions/workflows/lint-tests-release.yml/badge.svg)](https://github.com/luxdefi/evm/actions/workflows/lint-tests-release.yml)
[![CodeQL](https://github.com/luxdefi/evm/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/luxdefi/evm/actions/workflows/codeql-analysis.yml)
[Lux](https://docs.lux.network/overview/getting-started/lux-platform) is a network composed of multiple blockchains.
Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class.
That is, the VM defines the behavior of the blockchain.
Subnet EVM is the [Virtual Machine (VM)](https://docs.lux.network/learn/lux/virtual-machines) that defines the Subnet Contract Chains. Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/luxdefi/coreth).
EVM is the [Virtual Machine (VM)](https://docs.lux.network/learn/lux/virtual-machines) that defines the Subnet Contract Chains. EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/luxdefi/coreth).
This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.
## Building
The Subnet EVM runs in a separate process from the main Luxd process and communicates with it over a local gRPC connection.
The EVM runs in a separate process from the main Luxd process and communicates with it over a local gRPC connection.
### Luxd Compatibility
@@ -59,7 +59,7 @@ The Subnet EVM runs in a separate process from the main Luxd process and communi
## API
The Subnet EVM supports the following API namespaces:
The EVM supports the following API namespaces:
- `eth`
- `personal`
@@ -67,23 +67,23 @@ The Subnet EVM supports the following API namespaces:
- `debug`
Only the `eth` namespace is enabled by default.
Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/luxdefi/coreth).
EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/luxdefi/coreth).
Full documentation for the C-Chain's API can be found [here](https://docs.lux.network/apis/node/apis/c-chain).
## Compatibility
The Subnet EVM is compatible with almost all Ethereum tooling, including [Remix](https://docs.lux.network/build/dapp/smart-contracts/remix-deploy), [Metamask](https://docs.lux.network/build/dapp/chain-settings), and [Foundry](https://docs.lux.network/build/dapp/smart-contracts/toolchains/foundry).
The EVM is compatible with almost all Ethereum tooling, including [Remix](https://docs.lux.network/build/dapp/smart-contracts/remix-deploy), [Metamask](https://docs.lux.network/build/dapp/chain-settings), and [Foundry](https://docs.lux.network/build/dapp/smart-contracts/toolchains/foundry).
## Differences Between Subnet EVM and Coreth
## Differences Between EVM and Coreth
- Added configurable fees and gas limits in genesis
- Merged Lux hardforks into the single "Subnet EVM" hardfork
- Merged Lux hardforks into the single "EVM" hardfork
- Removed Atomic Txs and Shared Memory
- Removed Multicoin Contract and State
## Block Format
To support these changes, there have been a number of changes to the SubnetEVM block format compared to what exists on the C-Chain and Ethereum. Here we list the changes to the block format as compared to Ethereum.
To support these changes, there have been a number of changes to the EVM block format compared to what exists on the C-Chain and Ethereum. Here we list the changes to the block format as compared to Ethereum.
### Block Header
@@ -100,23 +100,23 @@ Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Pl
As a few software will be installed into `$GOPATH/bin`, please make sure that `$GOPATH/bin` is in your `$PATH`, otherwise, you may get error running the commands below.
Download the `subnet-evm` repository into your `$GOPATH`:
Download the `evm` repository into your `$GOPATH`:
```sh
cd $GOPATH
mkdir -p src/github.com/luxdefi
cd src/github.com/luxdefi
git clone [email protected]:luxdefi/subnet-evm.git
cd subnet-evm
git clone [email protected]:luxdefi/evm.git
cd evm
```
This will clone and checkout to `master` branch.
### Run Local Network
To run a local network, it is recommended to use the [lux-cli](https://github.com/luxdefi/lux-cli#lux-cli) to set up an instance of Subnet-EVM on an local Lux Network.
To run a local network, it is recommended to use the [lux-cli](https://github.com/luxdefi/lux-cli#lux-cli) to set up an instance of EVM on an local Lux Network.
There are two options when using the Lux-CLI:
1. Use an official Subnet-EVM release: https://docs.lux.network/subnets/build-first-subnet
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: https://docs.lux.network/subnets/create-custom-subnet
1. Use an official EVM release: https://docs.lux.network/subnets/build-first-subnet
2. Build and deploy a locally built (and optionally modified) version of EVM: https://docs.lux.network/subnets/create-custom-subnet
+1 -1
View File
@@ -16,4 +16,4 @@ Please refer to the [Bug Bounty Page](https://hackenproof.com/lux) for the most
## Supported Versions
Please use the [most recently released version](https://github.com/luxdefi/subnet-evm/releases/latest) to perform testing and to validate security issues.
Please use the [most recently released version](https://github.com/luxdefi/evm/releases/latest) to perform testing and to validate security issues.
+4 -4
View File
@@ -33,10 +33,10 @@ import (
"io"
"math/big"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/subnet-evm/accounts/external"
"github.com/luxdefi/subnet-evm/accounts/keystore"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/accounts"
"github.com/luxdefi/evm/accounts/external"
"github.com/luxdefi/evm/accounts/keystore"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
+2 -2
View File
@@ -31,8 +31,8 @@ import (
"errors"
"math/big"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
)
+17 -17
View File
@@ -34,23 +34,23 @@ import (
"sync"
"time"
"github.com/luxdefi/subnet-evm/eth"
"github.com/luxdefi/subnet-evm/vmerrs"
"github.com/luxdefi/evm/eth"
"github.com/luxdefi/evm/vmerrs"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/bloombits"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/eth/filters"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/rpc"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/bloombits"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/eth/filters"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/interfaces"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/rpc"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
@@ -650,7 +650,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call interfaces.Cal
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
}
head := b.blockchain.CurrentHeader()
if !b.blockchain.Config().IsSubnetEVM(head.Time) {
if !b.blockchain.Config().IsEVM(head.Time) {
// If there's no basefee, then it must be a non-1559 execution
if call.GasPrice == nil {
call.GasPrice = new(big.Int)
+7 -7
View File
@@ -37,12 +37,12 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
@@ -1225,7 +1225,7 @@ Example contract to test event emission:
function Call() public { emit Called(); }
}
*/
// The fork tests are commented out because transactions are not indexed in subnet-evm until they are marked
// The fork tests are commented out because transactions are not indexed in evm until they are marked
// as accepted, which breaks the logic of these tests.
// const callableAbi = "[{\"anonymous\":false,\"inputs\":[],\"name\":\"Called\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"Call\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"
+3 -3
View File
@@ -34,9 +34,9 @@ import (
"strings"
"sync"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
+4 -4
View File
@@ -34,10 +34,10 @@ import (
"strings"
"testing"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
+1 -1
View File
@@ -39,7 +39,7 @@ import (
"text/template"
"unicode"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi"
"github.com/ethereum/go-ethereum/log"
)
+77 -77
View File
@@ -282,9 +282,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -337,9 +337,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -383,9 +383,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -440,10 +440,10 @@ var bindTests = []struct {
"math/big"
"reflect"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -489,9 +489,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -555,9 +555,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -600,10 +600,10 @@ var bindTests = []struct {
[]string{`6060604052609f8060106000396000f3606060405260e060020a6000350463f97a60058114601a575b005b600060605260c0604052600d60809081527f4920646f6e27742065786973740000000000000000000000000000000000000060a052602060c0908152600d60e081905281906101009060a09080838184600060046012f15050815172ffffffffffffffffffffffffffffffffffffff1916909152505060405161012081900392509050f3`},
[]string{`[{"constant":true,"inputs":[],"name":"String","outputs":[{"name":"","type":"string"}],"type":"function"}]`},
`
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
`,
`
// Create a simulator and wrap a non-deployed contract
@@ -639,10 +639,10 @@ var bindTests = []struct {
[]string{`6080604052348015600f57600080fd5b5060888061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063d5f6622514602d575b600080fd5b6033604c565b6040805192835260208301919091528051918290030190f35b600a809156fea264697066735822beefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef64736f6c6343decafe0033`},
[]string{`[{"inputs":[],"name":"Struct","outputs":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"uint256","name":"b","type":"uint256"}],"stateMutability":"pure","type":"function"}]`},
`
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
`,
`
// Create a simulator and wrap a non-deployed contract
@@ -687,9 +687,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -736,10 +736,10 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -812,9 +812,9 @@ var bindTests = []struct {
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -905,10 +905,10 @@ var bindTests = []struct {
"math/big"
"time"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1096,9 +1096,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1231,9 +1231,9 @@ var bindTests = []struct {
"math/big"
"reflect"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
@@ -1373,9 +1373,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1439,11 +1439,11 @@ var bindTests = []struct {
"math/big"
"time"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/params"
`,
`
// Initialize test accounts
@@ -1550,10 +1550,10 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/crypto"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
`,
`
// Initialize test accounts
@@ -1613,10 +1613,10 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/crypto"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/core"
`,
`
key, _ := crypto.GenerateKey()
@@ -1675,9 +1675,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1736,9 +1736,9 @@ var bindTests = []struct {
"bytes"
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1824,9 +1824,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1893,9 +1893,9 @@ var bindTests = []struct {
`
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
`
@@ -1944,9 +1944,9 @@ var bindTests = []struct {
imports: `
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
tester: `
@@ -1991,9 +1991,9 @@ var bindTests = []struct {
imports: `
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
tester: `
@@ -2031,9 +2031,9 @@ var bindTests = []struct {
imports: `
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/ethereum/go-ethereum/crypto"
`,
tester: `
@@ -2154,7 +2154,7 @@ func golangBindings(t *testing.T, overload bool) {
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out)
}
pwd, _ := os.Getwd()
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/luxdefi/subnet-[email protected]", "-replace", "github.com/luxdefi/subnet-evm="+filepath.Join(pwd, "..", "..", "..")) // Repo root
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/luxdefi/[email protected]", "-replace", "github.com/luxdefi/evm="+filepath.Join(pwd, "..", "..", "..")) // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
+2 -2
View File
@@ -51,8 +51,8 @@ import (
"math/big"
"strings"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/vmerrs"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
)
@@ -35,9 +35,9 @@ import (
"fmt"
"strings"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/precompile/allowlist"
)
// BindedFiles contains the generated binding file contents.
@@ -35,7 +35,7 @@ import (
"strings"
"testing"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
@@ -452,8 +452,8 @@ var bindTests = []struct {
`"github.com/stretchr/testify/require"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/precompile/allowlist"
`,
`
testGreeting := "test"
@@ -587,7 +587,7 @@ func TestPrecompileBind(t *testing.T) {
t.Fatalf("failed to convert binding test to modules: %v\n%s", err, out)
}
pwd, _ := os.Getwd()
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/luxdefi/subnet-[email protected]", "-replace", "github.com/luxdefi/subnet-evm="+filepath.Join(pwd, "..", "..", "..", "..")) // Repo root
replacer := exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/luxdefi/[email protected]", "-replace", "github.com/luxdefi/evm="+filepath.Join(pwd, "..", "..", "..", "..")) // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
@@ -11,9 +11,9 @@ const tmplSourcePrecompileConfigGo = `
package {{.Package}}
import (
"github.com/luxdefi/subnet-evm/precompile/precompileconfig"
"github.com/luxdefi/evm/precompile/precompileconfig"
{{- if .Contract.AllowList}}
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/precompile/allowlist"
"github.com/ethereum/go-ethereum/common"
{{- end}}
@@ -13,11 +13,11 @@ package {{.Package}}
import (
"testing"
"github.com/luxdefi/subnet-evm/precompile/precompileconfig"
"github.com/luxdefi/subnet-evm/precompile/testutils"
"github.com/luxdefi/subnet-evm/utils"
"github.com/luxdefi/evm/precompile/precompileconfig"
"github.com/luxdefi/evm/precompile/testutils"
"github.com/luxdefi/evm/utils"
{{- if .Contract.AllowList}}
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/precompile/allowlist"
"github.com/ethereum/go-ethereum/common"
{{- end}}
@@ -2,7 +2,7 @@
// See the file LICENSE for licensing terms.
package precompilebind
import "github.com/luxdefi/subnet-evm/accounts/abi/bind"
import "github.com/luxdefi/evm/accounts/abi/bind"
// tmplPrecompileData is the data structure required to fill the binding template.
type tmplPrecompileData struct {
@@ -32,12 +32,12 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi"
{{- if .Contract.AllowList}}
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/precompile/allowlist"
{{- end}}
"github.com/luxdefi/subnet-evm/precompile/contract"
"github.com/luxdefi/subnet-evm/vmerrs"
"github.com/luxdefi/evm/precompile/contract"
"github.com/luxdefi/evm/vmerrs"
_ "embed"
@@ -14,12 +14,12 @@ import (
"testing"
"math/big"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/evm/core/state"
{{- if .Contract.AllowList}}
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/evm/precompile/allowlist"
{{- end}}
"github.com/luxdefi/subnet-evm/precompile/testutils"
"github.com/luxdefi/subnet-evm/vmerrs"
"github.com/luxdefi/evm/precompile/testutils"
"github.com/luxdefi/evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
@@ -13,9 +13,9 @@ package {{.Package}}
import (
"fmt"
"github.com/luxdefi/subnet-evm/precompile/precompileconfig"
"github.com/luxdefi/subnet-evm/precompile/contract"
"github.com/luxdefi/subnet-evm/precompile/modules"
"github.com/luxdefi/evm/precompile/precompileconfig"
"github.com/luxdefi/evm/precompile/contract"
"github.com/luxdefi/evm/precompile/modules"
"github.com/ethereum/go-ethereum/common"
)
+5 -5
View File
@@ -26,7 +26,7 @@
package bind
import "github.com/luxdefi/subnet-evm/accounts/abi"
import "github.com/luxdefi/evm/accounts/abi"
// tmplData is the data structure required to fill the binding template.
type tmplData struct {
@@ -101,10 +101,10 @@ import (
"strings"
"errors"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
)
+2 -2
View File
@@ -31,8 +31,8 @@ import (
"errors"
"time"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
+4 -4
View File
@@ -33,10 +33,10 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/backends"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/backends"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
+2 -2
View File
@@ -31,8 +31,8 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"golang.org/x/crypto/sha3"
+5 -5
View File
@@ -31,11 +31,11 @@ import (
"math/big"
"sync"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/subnet-evm/rpc"
"github.com/luxdefi/subnet-evm/signer/core/apitypes"
"github.com/luxdefi/evm/accounts"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/luxdefi/evm/rpc"
"github.com/luxdefi/evm/signer/core/apitypes"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/event"
+1 -1
View File
@@ -37,7 +37,7 @@ import (
"sync"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
mapset "github.com/deckarep/golang-set/v2"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
+1 -1
View File
@@ -36,7 +36,7 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/cespare/cp"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common"
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"strings"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/google/uuid"
+2 -2
View File
@@ -42,8 +42,8 @@ import (
"sync"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/accounts"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
+1 -1
View File
@@ -37,7 +37,7 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/event"
+1 -1
View File
@@ -47,7 +47,7 @@ import (
"os"
"path/filepath"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
+1 -1
View File
@@ -35,7 +35,7 @@ import (
"errors"
"fmt"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/ethereum/go-ethereum/crypto"
"github.com/google/uuid"
"golang.org/x/crypto/pbkdf2"
+3 -3
View File
@@ -29,9 +29,9 @@ package keystore
import (
"math/big"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/accounts"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/crypto"
)
+1 -1
View File
@@ -51,7 +51,7 @@ import (
"sync"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/evm/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
+3 -3
View File
@@ -43,9 +43,9 @@ import (
"sync"
"time"
"github.com/luxdefi/subnet-evm/accounts"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/accounts"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
+2 -2
View File
@@ -34,8 +34,8 @@ import (
"regexp"
"strings"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/internal/flags"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/internal/flags"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common/compiler"
"github.com/ethereum/go-ethereum/crypto"
+1 -1
View File
@@ -31,7 +31,7 @@ import (
"fmt"
"os"
"github.com/luxdefi/subnet-evm/cmd/evm/internal/compiler"
"github.com/luxdefi/evm/cmd/evm/internal/compiler"
"github.com/urfave/cli/v2"
)
+1 -1
View File
@@ -34,7 +34,7 @@ import (
"math/big"
"os"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
+8 -8
View File
@@ -31,14 +31,14 @@ import (
"math/big"
"os"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
+2 -2
View File
@@ -30,8 +30,8 @@ import (
"fmt"
"strings"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/tests"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/tests"
"github.com/urfave/cli/v2"
)
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"errors"
"math/big"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
+4 -4
View File
@@ -34,10 +34,10 @@ import (
"os"
"strings"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/tests"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/tests"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/log"
+11 -11
View File
@@ -36,14 +36,14 @@ import (
"path"
"strings"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/eth/tracers/logger"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/tests"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/eth/tracers/logger"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/tests"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
@@ -256,8 +256,8 @@ func Transition(ctx *cli.Context) error {
return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err))
}
// Sanity check, to not `panic` in state_transition
// NOTE: IsLondon replaced with IsSubnetEVM here
if chainConfig.IsSubnetEVM(prestate.Env.Timestamp) {
// NOTE: IsLondon replaced with IsEVM here
if chainConfig.IsEVM(prestate.Env.Timestamp) {
if prestate.Env.BaseFee != nil {
// Already set, base fee has precedent over parent base fee.
} else if prestate.Env.ParentBaseFee != nil && prestate.Env.Number != 0 {
@@ -285,7 +285,7 @@ func Transition(ctx *cli.Context) error {
// NOTE: Removed isMerged logic here.
// isMerged := chainConfig.TerminalTotalDifficulty != nil && chainConfig.TerminalTotalDifficulty.BitLen() == 0
if prestate.Env.Random != nil {
// NOTE: subnet-evm continues to return the difficulty value for the RANDOM opcode,
// NOTE: evm continues to return the difficulty value for the RANDOM opcode,
// so for testing if Random is set in the environment, we copy it to difficulty instead.
prestate.Env.Difficulty = prestate.Env.Random
}
+2 -2
View File
@@ -32,8 +32,8 @@ import (
"math/big"
"os"
"github.com/luxdefi/subnet-evm/cmd/evm/internal/t8ntool"
"github.com/luxdefi/subnet-evm/internal/flags"
"github.com/luxdefi/evm/cmd/evm/internal/t8ntool"
"github.com/luxdefi/evm/internal/flags"
"github.com/urfave/cli/v2"
)
+12 -12
View File
@@ -38,17 +38,17 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/cmd/evm/internal/compiler"
"github.com/luxdefi/subnet-evm/core"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/core/vm/runtime"
"github.com/luxdefi/subnet-evm/eth/tracers/logger"
"github.com/luxdefi/subnet-evm/internal/flags"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/cmd/evm/internal/compiler"
"github.com/luxdefi/evm/core"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/core/vm/runtime"
"github.com/luxdefi/evm/eth/tracers/logger"
"github.com/luxdefi/evm/internal/flags"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
@@ -248,7 +248,7 @@ func runCmd(ctx *cli.Context) error {
if chainConfig != nil {
runtimeConfig.ChainConfig = chainConfig
} else {
runtimeConfig.ChainConfig = params.SubnetEVMDefaultChainConfig // NOTE: Replaced AllEthashProtocolChanges with SubnetEVMDefaultChainConfig here
runtimeConfig.ChainConfig = params.EVMDefaultChainConfig // NOTE: Replaced AllEthashProtocolChanges with EVMDefaultChainConfig here
}
var hexInput []byte
+4 -4
View File
@@ -32,10 +32,10 @@ import (
"fmt"
"os"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/eth/tracers/logger"
"github.com/luxdefi/subnet-evm/tests"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/eth/tracers/logger"
"github.com/luxdefi/evm/tests"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli/v2"
+5 -5
View File
@@ -34,8 +34,8 @@ import (
"strings"
"testing"
"github.com/luxdefi/subnet-evm/cmd/evm/internal/t8ntool"
"github.com/luxdefi/subnet-evm/internal/cmdtest"
"github.com/luxdefi/evm/cmd/evm/internal/t8ntool"
"github.com/luxdefi/evm/internal/cmdtest"
"github.com/docker/docker/pkg/reexec"
)
@@ -256,7 +256,7 @@ func TestT8n(t *testing.T) {
// expExitCode: 3,
// },
// NOTE: this test was modified to test a non-trivial calculation
// of dynamic Subnet-EVM fees (instead of the original EIP-1559
// of dynamic EVM fees (instead of the original EIP-1559
// [misc.CalcBaseFee] calculation).
{ // Test base fee calculation
base: "./testdata/25",
@@ -478,7 +478,7 @@ func TestB11r(t *testing.T) {
},
expOut: "exp.json",
},
// NOTE: we ignore these tests since subnet-evm does not do
// NOTE: we ignore these tests since evm does not do
// ethash or clique sealing.
// { // ethash test seal
// base: "./testdata/21",
@@ -556,7 +556,7 @@ func cmpJson(a, b []byte) (bool, error) {
if err := json.Unmarshal(b, &j2); err != nil {
return false, err
}
// NOTE: In subnet-evm the difficulty for each block is 1 where in go-ethereum
// NOTE: In evm the difficulty for each block is 1 where in go-ethereum
// (pre-merge) this depends on the block. We ignore this field to avoid having
// to modify all the test inputs.
ignoreKeys := []string{"currentDifficulty"}
+1 -1
View File
@@ -1,4 +1,4 @@
State root differs because of SubnetEVM's fee calculations.
State root differs because of EVM's fee calculations.
--- a/cmd/evm/testdata/13/exp2.json 2023-08-25 07:34:20
+++ b/cmd/evm/testdata/13/exp2.json 2023-08-24 14:17:32
+1 -1
View File
@@ -1,4 +1,4 @@
State root and balance differ because of SubnetEVM's fee calculations.
State root and balance differ because of EVM's fee calculations.
CurrentDifficulty is 0 instead of null because the test overrides the
difficulty if currentRandom is provided in the environment.
+1 -1
View File
@@ -1,4 +1,4 @@
State root and balance differ because of SubnetEVM's fee calculations.
State root and balance differ because of EVM's fee calculations.
CurrentDifficulty is 0xdeadc0de instead of null because the test overrides the
difficulty if currentRandom is provided in the environment.
+4 -4
View File
@@ -35,9 +35,9 @@ import (
_ "embed"
"github.com/luxdefi/subnet-evm/accounts/abi/bind"
"github.com/luxdefi/subnet-evm/accounts/abi/bind/precompilebind"
"github.com/luxdefi/subnet-evm/internal/flags"
"github.com/luxdefi/evm/accounts/abi/bind"
"github.com/luxdefi/evm/accounts/abi/bind/precompilebind"
"github.com/luxdefi/evm/internal/flags"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli/v2"
@@ -66,7 +66,7 @@ var (
}
)
var app = flags.NewApp("subnet-evm precompile generator tool")
var app = flags.NewApp("evm precompile generator tool")
func init() {
app.Name = "precompilegen"
+3 -3
View File
@@ -1,13 +1,13 @@
# Load Simulator
When building developing your own blockchain using `subnet-evm`, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed `cmd/simulator`. `cmd/simulator` lets you drive arbitrary load across any number of [endpoints] with a user-specified `keys` directory (insecure) `timeout`, `workers`, `max-fee-cap`, and `max-tip-cap`.
When building developing your own blockchain using `evm`, you may want to analyze how your fee parameterization behaves and/or how many resources your VM uses under different load patterns. For this reason, we developed `cmd/simulator`. `cmd/simulator` lets you drive arbitrary load across any number of [endpoints] with a user-specified `keys` directory (insecure) `timeout`, `workers`, `max-fee-cap`, and `max-tip-cap`.
## Building the Load Simulator
To build the load simulator, navigate to the base of the simulator directory:
```bash
cd $GOPATH/src/github.com/luxdefi/subnet-evm/cmd/simulator
cd $GOPATH/src/github.com/luxdefi/evm/cmd/simulator
```
Build the simulator:
@@ -28,7 +28,7 @@ This should give the following output:
v0.1.0
```
To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and Subnet-EVM, so we will start a single node network and run the load simulator on the C-Chain.
To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and EVM, so we will start a single node network and run the load simulator on the C-Chain.
To start a single node network, follow the instructions from the Luxd [README](https://github.com/luxdefi/node#building-node) to build from source.
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/luxdefi/subnet-evm/cmd/simulator
module github.com/luxdefi/evm/cmd/simulator
go 1.18
+6 -6
View File
@@ -9,12 +9,12 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/cmd/simulator/key"
"github.com/luxdefi/subnet-evm/cmd/simulator/metrics"
"github.com/luxdefi/subnet-evm/cmd/simulator/txs"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethclient"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/cmd/simulator/key"
"github.com/luxdefi/evm/cmd/simulator/metrics"
"github.com/luxdefi/evm/cmd/simulator/txs"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethclient"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
+7 -7
View File
@@ -14,13 +14,13 @@ import (
"syscall"
"time"
"github.com/luxdefi/subnet-evm/cmd/simulator/config"
"github.com/luxdefi/subnet-evm/cmd/simulator/key"
"github.com/luxdefi/subnet-evm/cmd/simulator/metrics"
"github.com/luxdefi/subnet-evm/cmd/simulator/txs"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethclient"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/cmd/simulator/config"
"github.com/luxdefi/evm/cmd/simulator/key"
"github.com/luxdefi/evm/cmd/simulator/metrics"
"github.com/luxdefi/evm/cmd/simulator/txs"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethclient"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"fmt"
"time"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethclient"
"github.com/luxdefi/subnet-evm/interfaces"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethclient"
"github.com/luxdefi/evm/interfaces"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
+2 -2
View File
@@ -13,7 +13,7 @@ import (
"syscall"
"time"
"github.com/luxdefi/subnet-evm/cmd/simulator/worker"
"github.com/luxdefi/evm/cmd/simulator/worker"
"github.com/spf13/cobra"
)
@@ -53,7 +53,7 @@ var (
func newCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "simulator",
Short: "Load simulator for subnet-evm + C-chain",
Short: "Load simulator for evm + C-chain",
SuggestFor: []string{"simulators"},
Run: runFunc,
}
+2 -2
View File
@@ -9,8 +9,8 @@ import (
"fmt"
"os"
"github.com/luxdefi/subnet-evm/cmd/simulator/config"
"github.com/luxdefi/subnet-evm/cmd/simulator/load"
"github.com/luxdefi/evm/cmd/simulator/config"
"github.com/luxdefi/evm/cmd/simulator/load"
"github.com/ethereum/go-ethereum/log"
"github.com/spf13/pflag"
)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"fmt"
"time"
"github.com/luxdefi/subnet-evm/cmd/simulator/metrics"
"github.com/luxdefi/evm/cmd/simulator/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
)
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"crypto/ecdsa"
"fmt"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethclient"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethclient"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
)
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"math/rand"
"time"
"github.com/luxdefi/subnet-evm/cmd/simulator/key"
"github.com/luxdefi/subnet-evm/cmd/simulator/metrics"
"github.com/luxdefi/evm/cmd/simulator/key"
"github.com/luxdefi/evm/cmd/simulator/metrics"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/utils"
"github.com/luxdefi/evm/utils"
"github.com/ethereum/go-ethereum/common"
)
+4 -4
View File
@@ -30,10 +30,10 @@ package consensus
import (
"math/big"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
)
+6 -6
View File
@@ -1,10 +1,10 @@
# Consensus
Disclaimer: the consensus package in subnet-evm is a complete misnomer.
Disclaimer: the consensus package in evm is a complete misnomer.
The consensus package in go-ethereum handles block validation and specifically handles validating the PoW portion of consensus - thus the name.
Since Luxd handles consensus for Subnet-EVM, Subnet-EVM is just the VM, but we keep the consensus package in place to handle part of the block verification process.
Since Luxd handles consensus for EVM, EVM is just the VM, but we keep the consensus package in place to handle part of the block verification process.
## Block Verification
@@ -12,17 +12,17 @@ The dummy consensus engine is responsible for performing verification on the hea
## Dynamic Fees
Subnet-EVM includes a dynamic fee algorithm based off of (EIP-1559)[https://eips.ethereum.org/EIPS/eip-1559]. This introduces a field to the block type called `BaseFee`. The Base Fee sets a minimum gas price for any transaction to be included in the block. For example, a transaction with a gas price of 49 gwei, will be invalid to include in a block with a base fee of 50 gwei.
EVM includes a dynamic fee algorithm based off of (EIP-1559)[https://eips.ethereum.org/EIPS/eip-1559]. This introduces a field to the block type called `BaseFee`. The Base Fee sets a minimum gas price for any transaction to be included in the block. For example, a transaction with a gas price of 49 gwei, will be invalid to include in a block with a base fee of 50 gwei.
The dynamic fee algorithm aims to adjust the base fee to handle network congestion. Subnet-EVM sets a target utilization on the network, and the dynamic fee algorithm adjusts the base fee accordingly. If the network operates above the target utilization, the dynamic fee algorithm will increase the base fee to make utilizing he network more expensive and bring overall utilization down. If the network operates below the target utilization, the dynamic fee algorithm will decrease the base fee to make it cheaper to use the network.
The dynamic fee algorithm aims to adjust the base fee to handle network congestion. EVM sets a target utilization on the network, and the dynamic fee algorithm adjusts the base fee accordingly. If the network operates above the target utilization, the dynamic fee algorithm will increase the base fee to make utilizing he network more expensive and bring overall utilization down. If the network operates below the target utilization, the dynamic fee algorithm will decrease the base fee to make it cheaper to use the network.
- EIP-1559 is intended for Ethereum where a block is produced roughly every 10s
- The dynamic fee algorithm needs to handle the case that the network quiesces and there are no blocks for a long period of time
- Since Subnet-EVM produces blocks at a different cadence, it adapts EIP-1559 to sum the amount of gas consumed within a 10 second interval instead of using only the amount of gas consumed in the parent block
- Since EVM produces blocks at a different cadence, it adapts EIP-1559 to sum the amount of gas consumed within a 10 second interval instead of using only the amount of gas consumed in the parent block
## Consensus Engine Callbacks
The consensus engine is called while blocks are being both built and processed and Subnet-EVM adds callback functions into the dummy consensus engine to insert its own logic into these stages.
The consensus engine is called while blocks are being both built and processed and EVM adds callback functions into the dummy consensus engine to insert its own logic into these stages.
### FinalizeAndAssemble
+14 -14
View File
@@ -11,12 +11,12 @@ import (
"time"
"github.com/luxdefi/node/utils/timer/mockable"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/subnet-evm/vmerrs"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/luxdefi/evm/vmerrs"
"github.com/ethereum/go-ethereum/common"
)
@@ -124,7 +124,7 @@ func (self *DummyEngine) verifyHeaderGasFields(config *params.ChainConfig, heade
if err != nil {
return err
}
if config.IsSubnetEVM(header.Time) {
if config.IsEVM(header.Time) {
expectedGasLimit := feeConfig.GasLimit.Uint64()
if header.GasLimit != expectedGasLimit {
return fmt.Errorf("expected gas limit to be %d, but found %d", expectedGasLimit, header.GasLimit)
@@ -140,7 +140,7 @@ func (self *DummyEngine) verifyHeaderGasFields(config *params.ChainConfig, heade
if uint64(diff) >= limit || header.GasLimit < params.MinGasLimit {
return fmt.Errorf("invalid gas limit: have %d, want %d += %d", header.GasLimit, parent.GasLimit, limit)
}
// Verify BaseFee is not present before Subnet EVM
// Verify BaseFee is not present before EVM
if header.BaseFee != nil {
return fmt.Errorf("invalid baseFee before fork: have %d, want <nil>", header.BaseFee)
}
@@ -151,7 +151,7 @@ func (self *DummyEngine) verifyHeaderGasFields(config *params.ChainConfig, heade
}
// Verify baseFee and rollupWindow encoding as part of header verification
// starting in Subnet EVM
// starting in EVM
expectedRollupWindowBytes, expectedBaseFee, err := CalcBaseFee(config, feeConfig, parent, header.Time)
if err != nil {
return fmt.Errorf("failed to calculate base fee: %w", err)
@@ -202,7 +202,7 @@ func (self *DummyEngine) verifyHeader(chain consensus.ChainHeaderReader, header
if len(header.Extra) < params.DynamicFeeExtraDataSize {
return fmt.Errorf("expected extra-data field length >= %d, found %d", params.DynamicFeeExtraDataSize, len(header.Extra))
}
case config.IsSubnetEVM(header.Time):
case config.IsEVM(header.Time):
if len(header.Extra) != params.DynamicFeeExtraDataSize {
return fmt.Errorf("expected extra-data field to be: %d, but found %d", params.DynamicFeeExtraDataSize, len(header.Extra))
}
@@ -288,10 +288,10 @@ func (self *DummyEngine) verifyBlockFee(
return nil
}
if baseFee == nil || baseFee.Sign() <= 0 {
return fmt.Errorf("invalid base fee (%d) in SubnetEVM", baseFee)
return fmt.Errorf("invalid base fee (%d) in EVM", baseFee)
}
if requiredBlockGasCost == nil || !requiredBlockGasCost.IsUint64() {
return fmt.Errorf("invalid block gas cost (%d) in SubnetEVM", requiredBlockGasCost)
return fmt.Errorf("invalid block gas cost (%d) in EVM", requiredBlockGasCost)
}
var (
@@ -338,7 +338,7 @@ func (self *DummyEngine) verifyBlockFee(
}
func (self *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *types.Block, parent *types.Header, state *state.StateDB, receipts []*types.Receipt) error {
if chain.Config().IsSubnetEVM(block.Time()) {
if chain.Config().IsEVM(block.Time()) {
// we use the parent to determine the fee config
// since the current block has not been finalized yet.
feeConfig, _, err := chain.GetFeeConfigAt(parent)
@@ -377,7 +377,7 @@ func (self *DummyEngine) Finalize(chain consensus.ChainHeaderReader, block *type
func (self *DummyEngine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, parent *types.Header, state *state.StateDB, txs []*types.Transaction,
uncles []*types.Header, receipts []*types.Receipt,
) (*types.Block, error) {
if chain.Config().IsSubnetEVM(header.Time) {
if chain.Config().IsEVM(header.Time) {
// we use the parent to determine the fee config
// since the current block has not been finalized yet.
feeConfig, _, err := chain.GetFeeConfigAt(parent)
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"math/big"
"testing"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
)
+8 -8
View File
@@ -9,9 +9,9 @@ import (
"math/big"
"github.com/luxdefi/node/utils/wrappers"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
)
@@ -22,10 +22,10 @@ import (
func CalcBaseFee(config *params.ChainConfig, feeConfig commontype.FeeConfig, parent *types.Header, timestamp uint64) ([]byte, *big.Int, error) {
// If the current block is the first EIP-1559 block, or it is the genesis block
// return the initial slice and initial base fee.
isSubnetEVM := config.IsSubnetEVM(parent.Time)
isEVM := config.IsEVM(parent.Time)
extraDataSize := params.DynamicFeeExtraDataSize
if !isSubnetEVM || parent.Number.Cmp(common.Big0) == 0 {
if !isEVM || parent.Number.Cmp(common.Big0) == 0 {
initialSlice := make([]byte, extraDataSize)
return initialSlice, feeConfig.MinBaseFee, nil
}
@@ -213,7 +213,7 @@ func calcBlockGasCost(
parentBlockGasCost *big.Int,
parentTime, currentTime uint64,
) *big.Int {
// Handle Subnet EVM boundary by returning the minimum value as the boundary.
// Handle EVM boundary by returning the minimum value as the boundary.
if parentBlockGasCost == nil {
return new(big.Int).Set(minBlockGasCost)
}
@@ -248,9 +248,9 @@ func calcBlockGasCost(
// correctness check performed is that the sum of all tips is >= the
// required block fee.
//
// This function will return nil for all return values prior to Subnet EVM.
// This function will return nil for all return values prior to EVM.
func MinRequiredTip(config *params.ChainConfig, header *types.Header) (*big.Int, error) {
if !config.IsSubnetEVM(header.Time) {
if !config.IsEVM(header.Time) {
return nil, nil
}
if header.BaseFee == nil {
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"math/big"
"testing"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/assert"
+1 -1
View File
@@ -19,7 +19,7 @@ package misc
import (
"math/big"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/params"
)
var (
+1 -1
View File
@@ -21,7 +21,7 @@ import (
"math/big"
"testing"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/params"
)
func TestCalcBlobFee(t *testing.T) {
+10 -10
View File
@@ -1,4 +1,4 @@
# Subnet EVM Contracts
# EVM Contracts
CONTRACTS HERE ARE [ALPHA SOFTWARE](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha) AND ARE NOT AUDITED. USE AT YOUR OWN RISK!
@@ -6,9 +6,9 @@ CONTRACTS HERE ARE [ALPHA SOFTWARE](https://en.wikipedia.org/wiki/Software_relea
Lux is an open-source platform for launching decentralized applications and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Lux gives you complete control on both the network and application layers&mdash;helping you build anything you can imagine.
The Lux Network is composed of many subnets and chains. Chains in subnets run with customizable virtual machines. One of these virtual machines is Subnet EVM. The Subnet EVM's API is almost identical to an Ethereum node's API. Subnet EVM brings its own features like minting native tokens via contracts, restrincting contract deployer etc. These features are presented with `Stateful Precompile Contracts`. These contracts are precompiled and deployed when they're activated.
The Lux Network is composed of many subnets and chains. Chains in subnets run with customizable virtual machines. One of these virtual machines is EVM. The EVM's API is almost identical to an Ethereum node's API. EVM brings its own features like minting native tokens via contracts, restrincting contract deployer etc. These features are presented with `Stateful Precompile Contracts`. These contracts are precompiled and deployed when they're activated.
The goal of this guide is to lay out best practices regarding writing, testing and deployment of smart contracts to Lux's Subnet EVM. We'll be building smart contracts with development environment [Hardhat](https://hardhat.org).
The goal of this guide is to lay out best practices regarding writing, testing and deployment of smart contracts to Lux's EVM. We'll be building smart contracts with development environment [Hardhat](https://hardhat.org).
## Prerequisites
@@ -31,7 +31,7 @@ It is also helpful to have a basic understanding of [Solidity](https://docs.soli
Clone the repo and install the necessary packages via `yarn`.
```zsh
$ git clone https://github.com/luxdefi/subnet-evm.git
$ git clone https://github.com/luxdefi/evm.git
$ cd contract-examples
$ yarn
```
@@ -40,7 +40,7 @@ $ yarn
`AllowList.sol` is the base contract which provided AllowList precompile capabilities to inheriting contracts.
`ERC20NativeMinter.sol` is based on [Open Zeppelin](https://openzeppelin.com) [ERC20](https://eips.ethereum.org/EIPS/eip-20) contract powered by native minting capabilities of Subnet EVM. ERC20 is a popular smart contract interface. It uses `INativeMinter` interface to interact with `NativeMinter` precompile.
`ERC20NativeMinter.sol` is based on [Open Zeppelin](https://openzeppelin.com) [ERC20](https://eips.ethereum.org/EIPS/eip-20) contract powered by native minting capabilities of EVM. ERC20 is a popular smart contract interface. It uses `INativeMinter` interface to interact with `NativeMinter` precompile.
`ExampleDeployerList` shows how `ContractDeployerAllowList` precompile can be used in a smart contract. It uses `IAllowList` to interact with `ContractDeployerAllowList` precompile. When the precompile is activated only those allowed can deploy contracts.
@@ -48,13 +48,13 @@ $ yarn
All of these `NativeMinter`, `FeeManager` and `AllowList` contracts should be enabled by a chain config in genesis or as an upgrade. See the example genesis under [Tests](#tests) section.
For more information about precompiles see [subnet-evm precompiles](https://github.com/luxdefi/subnet-evm#precompiles).
For more information about precompiles see [evm precompiles](https://github.com/luxdefi/evm#precompiles).
## Hardhat Config
Hardhat uses `hardhat.config.js` as the configuration file. You can define tasks, networks, compilers and more in that file. For more information see [here](https://hardhat.org/config/).
In Subnet-EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/luxdefi/lux-smart-contract-quickstart/blob/main/hardhat.config.ts).
In EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/luxdefi/lux-smart-contract-quickstart/blob/main/hardhat.config.ts).
The HardHat config file includes a single network configuration: `local`. `local` defaults to using the following values for the RPC URL and the Chain ID:
@@ -63,7 +63,7 @@ var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc"
var local_chain_id = process.env.CHAIN_ID || 99999
```
You can use this network configuration by providing the environment variables and specifying the `--network` flag, as Subnet-EVM does in its testing suite:
You can use this network configuration by providing the environment variables and specifying the `--network` flag, as EVM does in its testing suite:
```bash
RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local
@@ -107,11 +107,11 @@ You can define custom hardhat tasks in [tasks.ts](https://github.com/luxdefi/lux
## Tests
Tests are written for a local network which runs a Subnet-EVM Blockchain.
Tests are written for a local network which runs a EVM Blockchain.
E.g `RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local`.
Subnet-EVM must activate any precompiles used in the test in the genesis:
EVM must activate any precompiles used in the test in the genesis:
```json
{
+1 -1
View File
@@ -1,7 +1,7 @@
import "@nomiclabs/hardhat-waffle"
import "./tasks.ts"
// HardHat users must populate these environment variables in order to connect to their subnet-evm instance
// HardHat users must populate these environment variables in order to connect to their evm instance
// Since the blockchainID is not known in advance, there's no good default to use and we use the C-Chain here.
var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc"
var local_chain_id = process.env.CHAIN_ID || 99999
+2 -2
View File
@@ -1,5 +1,5 @@
{
"name": "subnet-evm-contracts",
"name": "evm-contracts",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
@@ -20,7 +20,7 @@
"version": "1.0.0",
"description": "",
"main": "index.js",
"repository": "https://github.com/luxdefi/subnet-evm-contracts",
"repository": "https://github.com/luxdefi/evm-contracts",
"license": "BSD-3-Clause",
"scripts": {
"compile": "npx hardhat compile",
+10 -10
View File
@@ -1,4 +1,4 @@
# Subnet EVM Contracts
# EVM Contracts
CONTRACTS HERE ARE [ALPHA SOFTWARE](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha) AND ARE NOT AUDITED. USE AT YOUR OWN RISK!
@@ -6,9 +6,9 @@ CONTRACTS HERE ARE [ALPHA SOFTWARE](https://en.wikipedia.org/wiki/Software_relea
Lux is an open-source platform for launching decentralized applications and enterprise blockchain deployments in one interoperable, highly scalable ecosystem. Lux gives you complete control on both the network and application layers&mdash;helping you build anything you can imagine.
The Lux Network is composed of many subnets and chains. Chains in subnets run with customizable virtual machines. One of these virtual machines is Subnet EVM. The Subnet EVM's API is almost identical to an Ethereum node's API. Subnet EVM brings its own features like minting native tokens via contracts, restrincting contract deployer etc. These features are presented with `Stateful Precompile Contracts`. These contracts are precompiled and deployed when they're activated.
The Lux Network is composed of many subnets and chains. Chains in subnets run with customizable virtual machines. One of these virtual machines is EVM. The EVM's API is almost identical to an Ethereum node's API. EVM brings its own features like minting native tokens via contracts, restrincting contract deployer etc. These features are presented with `Stateful Precompile Contracts`. These contracts are precompiled and deployed when they're activated.
The goal of this guide is to lay out best practices regarding writing, testing and deployment of smart contracts to Lux's Subnet EVM. We'll be building smart contracts with development environment [Hardhat](https://hardhat.org).
The goal of this guide is to lay out best practices regarding writing, testing and deployment of smart contracts to Lux's EVM. We'll be building smart contracts with development environment [Hardhat](https://hardhat.org).
## Prerequisites
@@ -25,7 +25,7 @@ It is also helpful to have a basic understanding of [Solidity](https://docs.soli
Clone the repo and install the necessary packages via `yarn`.
```bash
git clone https://github.com/luxdefi/subnet-evm.git
git clone https://github.com/luxdefi/evm.git
cd contracts
npm install
```
@@ -34,7 +34,7 @@ npm install
`AllowList.sol` is the base contract which provided AllowList precompile capabilities to inheriting contracts.
`ERC20NativeMinter.sol` is based on [Open Zeppelin](https://openzeppelin.com) [ERC20](https://eips.ethereum.org/EIPS/eip-20) contract powered by native minting capabilities of Subnet EVM. ERC20 is a popular smart contract interface. It uses `INativeMinter` interface to interact with `NativeMinter` precompile.
`ERC20NativeMinter.sol` is based on [Open Zeppelin](https://openzeppelin.com) [ERC20](https://eips.ethereum.org/EIPS/eip-20) contract powered by native minting capabilities of EVM. ERC20 is a popular smart contract interface. It uses `INativeMinter` interface to interact with `NativeMinter` precompile.
`ExampleDeployerList` shows how `ContractDeployerAllowList` precompile can be used in a smart contract. It uses `IAllowList` to interact with `ContractDeployerAllowList` precompile. When the precompile is activated only those allowed can deploy contracts.
@@ -42,13 +42,13 @@ npm install
All of these `NativeMinter`, `FeeManager` and `AllowList` contracts should be enabled by a chain config in genesis or as an upgrade. See the example genesis under [Tests](#tests) section.
For more information about precompiles see [subnet-evm precompiles](https://github.com/luxdefi/subnet-evm#precompiles).
For more information about precompiles see [evm precompiles](https://github.com/luxdefi/evm#precompiles).
## Hardhat Config
Hardhat uses `hardhat.config.js` as the configuration file. You can define tasks, networks, compilers and more in that file. For more information see [here](https://hardhat.org/config/).
In Subnet-EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/luxdefi/subnet-evm/blob/master/contracts/hardhat.config.ts).
In EVM, we provide a pre-configured file [hardhat.config.ts](https://github.com/luxdefi/evm/blob/master/contracts/hardhat.config.ts).
The HardHat config file includes a single network configuration: `local`. `local` defaults to using the following values for the RPC URL and the Chain ID:
@@ -57,7 +57,7 @@ var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc";
var local_chain_id = process.env.CHAIN_ID || 99999;
```
You can use this network configuration by providing the environment variables and specifying the `--network` flag, as Subnet-EVM does in its testing suite:
You can use this network configuration by providing the environment variables and specifying the `--network` flag, as EVM does in its testing suite:
```bash
RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local
@@ -101,11 +101,11 @@ You can define custom hardhat tasks in [tasks.ts](https://github.com/luxdefi/lux
## Tests
Tests are written for a local network which runs a Subnet-EVM Blockchain.
Tests are written for a local network which runs a EVM Blockchain.
E.g `RPC_URI=http://127.0.0.1:9650/ext/bc/28N1Tv5CZziQ3FKCaXmo8xtxoFtuoVA6NvZykAT5MtGjF4JkGs/rpc CHAIN_ID=77777 npx hardhat test --network local`.
Subnet-EVM must activate any precompiles used in the test in the genesis:
EVM must activate any precompiles used in the test in the genesis:
```json
{
+1 -1
View File
@@ -2,7 +2,7 @@ import "@nomiclabs/hardhat-waffle"
import "@nomiclabs/hardhat-ethers"
import "./tasks"
// HardHat users must populate these environment variables in order to connect to their subnet-evm instance
// HardHat users must populate these environment variables in order to connect to their evm instance
// Since the blockchainID is not known in advance, there's no good default to use and we use the C-Chain here.
var local_rpc_uri = process.env.RPC_URI || "http://127.0.0.1:9650/ext/bc/C/rpc"
var local_chain_id = parseInt(process.env.CHAIN_ID, 10) || 99999
+2 -2
View File
@@ -1,11 +1,11 @@
{
"name": "@avalabs/subnet-evm-contracts",
"name": "@avalabs/evm-contracts",
"version": "1.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@avalabs/subnet-evm-contracts",
"name": "@avalabs/evm-contracts",
"version": "1.1.0",
"license": "BSD-3-Clause",
"dependencies": {
+2 -2
View File
@@ -1,5 +1,5 @@
{
"name": "@avalabs/subnet-evm-contracts",
"name": "@avalabs/evm-contracts",
"devDependencies": {
"@types/chai": "^4.3.5",
"@types/mocha": "^9.0.0",
@@ -14,7 +14,7 @@
"module": "dist/index.js",
"repository": {
"type": "git",
"url": "https://github.com/luxdefi/subnet-evm.git",
"url": "https://github.com/luxdefi/evm.git",
"directory": "contracts"
},
"license": "BSD-3-Clause",
+1 -1
View File
@@ -10,7 +10,7 @@ When the consensus engine verifies blocks as they are ready to be issued into co
InsertBlockManual verifies the block, inserts it into the state manager to track the merkle trie for the block, and adds it to the canonical chain if it extends the currently preferred chain.
Subnet-EVM adds functions for Accept and Reject, which take care of marking a block as finalized and performing garbage collection where possible.
EVM adds functions for Accept and Reject, which take care of marking a block as finalized and performing garbage collection where possible.
The consensus engine can also call `SetPreference` on a VM to tell the VM that a specific block is preferred by the consensus engine to be accepted. This triggers a call to `reorg` the blockchain and set the newly preferred block as the preferred chain.
+7 -7
View File
@@ -31,13 +31,13 @@ import (
"math/big"
"testing"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/constants"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/constants"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
+5 -5
View File
@@ -29,11 +29,11 @@ package core
import (
"fmt"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
)
// BlockValidator is responsible for validating block headers, uncles and
+12 -12
View File
@@ -39,18 +39,18 @@ import (
"sync/atomic"
"time"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/state/snapshot"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/internal/version"
"github.com/luxdefi/subnet-evm/metrics"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/state/snapshot"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/internal/version"
"github.com/luxdefi/evm/metrics"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/lru"
"github.com/ethereum/go-ethereum/event"
+1 -1
View File
@@ -33,7 +33,7 @@ import (
"fmt"
"sync"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
)
type blockAndState struct {
+6 -6
View File
@@ -8,12 +8,12 @@ import (
"strings"
"testing"
"github.com/luxdefi/subnet-evm/accounts/abi"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/accounts/abi"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/stretchr/testify/require"
+13 -13
View File
@@ -29,18 +29,18 @@ package core
import (
"math/big"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/constants"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/state/snapshot"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/precompile/contracts/feemanager"
"github.com/luxdefi/subnet-evm/precompile/contracts/rewardmanager"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/constants"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/state/snapshot"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/precompile/contracts/feemanager"
"github.com/luxdefi/evm/precompile/contracts/rewardmanager"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
)
@@ -384,7 +384,7 @@ func (bc *BlockChain) GetFeeConfigAt(parent *types.Header) (commontype.FeeConfig
// If fee recipients are allowed, returns true in the second return value.
func (bc *BlockChain) GetCoinbaseAt(parent *types.Header) (common.Address, bool, error) {
config := bc.Config()
if !config.IsSubnetEVM(parent.Time) {
if !config.IsEVM(parent.Time) {
return constants.BlackholeAddr, false, nil
}
+5 -5
View File
@@ -34,11 +34,11 @@ import (
"math/big"
"testing"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
)
+1 -1
View File
@@ -32,7 +32,7 @@ package core
import (
"testing"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
)
// verifyNoGaps checks that there are no gaps after the initial set of blocks in
+7 -7
View File
@@ -37,13 +37,13 @@ import (
"strings"
"testing"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
)
+10 -10
View File
@@ -10,15 +10,15 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/state/pruner"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/eth/tracers/logger"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/state/pruner"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/eth/tracers/logger"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/fsnotify/fsnotify"
@@ -880,7 +880,7 @@ func TestTxLookupBlockChain(t *testing.T) {
func TestCreateThenDeletePreByzantium(t *testing.T) {
// We want to use pre-byzantium rules where we have intermediate state roots
// between transactions.
config := *params.TestPreSubnetEVMConfig
config := *params.TestPreEVMConfig
config.ByzantiumBlock = nil
config.ConstantinopleBlock = nil
config.PetersburgBlock = nil
+4 -4
View File
@@ -20,10 +20,10 @@ import (
"context"
"time"
"github.com/luxdefi/subnet-evm/core/bloombits"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/evm/core/bloombits"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethdb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/bitutil"
)
+1 -1
View File
@@ -29,7 +29,7 @@ package bloombits
import (
"errors"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
)
var (
+1 -1
View File
@@ -32,7 +32,7 @@ import (
"math/rand"
"testing"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
)
// Tests that batched bloom bits are correctly rotated from the input bloom
+3 -3
View File
@@ -34,9 +34,9 @@ import (
"sync/atomic"
"time"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethdb"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
+2 -2
View File
@@ -35,8 +35,8 @@ import (
"testing"
"time"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
)
+12 -12
View File
@@ -30,17 +30,17 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/commontype"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/constants"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/commontype"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/constants"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/common"
)
@@ -336,7 +336,7 @@ func makeHeader(chain consensus.ChainReader, config *params.ChainConfig, parent
Time: time,
}
if chain.Config().IsSubnetEVM(time) {
if chain.Config().IsEVM(time) {
feeConfig, _, err := chain.GetFeeConfigAt(parent.Header())
if err != nil {
panic(err)
+5 -5
View File
@@ -30,11 +30,11 @@ import (
"fmt"
"math/big"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
+1 -1
View File
@@ -29,7 +29,7 @@ package core
import (
"errors"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
)
var (
+1 -1
View File
@@ -27,7 +27,7 @@
package core
import (
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/evm/core/types"
"github.com/ethereum/go-ethereum/common"
)
+4 -4
View File
@@ -29,10 +29,10 @@ package core
import (
"math/big"
"github.com/luxdefi/subnet-evm/consensus"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/predicate"
"github.com/luxdefi/evm/consensus"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/predicate"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
//"github.com/ethereum/go-ethereum/log"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"errors"
"math/big"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/evm/params"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
+7 -7
View File
@@ -36,12 +36,12 @@ import (
"math/big"
"time"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/trie"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
@@ -326,7 +326,7 @@ func (g *Genesis) toBlock(db ethdb.Database, triedb *trie.Database) *types.Block
if g.Difficulty == nil {
head.Difficulty = params.GenesisDifficulty
}
if g.Config != nil && g.Config.IsSubnetEVM(0) {
if g.Config != nil && g.Config.IsEVM(0) {
if g.BaseFee != nil {
head.BaseFee = g.BaseFee
} else {
+17 -17
View File
@@ -32,17 +32,17 @@ import (
"reflect"
"testing"
"github.com/luxdefi/subnet-evm/consensus/dummy"
"github.com/luxdefi/subnet-evm/core/rawdb"
"github.com/luxdefi/subnet-evm/core/state"
"github.com/luxdefi/subnet-evm/core/types"
"github.com/luxdefi/subnet-evm/core/vm"
"github.com/luxdefi/subnet-evm/ethdb"
"github.com/luxdefi/subnet-evm/params"
"github.com/luxdefi/subnet-evm/precompile/allowlist"
"github.com/luxdefi/subnet-evm/precompile/contracts/deployerallowlist"
"github.com/luxdefi/subnet-evm/trie"
"github.com/luxdefi/subnet-evm/utils"
"github.com/luxdefi/evm/consensus/dummy"
"github.com/luxdefi/evm/core/rawdb"
"github.com/luxdefi/evm/core/state"
"github.com/luxdefi/evm/core/types"
"github.com/luxdefi/evm/core/vm"
"github.com/luxdefi/evm/ethdb"
"github.com/luxdefi/evm/params"
"github.com/luxdefi/evm/precompile/allowlist"
"github.com/luxdefi/evm/precompile/contracts/deployerallowlist"
"github.com/luxdefi/evm/trie"
"github.com/luxdefi/evm/utils"
"github.com/davecgh/go-spew/spew"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
@@ -62,8 +62,8 @@ func TestGenesisBlockForTesting(t *testing.T) {
}
func TestSetupGenesis(t *testing.T) {
preSubnetConfig := *params.TestPreSubnetEVMConfig
preSubnetConfig.SubnetEVMTimestamp = utils.NewUint64(100)
preSubnetConfig := *params.TestPreEVMConfig
preSubnetConfig.EVMTimestamp = utils.NewUint64(100)
var (
customghash = common.HexToHash("0x4a12fe7bf8d40d152d7e9de22337b115186a4662aa3a97217b36146202bbfc66")
customg = Genesis{
@@ -77,7 +77,7 @@ func TestSetupGenesis(t *testing.T) {
)
rollbackpreSubnetConfig := preSubnetConfig
rollbackpreSubnetConfig.SubnetEVMTimestamp = utils.NewUint64(90)
rollbackpreSubnetConfig.EVMTimestamp = utils.NewUint64(90)
oldcustomg.Config = &rollbackpreSubnetConfig
tests := []struct {
name string
@@ -123,8 +123,8 @@ func TestSetupGenesis(t *testing.T) {
{
name: "incompatible config for lux fork in DB",
fn: func(db ethdb.Database) (*params.ChainConfig, common.Hash, error) {
// Commit the 'old' genesis block with SubnetEVM transition at 90.
// Advance to block #4, past the SubnetEVM transition block of customg.
// Commit the 'old' genesis block with EVM transition at 90.
// Advance to block #4, past the EVM transition block of customg.
genesis := oldcustomg.MustCommit(db)
bc, _ := NewBlockChain(db, DefaultCacheConfig, &oldcustomg, dummy.NewFullFaker(), vm.Config{}, genesis.Hash(), false)
@@ -145,7 +145,7 @@ func TestSetupGenesis(t *testing.T) {
wantHash: customghash,
wantConfig: customg.Config,
wantErr: &params.ConfigCompatError{
What: "SubnetEVM fork block timestamp",
What: "EVM fork block timestamp",
StoredTime: u64(90),
NewTime: u64(100),
RewindToTime: 89,

Some files were not shown because too many files have changed in this diff Show More