diff --git a/cosmos/config/parser.go b/cosmos/config/parser.go index 2dbea539e..06c9cff8f 100644 --- a/cosmos/config/parser.go +++ b/cosmos/config/parser.go @@ -28,8 +28,8 @@ import ( servertypes "github.com/cosmos/cosmos-sdk/server/types" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) // baseTen is for the big.Int string conversation. diff --git a/cosmos/config/parser_test.go b/cosmos/config/parser_test.go index 120ea8dc8..a52554504 100644 --- a/cosmos/config/parser_test.go +++ b/cosmos/config/parser_test.go @@ -24,9 +24,10 @@ import ( "testing" "time" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "pkg.berachain.dev/polaris/cosmos/config/mocks" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/common/hexutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/lib/address.go b/cosmos/lib/address.go index 275986c13..1cdddbc5e 100644 --- a/cosmos/lib/address.go +++ b/cosmos/lib/address.go @@ -23,7 +23,7 @@ package lib import ( "cosmossdk.io/core/address" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" ) /* -------------------------------------------------------------------------- */ diff --git a/cosmos/lib/address_test.go b/cosmos/lib/address_test.go index 3a1e9f72b..95dff66ba 100644 --- a/cosmos/lib/address_test.go +++ b/cosmos/lib/address_test.go @@ -24,8 +24,9 @@ import ( addresscodec "github.com/cosmos/cosmos-sdk/codec/address" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + cosmlib "pkg.berachain.dev/polaris/cosmos/lib" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/lib/ante/eject.go b/cosmos/lib/ante/eject.go index a8ed64abd..39aa29e53 100644 --- a/cosmos/lib/ante/eject.go +++ b/cosmos/lib/ante/eject.go @@ -26,8 +26,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/cosmos/lib/conversions.go b/cosmos/lib/conversions.go index d780a9bc2..fdb095a37 100644 --- a/cosmos/lib/conversions.go +++ b/cosmos/lib/conversions.go @@ -33,11 +33,12 @@ import ( v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + libgenerated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/governance" "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/staking" "pkg.berachain.dev/polaris/cosmos/precompile" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/cosmos/lib/evm.go b/cosmos/lib/evm.go index 811d7bcca..d3d6ca45b 100644 --- a/cosmos/lib/evm.go +++ b/cosmos/lib/evm.go @@ -25,9 +25,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/precompile" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" "pkg.berachain.dev/polaris/lib/utils" diff --git a/cosmos/precompile/bank/bank.go b/cosmos/precompile/bank/bank.go index 27d3210c1..c99cd227e 100644 --- a/cosmos/precompile/bank/bank.go +++ b/cosmos/precompile/bank/bank.go @@ -29,10 +29,11 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" bankgenerated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/bank" cosmlib "pkg.berachain.dev/polaris/cosmos/lib" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" ) diff --git a/cosmos/precompile/bank/bank_test.go b/cosmos/precompile/bank/bank_test.go index 08bbf414d..1ff062dfb 100644 --- a/cosmos/precompile/bank/bank_test.go +++ b/cosmos/precompile/bank/bank_test.go @@ -35,12 +35,13 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/precompile" "pkg.berachain.dev/polaris/cosmos/precompile/bank" testutils "pkg.berachain.dev/polaris/cosmos/testutil" pclog "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/precompile/log" evmtypes "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" "pkg.berachain.dev/polaris/lib/utils" diff --git a/cosmos/precompile/distribution/distribution.go b/cosmos/precompile/distribution/distribution.go index f1e27b4e2..94f209f2a 100644 --- a/cosmos/precompile/distribution/distribution.go +++ b/cosmos/precompile/distribution/distribution.go @@ -28,11 +28,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" generated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/distribution" cosmlib "pkg.berachain.dev/polaris/cosmos/lib" "pkg.berachain.dev/polaris/cosmos/precompile/staking" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" ) diff --git a/cosmos/precompile/governance/governance.go b/cosmos/precompile/governance/governance.go index 953f00952..759b529ae 100644 --- a/cosmos/precompile/governance/governance.go +++ b/cosmos/precompile/governance/governance.go @@ -33,11 +33,12 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/ethereum/go-ethereum/common" + cbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" generated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/governance" cosmlib "pkg.berachain.dev/polaris/cosmos/lib" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/precompile/log" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" ) diff --git a/cosmos/precompile/governance/governance_test.go b/cosmos/precompile/governance/governance_test.go index baccf2274..ac0aebbd1 100644 --- a/cosmos/precompile/governance/governance_test.go +++ b/cosmos/precompile/governance/governance_test.go @@ -41,10 +41,11 @@ import ( governancetypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + "github.com/ethereum/go-ethereum/common" + cbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" generated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/governance" testutils "pkg.berachain.dev/polaris/cosmos/testutil" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" "pkg.berachain.dev/polaris/lib/utils" diff --git a/cosmos/precompile/governance/testutil.go b/cosmos/precompile/governance/testutil.go index d4dfa36d2..3c6950ea7 100644 --- a/cosmos/precompile/governance/testutil.go +++ b/cosmos/precompile/governance/testutil.go @@ -44,8 +44,9 @@ import ( v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + testutils "pkg.berachain.dev/polaris/cosmos/testutil" - "pkg.berachain.dev/polaris/eth/common" //nolint:stylecheck,revive // Ginkgo is the testing framework. . "github.com/onsi/ginkgo/v2" diff --git a/cosmos/precompile/staking/staking.go b/cosmos/precompile/staking/staking.go index 4e175f617..9f5e739cb 100644 --- a/cosmos/precompile/staking/staking.go +++ b/cosmos/precompile/staking/staking.go @@ -35,10 +35,11 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + cbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" generated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/staking" cosmlib "pkg.berachain.dev/polaris/cosmos/lib" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" ) diff --git a/cosmos/precompile/staking/staking_test.go b/cosmos/precompile/staking/staking_test.go index b0b345c90..74123b925 100644 --- a/cosmos/precompile/staking/staking_test.go +++ b/cosmos/precompile/staking/staking_test.go @@ -36,12 +36,13 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + cbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/lib" generated "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/staking" cosmlib "pkg.berachain.dev/polaris/cosmos/lib" testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/vm" "pkg.berachain.dev/polaris/eth/core/vm/mock" diff --git a/cosmos/runtime/logging.go b/cosmos/runtime/logging.go index 5721a4b21..0611c5246 100644 --- a/cosmos/runtime/logging.go +++ b/cosmos/runtime/logging.go @@ -23,7 +23,7 @@ package runtime import ( "cosmossdk.io/log" - ethlog "pkg.berachain.dev/polaris/eth/log" + ethlog "github.com/ethereum/go-ethereum/log" ) // LoggerFuncHandler injects the cosmos-sdk logger into geth. diff --git a/cosmos/testutil/bank.go b/cosmos/testutil/bank.go index 44d432290..519765513 100644 --- a/cosmos/testutil/bank.go +++ b/cosmos/testutil/bank.go @@ -28,16 +28,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" ) type BankKeeper interface { SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error - SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, - recipientModule string, amt sdk.Coins) error MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error - BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error } // MintCoinsToAddress mints coins to a given address. diff --git a/cosmos/testutil/setup.go b/cosmos/testutil/setup.go index 45e6086e7..c448eaa51 100644 --- a/cosmos/testutil/setup.go +++ b/cosmos/testutil/setup.go @@ -54,8 +54,9 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + evmtypes "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" ) var ( diff --git a/cosmos/x/evm/genesis_test.go b/cosmos/x/evm/genesis_test.go index 702672fc9..e010c72bb 100644 --- a/cosmos/x/evm/genesis_test.go +++ b/cosmos/x/evm/genesis_test.go @@ -30,6 +30,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/consensus/beacon" + "github.com/ethereum/go-ethereum/params" "pkg.berachain.dev/polaris/cosmos/config" testutil "pkg.berachain.dev/polaris/cosmos/testutil" @@ -38,7 +39,6 @@ import ( "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" "pkg.berachain.dev/polaris/eth/core" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" - "pkg.berachain.dev/polaris/eth/params" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -66,7 +66,7 @@ var _ = Describe("Genesis", func() { ctx, ak, _, _ = testutil.SetupMinimalKeepers(log.NewTestLogger(GinkgoT())) ctx = ctx.WithBlockHeight(0) cfg := config.DefaultConfig() - ethGen.Config = params.DefaultChainConfig + ethGen.Config = core.DefaultChainConfig cfg.Node.DataDir = GinkgoT().TempDir() cfg.Node.KeyStoreDir = GinkgoT().TempDir() k = keeper.NewKeeper( @@ -83,7 +83,7 @@ var _ = Describe("Genesis", func() { cfg, ) err = k.Setup( - core.NewChain(k.Host, params.DefaultChainConfig, beacon.NewFaker()), + core.NewChain(k.Host, core.DefaultChainConfig, beacon.NewFaker()), ) Expect(err).ToNot(HaveOccurred()) diff --git a/cosmos/x/evm/keeper/keeper.go b/cosmos/x/evm/keeper/keeper.go index ec6024841..9fdb043b8 100644 --- a/cosmos/x/evm/keeper/keeper.go +++ b/cosmos/x/evm/keeper/keeper.go @@ -28,12 +28,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/cosmos/config" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" "pkg.berachain.dev/polaris/cosmos/x/evm/types" "pkg.berachain.dev/polaris/eth/core" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" - "pkg.berachain.dev/polaris/eth/params" ) type Blockchain interface { diff --git a/cosmos/x/evm/plugins/block/header.go b/cosmos/x/evm/plugins/block/header.go index 2c92b8cf7..b17496386 100644 --- a/cosmos/x/evm/plugins/block/header.go +++ b/cosmos/x/evm/plugins/block/header.go @@ -25,8 +25,9 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" coretypes "pkg.berachain.dev/polaris/eth/core/types" errorslib "pkg.berachain.dev/polaris/lib/errors" diff --git a/cosmos/x/evm/plugins/block/header_test.go b/cosmos/x/evm/plugins/block/header_test.go index 38df63b29..480a31999 100644 --- a/cosmos/x/evm/plugins/block/header_test.go +++ b/cosmos/x/evm/plugins/block/header_test.go @@ -29,9 +29,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + testutil "pkg.berachain.dev/polaris/cosmos/testutil" evmtypes "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/lib/utils" diff --git a/cosmos/x/evm/plugins/historical/historical_data.go b/cosmos/x/evm/plugins/historical/historical_data.go index e84afc42b..5b46c10db 100644 --- a/cosmos/x/evm/plugins/historical/historical_data.go +++ b/cosmos/x/evm/plugins/historical/historical_data.go @@ -27,10 +27,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rlp" "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" coretypes "pkg.berachain.dev/polaris/eth/core/types" errorslib "pkg.berachain.dev/polaris/lib/errors" diff --git a/cosmos/x/evm/plugins/historical/plugin.go b/cosmos/x/evm/plugins/historical/plugin.go index 335c80017..be31f3ea5 100644 --- a/cosmos/x/evm/plugins/historical/plugin.go +++ b/cosmos/x/evm/plugins/historical/plugin.go @@ -27,9 +27,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/cosmos/x/evm/plugins" "pkg.berachain.dev/polaris/eth/core" - "pkg.berachain.dev/polaris/eth/params" ) // Plugin is the interface that must be implemented by the plugin. diff --git a/cosmos/x/evm/plugins/historical/plugin_test.go b/cosmos/x/evm/plugins/historical/plugin_test.go index a89b0f1e6..0348e121b 100644 --- a/cosmos/x/evm/plugins/historical/plugin_test.go +++ b/cosmos/x/evm/plugins/historical/plugin_test.go @@ -28,14 +28,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/trie" testutil "pkg.berachain.dev/polaris/cosmos/testutil" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" "pkg.berachain.dev/polaris/eth/core/mock" coretypes "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/params" "pkg.berachain.dev/polaris/lib/utils" . "github.com/onsi/ginkgo/v2" @@ -57,7 +56,7 @@ var _ = Describe("Historical Data", func() { ctx = testutil.NewContext(log.NewTestLogger(GinkgoT())).WithBlockHeight(0) bp := mock.NewBlockPluginMock() - p = utils.MustGetAs[*plugin](NewPlugin(params.DefaultChainConfig, bp, nil, testutil.EvmKey)) + p = utils.MustGetAs[*plugin](NewPlugin(core.DefaultChainConfig, bp, nil, testutil.EvmKey)) Expect(p.InitGenesis(ctx, core.DefaultGenesis)).To(Succeed()) }) diff --git a/cosmos/x/evm/plugins/precompile/log/attributes.go b/cosmos/x/evm/plugins/precompile/log/attributes.go index afa3d1d95..a748a4aad 100644 --- a/cosmos/x/evm/plugins/precompile/log/attributes.go +++ b/cosmos/x/evm/plugins/precompile/log/attributes.go @@ -29,9 +29,10 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" + cosmlib "pkg.berachain.dev/polaris/cosmos/lib" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/precompile" ) diff --git a/cosmos/x/evm/plugins/precompile/log/factory_test.go b/cosmos/x/evm/plugins/precompile/log/factory_test.go index 7b74eb6d1..bd13180f9 100644 --- a/cosmos/x/evm/plugins/precompile/log/factory_test.go +++ b/cosmos/x/evm/plugins/precompile/log/factory_test.go @@ -30,13 +30,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + cosmlib "pkg.berachain.dev/polaris/cosmos/lib" testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/precompile/mock" - "pkg.berachain.dev/polaris/eth/crypto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/x/evm/plugins/precompile/log/log.go b/cosmos/x/evm/plugins/precompile/log/log.go index 2181b60c5..02997a984 100644 --- a/cosmos/x/evm/plugins/precompile/log/log.go +++ b/cosmos/x/evm/plugins/precompile/log/log.go @@ -21,8 +21,9 @@ package log import ( + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/cosmos/x/evm/plugins/precompile/log/log_test.go b/cosmos/x/evm/plugins/precompile/log/log_test.go index 144f69f88..9193a5389 100644 --- a/cosmos/x/evm/plugins/precompile/log/log_test.go +++ b/cosmos/x/evm/plugins/precompile/log/log_test.go @@ -23,9 +23,10 @@ package log import ( "testing" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/crypto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/x/evm/plugins/precompile/log/translator.go b/cosmos/x/evm/plugins/precompile/log/translator.go index 606de40a9..fe3a5d61e 100644 --- a/cosmos/x/evm/plugins/precompile/log/translator.go +++ b/cosmos/x/evm/plugins/precompile/log/translator.go @@ -23,8 +23,9 @@ package log import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/lib/errors" ) diff --git a/cosmos/x/evm/plugins/precompile/plugin.go b/cosmos/x/evm/plugins/precompile/plugin.go index 939d3a7b0..092f67a60 100644 --- a/cosmos/x/evm/plugins/precompile/plugin.go +++ b/cosmos/x/evm/plugins/precompile/plugin.go @@ -28,13 +28,14 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" ethprecompile "pkg.berachain.dev/polaris/eth/core/precompile" ethstate "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/vm" - "pkg.berachain.dev/polaris/eth/params" "pkg.berachain.dev/polaris/lib/registry" libtypes "pkg.berachain.dev/polaris/lib/types" "pkg.berachain.dev/polaris/lib/utils" diff --git a/cosmos/x/evm/plugins/precompile/plugin_test.go b/cosmos/x/evm/plugins/precompile/plugin_test.go index cb2cdff89..66b4c7205 100644 --- a/cosmos/x/evm/plugins/precompile/plugin_test.go +++ b/cosmos/x/evm/plugins/precompile/plugin_test.go @@ -31,12 +31,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/store/snapmulti" testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state/events" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state/events/mock" - "pkg.berachain.dev/polaris/eth/common" ethstate "pkg.berachain.dev/polaris/eth/core/state" coretypes "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/eth/core/vm" diff --git a/cosmos/x/evm/plugins/state/genesis.go b/cosmos/x/evm/plugins/state/genesis.go index e25152ba3..cfd249f26 100644 --- a/cosmos/x/evm/plugins/state/genesis.go +++ b/cosmos/x/evm/plugins/state/genesis.go @@ -28,7 +28,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core" ) diff --git a/cosmos/x/evm/plugins/state/genesis_test.go b/cosmos/x/evm/plugins/state/genesis_test.go index e7b7456b1..6fbe7ec02 100644 --- a/cosmos/x/evm/plugins/state/genesis_test.go +++ b/cosmos/x/evm/plugins/state/genesis_test.go @@ -27,11 +27,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" - "pkg.berachain.dev/polaris/eth/crypto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/x/evm/plugins/state/keys.go b/cosmos/x/evm/plugins/state/keys.go index fe1889759..4fd46b167 100644 --- a/cosmos/x/evm/plugins/state/keys.go +++ b/cosmos/x/evm/plugins/state/keys.go @@ -21,8 +21,9 @@ package state import ( + "github.com/ethereum/go-ethereum/common" + types "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" ) // NOTE: we use copy to build keys for max performance: https://github.com/golang/go/issues/55905 diff --git a/cosmos/x/evm/plugins/state/keys_test.go b/cosmos/x/evm/plugins/state/keys_test.go index d321cb348..a89c2ef67 100644 --- a/cosmos/x/evm/plugins/state/keys_test.go +++ b/cosmos/x/evm/plugins/state/keys_test.go @@ -21,8 +21,9 @@ package state import ( + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/cosmos/x/evm/plugins/state/plugin.go b/cosmos/x/evm/plugins/state/plugin.go index ab4c9b470..c29dc03da 100644 --- a/cosmos/x/evm/plugins/state/plugin.go +++ b/cosmos/x/evm/plugins/state/plugin.go @@ -30,14 +30,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "pkg.berachain.dev/polaris/cosmos/store/snapmulti" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state/events" "pkg.berachain.dev/polaris/cosmos/x/evm/types" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" ethstate "pkg.berachain.dev/polaris/eth/core/state" - "pkg.berachain.dev/polaris/eth/crypto" "pkg.berachain.dev/polaris/lib/snapshot" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/cosmos/x/evm/plugins/state/plugin_benchmark_test.go b/cosmos/x/evm/plugins/state/plugin_benchmark_test.go index 0155a1994..d6a7a3f94 100644 --- a/cosmos/x/evm/plugins/state/plugin_benchmark_test.go +++ b/cosmos/x/evm/plugins/state/plugin_benchmark_test.go @@ -26,9 +26,10 @@ import ( "cosmossdk.io/log" + "github.com/ethereum/go-ethereum/common" + testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core" ) diff --git a/cosmos/x/evm/plugins/state/plugin_test.go b/cosmos/x/evm/plugins/state/plugin_test.go index 2a80548e2..cbe886b34 100644 --- a/cosmos/x/evm/plugins/state/plugin_test.go +++ b/cosmos/x/evm/plugins/state/plugin_test.go @@ -27,11 +27,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + testutil "pkg.berachain.dev/polaris/cosmos/testutil" "pkg.berachain.dev/polaris/cosmos/x/evm/plugins/state" - "pkg.berachain.dev/polaris/eth/common" coretypes "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/crypto" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/e2e/localnet/network/fixture.go b/e2e/localnet/network/fixture.go index 79512f58d..c995e4077 100644 --- a/e2e/localnet/network/fixture.go +++ b/e2e/localnet/network/fixture.go @@ -32,9 +32,8 @@ import ( ginkgo "github.com/onsi/ginkgo/v2" "github.com/ethereum/go-ethereum/accounts/abi/bind" - - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) const ( diff --git a/e2e/localnet/network/fixture_test.go b/e2e/localnet/network/fixture_test.go index 8421c18b8..d7b768b3a 100644 --- a/e2e/localnet/network/fixture_test.go +++ b/e2e/localnet/network/fixture_test.go @@ -31,13 +31,13 @@ import ( geth "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" gethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" gethrpc "github.com/ethereum/go-ethereum/rpc" tbindings "pkg.berachain.dev/polaris/contracts/bindings/testing" localnet "pkg.berachain.dev/polaris/e2e/localnet/network" - "pkg.berachain.dev/polaris/eth/common" coretypes "pkg.berachain.dev/polaris/eth/core/types" . "github.com/onsi/ginkgo/v2" diff --git a/e2e/localnet/utils/utils.go b/e2e/localnet/utils/utils.go index c396f0947..28def285e 100644 --- a/e2e/localnet/utils/utils.go +++ b/e2e/localnet/utils/utils.go @@ -25,10 +25,10 @@ import ( "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" bindings "pkg.berachain.dev/polaris/contracts/bindings/testing" - "pkg.berachain.dev/polaris/eth/common" coretypes "pkg.berachain.dev/polaris/eth/core/types" . "github.com/onsi/gomega" //nolint:stylecheck,revive,gostaticcheck // Gomega makes sense in tests. diff --git a/e2e/precompile/contracts/bank/bank_test.go b/e2e/precompile/contracts/bank/bank_test.go index c4215005c..f52b17251 100644 --- a/e2e/precompile/contracts/bank/bank_test.go +++ b/e2e/precompile/contracts/bank/bank_test.go @@ -29,10 +29,11 @@ import ( "math/big" "testing" + "github.com/ethereum/go-ethereum/common" + bindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/bank" localnet "pkg.berachain.dev/polaris/e2e/localnet/network" utils "pkg.berachain.dev/polaris/e2e/precompile" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/e2e/precompile/contracts/distribution/distribution_test.go b/e2e/precompile/contracts/distribution/distribution_test.go index a79517c97..ae2f0e45b 100644 --- a/e2e/precompile/contracts/distribution/distribution_test.go +++ b/e2e/precompile/contracts/distribution/distribution_test.go @@ -33,13 +33,14 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/common" + bbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/bank" bindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/distribution" sbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/staking" tbindings "pkg.berachain.dev/polaris/contracts/bindings/testing" network "pkg.berachain.dev/polaris/e2e/localnet/network" utils "pkg.berachain.dev/polaris/e2e/precompile" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/e2e/precompile/contracts/gov/governance_test.go b/e2e/precompile/contracts/gov/governance_test.go index 4edf93252..a176c8400 100644 --- a/e2e/precompile/contracts/gov/governance_test.go +++ b/e2e/precompile/contracts/gov/governance_test.go @@ -34,12 +34,13 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/common" + bbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/bank" bindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/governance" tbindings "pkg.berachain.dev/polaris/contracts/bindings/testing/governance" network "pkg.berachain.dev/polaris/e2e/localnet/network" utils "pkg.berachain.dev/polaris/e2e/precompile" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/types" . "github.com/onsi/ginkgo/v2" diff --git a/e2e/precompile/contracts/staking/staking_test.go b/e2e/precompile/contracts/staking/staking_test.go index 0f7c6e513..16cee93f6 100644 --- a/e2e/precompile/contracts/staking/staking_test.go +++ b/e2e/precompile/contracts/staking/staking_test.go @@ -33,12 +33,13 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/ethereum/go-ethereum/common" + bbindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/bank" bindings "pkg.berachain.dev/polaris/contracts/bindings/cosmos/precompile/staking" tbindings "pkg.berachain.dev/polaris/contracts/bindings/testing" network "pkg.berachain.dev/polaris/e2e/localnet/network" utils "pkg.berachain.dev/polaris/e2e/precompile" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/e2e/precompile/go.mod b/e2e/precompile/go.mod index 022552e31..eb9613d31 100644 --- a/e2e/precompile/go.mod +++ b/e2e/precompile/go.mod @@ -8,6 +8,7 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( github.com/cosmos/cosmos-sdk v0.50.0-rc.1.0.20231023194456-42dbfc4d7087 github.com/cosmos/gogoproto v1.4.11 + github.com/ethereum/go-ethereum v1.13.1 github.com/onsi/ginkgo/v2 v2.13.0 github.com/onsi/gomega v1.27.10 pkg.berachain.dev/polaris/contracts v0.0.0-20231023174626-bf146d519cd3 @@ -74,7 +75,6 @@ require ( github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/emicklei/dot v1.6.0 // indirect github.com/ethereum/c-kzg-4844 v0.3.1 // indirect - github.com/ethereum/go-ethereum v1.13.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect diff --git a/eth/common/hexutil/imported.go b/eth/common/hexutil/imported.go deleted file mode 100644 index 86a99a4d8..000000000 --- a/eth/common/hexutil/imported.go +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package hexutil - -import ( - "github.com/ethereum/go-ethereum/common/hexutil" -) - -type ( - Bytes = hexutil.Bytes - Uint = hexutil.Uint -) - -var ( - MustDecode = hexutil.MustDecode - Decode = hexutil.Decode -) diff --git a/eth/common/imported.go b/eth/common/imported.go deleted file mode 100644 index a1904ac3e..000000000 --- a/eth/common/imported.go +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package common - -import ( - "github.com/ethereum/go-ethereum/common" -) - -type ( - Address = common.Address - Hash = common.Hash -) - -var ( - AddressLength = common.AddressLength - HashLength = common.HashLength - BytesToAddress = common.BytesToAddress - Big0 = common.Big0 - BigToHash = common.BigToHash - BytesToHash = common.BytesToHash - Bytes2Hex = common.Bytes2Hex - FromHex = common.FromHex - HexToAddress = common.HexToAddress - IsHexAddress = common.IsHexAddress - Hex2Bytes = common.Hex2Bytes - HexToHash = common.HexToHash - LeftPadBytes = common.LeftPadBytes -) diff --git a/eth/consensus/dummy_eth_one.go b/eth/consensus/dummy_eth_one.go index 3c4e819b7..5b1c7945f 100644 --- a/eth/consensus/dummy_eth_one.go +++ b/eth/consensus/dummy_eth_one.go @@ -24,13 +24,13 @@ package consensus import ( "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/trie" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/rpc" ) type Engine consensus.Engine diff --git a/eth/core/chain.go b/eth/core/chain.go index f419e17ff..c227a67b7 100644 --- a/eth/core/chain.go +++ b/eth/core/chain.go @@ -26,18 +26,18 @@ import ( "math/big" "sync/atomic" + "github.com/ethereum/go-ethereum/common" lru "github.com/ethereum/go-ethereum/common/lru" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/trie" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/consensus" "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/eth/core/vm" - "pkg.berachain.dev/polaris/eth/log" - "pkg.berachain.dev/polaris/eth/params" ) // By default we are storing up to 1024 items in each cache. diff --git a/eth/core/chain_context.go b/eth/core/chain_context.go index 5bc7648b1..2a991550b 100644 --- a/eth/core/chain_context.go +++ b/eth/core/chain_context.go @@ -21,9 +21,9 @@ package core import ( + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/types" ) diff --git a/eth/core/chain_helpers.go b/eth/core/chain_helpers.go index 623374513..10399bfe7 100644 --- a/eth/core/chain_helpers.go +++ b/eth/core/chain_helpers.go @@ -21,7 +21,8 @@ package core import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core/types" ) diff --git a/eth/core/chain_reader.go b/eth/core/chain_reader.go index cccaba8d8..807b8d357 100644 --- a/eth/core/chain_reader.go +++ b/eth/core/chain_reader.go @@ -23,7 +23,8 @@ package core import ( "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/eth/core/chain_resources.go b/eth/core/chain_resources.go index 95b67cb42..e961a3514 100644 --- a/eth/core/chain_resources.go +++ b/eth/core/chain_resources.go @@ -23,10 +23,11 @@ package core import ( "errors" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/vm" - "pkg.berachain.dev/polaris/eth/params" ) // ChainResources is the interface that defines functions for code paths within the chain to diff --git a/eth/core/genesis.go b/eth/core/genesis.go index 4a598d66e..103efe68f 100644 --- a/eth/core/genesis.go +++ b/eth/core/genesis.go @@ -23,10 +23,11 @@ package core import ( "math/big" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/params" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/common/hexutil" "pkg.berachain.dev/polaris/eth/core/types" ) @@ -69,6 +70,33 @@ var DefaultGenesis = &core.Genesis{ // in actual genesis blocks. } +const DefaultEIP155ChainID = 2061 + +var zero = uint64(0) + +var DefaultChainConfig = ¶ms.ChainConfig{ + ChainID: big.NewInt(DefaultEIP155ChainID), + HomesteadBlock: big.NewInt(0), + DAOForkBlock: big.NewInt(0), + DAOForkSupport: true, + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP158Block: big.NewInt(0), + ByzantiumBlock: big.NewInt(0), + ConstantinopleBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + IstanbulBlock: big.NewInt(0), + MuirGlacierBlock: big.NewInt(0), + BerlinBlock: big.NewInt(0), + LondonBlock: big.NewInt(0), + ArrowGlacierBlock: big.NewInt(0), + GrayGlacierBlock: big.NewInt(0), + MergeNetsplitBlock: big.NewInt(0), + TerminalTotalDifficulty: big.NewInt(0), + TerminalTotalDifficultyPassed: true, + ShanghaiTime: &zero, +} + // UnmarshalGenesisHeader sets the fields of the given header into the Genesis struct. func UnmarshalGenesisHeader(header *types.Header, gen *Genesis) { // Note: cannot set the state root on the genesis. diff --git a/eth/core/host.go b/eth/core/host.go index 2fc19c8ff..82641c897 100644 --- a/eth/core/host.go +++ b/eth/core/host.go @@ -21,7 +21,8 @@ package core import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/types" diff --git a/eth/core/precompile/base_contract.go b/eth/core/precompile/base_contract.go index 0108db3d1..0e7d8f59d 100644 --- a/eth/core/precompile/base_contract.go +++ b/eth/core/precompile/base_contract.go @@ -21,8 +21,9 @@ package precompile import ( + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" ) // ============================================================================== diff --git a/eth/core/precompile/default_plugin.go b/eth/core/precompile/default_plugin.go index 8aae3102f..25547af35 100644 --- a/eth/core/precompile/default_plugin.go +++ b/eth/core/precompile/default_plugin.go @@ -24,9 +24,10 @@ import ( "context" "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/eth/core/vm" - "pkg.berachain.dev/polaris/eth/params" "pkg.berachain.dev/polaris/lib/registry" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/eth/core/precompile/factories_test.go b/eth/core/precompile/factories_test.go index 78515677b..e11c394bb 100644 --- a/eth/core/precompile/factories_test.go +++ b/eth/core/precompile/factories_test.go @@ -25,9 +25,10 @@ import ( "errors" "math/big" + "github.com/ethereum/go-ethereum/common" + solidity "pkg.berachain.dev/polaris/contracts/bindings/testing" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/eth/core/vm" diff --git a/eth/core/precompile/interfaces.go b/eth/core/precompile/interfaces.go index ff379538b..1c980b039 100644 --- a/eth/core/precompile/interfaces.go +++ b/eth/core/precompile/interfaces.go @@ -21,8 +21,9 @@ package precompile import ( + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/vm" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/eth/core/precompile/method_test.go b/eth/core/precompile/method_test.go index b33ccd3e0..03114bf74 100644 --- a/eth/core/precompile/method_test.go +++ b/eth/core/precompile/method_test.go @@ -25,8 +25,9 @@ import ( "math/big" "reflect" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/vm" vmmock "pkg.berachain.dev/polaris/eth/core/vm/mock" diff --git a/eth/core/precompile/method_validation_test.go b/eth/core/precompile/method_validation_test.go index 4aa9fa42b..dc41823c7 100644 --- a/eth/core/precompile/method_validation_test.go +++ b/eth/core/precompile/method_validation_test.go @@ -25,9 +25,10 @@ import ( "math/big" "reflect" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/contracts/bindings/testing" "pkg.berachain.dev/polaris/eth/accounts/abi" - "pkg.berachain.dev/polaris/eth/common" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/eth/core/precompile/mock/stateful_impl.go b/eth/core/precompile/mock/stateful_impl.go index f82bd909d..cf541fa38 100644 --- a/eth/core/precompile/mock/stateful_impl.go +++ b/eth/core/precompile/mock/stateful_impl.go @@ -22,8 +22,8 @@ package mock import ( "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/precompile" ) diff --git a/eth/core/precompile/stateful_container.go b/eth/core/precompile/stateful_container.go index e24b24559..8b542ffde 100644 --- a/eth/core/precompile/stateful_container.go +++ b/eth/core/precompile/stateful_container.go @@ -24,7 +24,8 @@ import ( "context" "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core/vm" ) diff --git a/eth/core/precompile/stateful_container_test.go b/eth/core/precompile/stateful_container_test.go index e6e490175..91506dbbb 100644 --- a/eth/core/precompile/stateful_container_test.go +++ b/eth/core/precompile/stateful_container_test.go @@ -25,8 +25,9 @@ import ( "math/big" "reflect" + "github.com/ethereum/go-ethereum/common" + solidity "pkg.berachain.dev/polaris/contracts/bindings/testing" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/vm" vmmock "pkg.berachain.dev/polaris/eth/core/vm/mock" diff --git a/eth/core/state/interfaces.go b/eth/core/state/interfaces.go index cbf2b10d1..14764756f 100644 --- a/eth/core/state/interfaces.go +++ b/eth/core/state/interfaces.go @@ -24,7 +24,8 @@ import ( "context" "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/eth/core/state/journal/access_list.go b/eth/core/state/journal/access_list.go index 14b54117f..83fcaca79 100644 --- a/eth/core/state/journal/access_list.go +++ b/eth/core/state/journal/access_list.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + libtypes "pkg.berachain.dev/polaris/lib/types" "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/eth/core/state/journal/access_list_test.go b/eth/core/state/journal/access_list_test.go index b34ab36bb..28c430c66 100644 --- a/eth/core/state/journal/access_list_test.go +++ b/eth/core/state/journal/access_list_test.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/lib/utils" . "github.com/onsi/ginkgo/v2" diff --git a/eth/core/state/journal/logs.go b/eth/core/state/journal/logs.go index 68ccf94df..e71790b1e 100644 --- a/eth/core/state/journal/logs.go +++ b/eth/core/state/journal/logs.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + coretypes "pkg.berachain.dev/polaris/eth/core/types" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/eth/core/state/journal/logs_test.go b/eth/core/state/journal/logs_test.go index 01091bbf9..3ae1f9dbf 100644 --- a/eth/core/state/journal/logs_test.go +++ b/eth/core/state/journal/logs_test.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + coretypes "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/lib/utils" diff --git a/eth/core/state/journal/mock/state_plugin.go b/eth/core/state/journal/mock/state_plugin.go index 72e69ac1c..0234ef458 100644 --- a/eth/core/state/journal/mock/state_plugin.go +++ b/eth/core/state/journal/mock/state_plugin.go @@ -23,7 +23,7 @@ package mock import ( "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" ) //go:generate moq -out ./state_plugin.mock.go -skip-ensure -pkg mock ../ selfDestructStatePlugin diff --git a/eth/core/state/journal/selfdestruct_test.go b/eth/core/state/journal/selfdestruct_test.go index 1f93e9e93..ae54d0d8e 100644 --- a/eth/core/state/journal/selfdestruct_test.go +++ b/eth/core/state/journal/selfdestruct_test.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/eth/core/state/journal/mock" "pkg.berachain.dev/polaris/lib/utils" diff --git a/eth/core/state/journal/selfdestructs.go b/eth/core/state/journal/selfdestructs.go index 5490908cb..e0fd396dc 100644 --- a/eth/core/state/journal/selfdestructs.go +++ b/eth/core/state/journal/selfdestructs.go @@ -23,8 +23,9 @@ package journal import ( "math/big" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + libtypes "pkg.berachain.dev/polaris/lib/types" "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/eth/core/state/journal/transient_storage_test.go b/eth/core/state/journal/transient_storage_test.go index 3ec5eb88c..fd9b5e0ab 100644 --- a/eth/core/state/journal/transient_storage_test.go +++ b/eth/core/state/journal/transient_storage_test.go @@ -21,7 +21,8 @@ package journal import ( - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/lib/utils" . "github.com/onsi/ginkgo/v2" diff --git a/eth/core/state/mock/state.go b/eth/core/state/mock/state.go index 51f89ab57..5535d74ee 100644 --- a/eth/core/state/mock/state.go +++ b/eth/core/state/mock/state.go @@ -23,9 +23,10 @@ package mock import ( "math/big" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "pkg.berachain.dev/polaris/eth/core/state" - "pkg.berachain.dev/polaris/eth/crypto" ) //go:generate moq -out ./state.mock.go -skip-ensure -pkg mock ../ Plugin diff --git a/eth/core/state/statedb.go b/eth/core/state/statedb.go index b943bb7b8..a1837caab 100644 --- a/eth/core/state/statedb.go +++ b/eth/core/state/statedb.go @@ -23,13 +23,13 @@ package state import ( "context" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/params" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/precompile" "pkg.berachain.dev/polaris/eth/core/state/journal" coretypes "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/params" "pkg.berachain.dev/polaris/lib/snapshot" libtypes "pkg.berachain.dev/polaris/lib/types" ) diff --git a/eth/core/state/statedb_test.go b/eth/core/state/statedb_test.go index 2e95bd40e..61a8a25d4 100644 --- a/eth/core/state/statedb_test.go +++ b/eth/core/state/statedb_test.go @@ -27,12 +27,13 @@ import ( tmock "github.com/stretchr/testify/mock" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/state/mock" "pkg.berachain.dev/polaris/eth/core/state/mocks" coretypes "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/params" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/eth/core/types/receipts.go b/eth/core/types/receipts.go index 45731531e..4bab71877 100644 --- a/eth/core/types/receipts.go +++ b/eth/core/types/receipts.go @@ -26,9 +26,8 @@ import ( "github.com/ethereum/go-ethereum/consensus/misc/eip4844" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - - "pkg.berachain.dev/polaris/eth/params" ) // DeriveReceiptsFromBlock is a helper function for deriving receipts from a block. diff --git a/eth/core/types/transaction.go b/eth/core/types/transaction.go index 90f20d376..7ca804c58 100644 --- a/eth/core/types/transaction.go +++ b/eth/core/types/transaction.go @@ -21,9 +21,8 @@ package types import ( + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/rlp" - - "pkg.berachain.dev/polaris/eth/common" ) // TxLookupEntry is a positional metadata to help looking up a transaction by hash. diff --git a/eth/core/vm/context.go b/eth/core/vm/context.go index 13e476b26..92c58606a 100644 --- a/eth/core/vm/context.go +++ b/eth/core/vm/context.go @@ -25,7 +25,8 @@ import ( "math/big" "time" - "pkg.berachain.dev/polaris/eth/common" + "github.com/ethereum/go-ethereum/common" + "pkg.berachain.dev/polaris/lib/utils" ) diff --git a/eth/core/vm/mock/statedb.go b/eth/core/vm/mock/statedb.go index c48e2a583..7b1e03e3b 100644 --- a/eth/core/vm/mock/statedb.go +++ b/eth/core/vm/mock/statedb.go @@ -23,9 +23,9 @@ package mock import ( "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/params" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/core/types" ) diff --git a/eth/crypto/imported.go b/eth/crypto/imported.go deleted file mode 100644 index 8d1009768..000000000 --- a/eth/crypto/imported.go +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package crypto - -import ( - "github.com/ethereum/go-ethereum/crypto" -) - -var ( - // GenerateEthKey is a function that generates a new Ethereum key. - GenerateEthKey = crypto.GenerateKey - // Keccak256 is a function that computes and returns the Keccak256 hash of the input data. - Keccak256 = crypto.Keccak256 - // Keccak256Hash is a function that computes and returns the Keccak256 hash of the input data, - // but the return type is Hash. - Keccak256Hash = crypto.Keccak256Hash - // PubkeyToAddress is a function that derives the Ethereum address from the given public key. - PubkeyToAddress = crypto.PubkeyToAddress - // LoadECDSA is a function that loads a private key from a given file. - LoadECDSA = crypto.LoadECDSA -) diff --git a/eth/eth.go b/eth/eth.go index 39eb5868e..b24b8e7c6 100644 --- a/eth/eth.go +++ b/eth/eth.go @@ -24,17 +24,17 @@ import ( "fmt" "net/http" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/rpc" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/consensus" "pkg.berachain.dev/polaris/eth/core" coretypes "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/log" "pkg.berachain.dev/polaris/eth/node" "pkg.berachain.dev/polaris/eth/polar" - "pkg.berachain.dev/polaris/eth/rpc" ) type ( diff --git a/eth/log/imported.go b/eth/log/imported.go deleted file mode 100644 index 3759c7c57..000000000 --- a/eth/log/imported.go +++ /dev/null @@ -1,66 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package log - -import "github.com/ethereum/go-ethereum/log" - -type ( - // Record is a log record. - Record = log.Record - - // Logger defines the logger interface. - Logger = log.Logger - - // Handler defines the log handler interface. - Handler = log.Handler -) - -var ( - // Root is the root logger. - Root = log.Root - - // LvlTrace is the trace log level. - LvlTrace = log.LvlTrace - - // LvlDebug is the debug log level. - LvlDebug = log.LvlDebug - - // LvlInfo is the info log level. - LvlInfo = log.LvlInfo - - // LvlWarn is the warn log level. - LvlWarn = log.LvlWarn - - // LvlError is the error log level. - LvlError = log.LvlError - - // LvlCrit is the critical log level. - LvlCrit = log.LvlCrit - - // FuncHandler is the function handler for overriding the logging method within - // the go-ethereum codebase. - FuncHandler = log.FuncHandler - - // Warn is the warning log level. - Warn = log.Warn - - Error = log.Error -) diff --git a/eth/params/chain_config.go b/eth/params/chain_config.go deleted file mode 100644 index 038e1e898..000000000 --- a/eth/params/chain_config.go +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package params - -import ( - "math/big" -) - -const DefaultEIP155ChainID = 2061 - -var zero = uint64(0) - -var DefaultChainConfig = &ChainConfig{ - ChainID: big.NewInt(DefaultEIP155ChainID), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: big.NewInt(0), - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArrowGlacierBlock: big.NewInt(0), - GrayGlacierBlock: big.NewInt(0), - MergeNetsplitBlock: big.NewInt(0), - TerminalTotalDifficulty: big.NewInt(0), - TerminalTotalDifficultyPassed: true, - ShanghaiTime: &zero, -} diff --git a/eth/params/imported.go b/eth/params/imported.go deleted file mode 100644 index ad3d10f97..000000000 --- a/eth/params/imported.go +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package params - -import "github.com/ethereum/go-ethereum/params" - -type ( - // ChainConfig is the chain parameters config. - ChainConfig = params.ChainConfig - // Rules is the chain rules. - Rules = params.Rules -) - -var ( - // VersionWithMeta holds the textual version string including the metadata. - VersionWithMeta = params.VersionWithMeta - // VersionWithCommit holds the textual version string including the commit hash. - VersionWithCommit = params.VersionWithCommit - // InitialBaseFee is the initial base fee for the first block of the chain. - InitialBaseFee = params.InitialBaseFee -) diff --git a/eth/polar/api/net.go b/eth/polar/api/net.go index cd3f295f4..b7e0476bf 100644 --- a/eth/polar/api/net.go +++ b/eth/polar/api/net.go @@ -21,7 +21,7 @@ package polarapi import ( - "pkg.berachain.dev/polaris/eth/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) // NetBackend is the collection of methods required to satisfy the net diff --git a/eth/polar/api/web3.go b/eth/polar/api/web3.go index 1af6fde8d..0cf1c606d 100644 --- a/eth/polar/api/web3.go +++ b/eth/polar/api/web3.go @@ -21,8 +21,8 @@ package polarapi import ( - "pkg.berachain.dev/polaris/eth/common/hexutil" - "pkg.berachain.dev/polaris/eth/crypto" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" ) // Web3Backend is the collection of methods required to satisfy the net diff --git a/eth/polar/api_backend.go b/eth/polar/api_backend.go index b810b98d7..080b54553 100644 --- a/eth/polar/api_backend.go +++ b/eth/polar/api_backend.go @@ -28,21 +28,21 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/bloombits" "github.com/ethereum/go-ethereum/eth/gasprice" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/common/hexutil" "pkg.berachain.dev/polaris/eth/core" "pkg.berachain.dev/polaris/eth/core/state" "pkg.berachain.dev/polaris/eth/core/types" "pkg.berachain.dev/polaris/eth/core/vm" - "pkg.berachain.dev/polaris/eth/log" - "pkg.berachain.dev/polaris/eth/params" polarapi "pkg.berachain.dev/polaris/eth/polar/api" "pkg.berachain.dev/polaris/eth/version" ) diff --git a/eth/polar/backend.go b/eth/polar/backend.go index babdef9fb..0b4195de4 100644 --- a/eth/polar/backend.go +++ b/eth/polar/backend.go @@ -24,22 +24,22 @@ import ( "math/big" "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/beacon" "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/txpool/legacypool" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/eth/filters" "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/miner" "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/rpc" - "pkg.berachain.dev/polaris/eth/common" "pkg.berachain.dev/polaris/eth/consensus" "pkg.berachain.dev/polaris/eth/core" "pkg.berachain.dev/polaris/eth/core/types" - "pkg.berachain.dev/polaris/eth/log" polarapi "pkg.berachain.dev/polaris/eth/polar/api" - "pkg.berachain.dev/polaris/eth/rpc" ) // TODO: break out the node into a separate package and then fully use the diff --git a/eth/polar/config.go b/eth/polar/config.go index a5e0c9e81..78a342fe3 100644 --- a/eth/polar/config.go +++ b/eth/polar/config.go @@ -24,14 +24,15 @@ import ( "math/big" "time" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/txpool/legacypool" "github.com/ethereum/go-ethereum/eth/ethconfig" "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/params" - "pkg.berachain.dev/polaris/eth/common" - "pkg.berachain.dev/polaris/eth/log" - "pkg.berachain.dev/polaris/eth/params" + "pkg.berachain.dev/polaris/eth/core" ) const ( @@ -53,7 +54,7 @@ func DefaultConfig() *Config { minerCfg.Etherbase = common.HexToAddress(developmentCoinbase) // TODO: setup proper command line flags return &Config{ - Chain: *params.DefaultChainConfig, + Chain: *core.DefaultChainConfig, Miner: minerCfg, GPO: gpoConfig, LegacyTxPool: legacypool.DefaultConfig, diff --git a/eth/rpc/imported.go b/eth/rpc/imported.go deleted file mode 100644 index 6cb3b1eaa..000000000 --- a/eth/rpc/imported.go +++ /dev/null @@ -1,41 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -// -// Copyright (C) 2023, Berachain Foundation. All rights reserved. -// Use of this software is govered by the Business Source License included -// in the LICENSE file of this repository and at www.mariadb.com/bsl11. -// -// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY -// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER -// VERSIONS OF THE LICENSED WORK. -// -// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF -// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF -// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). -// -// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON -// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, -// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND -// TITLE. - -package rpc - -import ( - "github.com/ethereum/go-ethereum/rpc" -) - -type ( - API = rpc.API - BlockNumber = rpc.BlockNumber - BlockNumberOrHash = rpc.BlockNumberOrHash - Server = rpc.Server -) - -var ( - NewServer = rpc.NewServer - SafeBlockNumber = rpc.SafeBlockNumber - FinalizedBlockNumber = rpc.FinalizedBlockNumber - LatestBlockNumber = rpc.LatestBlockNumber - PendingBlockNumber = rpc.PendingBlockNumber - EarliestBlockNumber = rpc.EarliestBlockNumber -) diff --git a/eth/version/version.go b/eth/version/version.go index 739dd481e..26aed7afb 100644 --- a/eth/version/version.go +++ b/eth/version/version.go @@ -27,7 +27,7 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" - "pkg.berachain.dev/polaris/eth/params" + "github.com/ethereum/go-ethereum/params" ) const (