diff --git a/cmd/devnet/networks/devnet_bor.go b/cmd/devnet/networks/devnet_bor.go index 9fccc438d..9f8cbd2fa 100644 --- a/cmd/devnet/networks/devnet_bor.go +++ b/cmd/devnet/networks/devnet_bor.go @@ -12,9 +12,9 @@ import ( account_services "github.com/ledgerwatch/erigon/cmd/devnet/services/accounts" "github.com/ledgerwatch/erigon/cmd/devnet/services/polygon" "github.com/ledgerwatch/erigon/cmd/utils" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" ) func NewBorDevnetWithoutHeimdall( diff --git a/cmd/devnet/services/polygon/checkpoint.go b/cmd/devnet/services/polygon/checkpoint.go index 5a39652cd..5386ab019 100644 --- a/cmd/devnet/services/polygon/checkpoint.go +++ b/cmd/devnet/services/polygon/checkpoint.go @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon-lib/chain/networkname" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/hexutility" @@ -19,7 +21,6 @@ import ( "github.com/ledgerwatch/erigon/cmd/devnet/contracts" "github.com/ledgerwatch/erigon/cmd/devnet/devnet" "github.com/ledgerwatch/erigon/cmd/devnet/requests" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/crypto" ) diff --git a/cmd/devnet/services/polygon/heimdall.go b/cmd/devnet/services/polygon/heimdall.go index b3748cad4..8e00cecd4 100644 --- a/cmd/devnet/services/polygon/heimdall.go +++ b/cmd/devnet/services/polygon/heimdall.go @@ -10,6 +10,11 @@ import ( "github.com/ledgerwatch/log/v3" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/heimdallgrpc" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + ethereum "github.com/ledgerwatch/erigon" "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" @@ -18,12 +23,8 @@ import ( "github.com/ledgerwatch/erigon/cmd/devnet/blocks" "github.com/ledgerwatch/erigon/cmd/devnet/contracts" "github.com/ledgerwatch/erigon/cmd/devnet/devnet" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/heimdallgrpc" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) type BridgeEvent string diff --git a/cmd/devnet/services/polygon/proofgenerator_test.go b/cmd/devnet/services/polygon/proofgenerator_test.go index f5e53cbd5..4fc3829d8 100644 --- a/cmd/devnet/services/polygon/proofgenerator_test.go +++ b/cmd/devnet/services/polygon/proofgenerator_test.go @@ -11,6 +11,11 @@ import ( "testing" "github.com/holiman/uint256" + "github.com/ledgerwatch/log/v3" + "github.com/pion/randutil" + + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/common" libcommon "github.com/ledgerwatch/erigon-lib/common" @@ -21,10 +26,6 @@ import ( "github.com/ledgerwatch/erigon/cmd/devnet/blocks" "github.com/ledgerwatch/erigon/cmd/devnet/requests" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/state" @@ -32,14 +33,15 @@ import ( "github.com/ledgerwatch/erigon/core/vm" "github.com/ledgerwatch/erigon/crypto" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/contract" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/jsonrpc" "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/erigon/turbo/stages/mock" "github.com/ledgerwatch/erigon/turbo/transactions" - "github.com/ledgerwatch/log/v3" - "github.com/pion/randutil" ) type requestGenerator struct { diff --git a/cmd/devnet/services/polygon/statesync.go b/cmd/devnet/services/polygon/statesync.go index 0429f5085..ed7232ae5 100644 --- a/cmd/devnet/services/polygon/statesync.go +++ b/cmd/devnet/services/polygon/statesync.go @@ -9,7 +9,7 @@ import ( "github.com/ledgerwatch/erigon/accounts/abi/bind" "github.com/ledgerwatch/erigon/cmd/devnet/contracts" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" ) // Maximum allowed event record data size diff --git a/cmd/integration/commands/stages.go b/cmd/integration/commands/stages.go index f8a824177..386fc86f9 100644 --- a/cmd/integration/commands/stages.go +++ b/cmd/integration/commands/stages.go @@ -18,12 +18,13 @@ import ( "github.com/spf13/cobra" "golang.org/x/exp/slices" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdallgrpc" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/heimdallgrpc" + "github.com/ledgerwatch/erigon/core/rawdb/blockio" "github.com/ledgerwatch/erigon/node/nodecfg" "github.com/ledgerwatch/erigon/p2p/sentry/sentry_multi_client" + "github.com/ledgerwatch/erigon/polygon/bor" "github.com/ledgerwatch/erigon/turbo/builder" "github.com/ledgerwatch/erigon/turbo/snapshotsync/freezeblocks" diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index ed29b8a4d..34f8f438c 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -13,6 +13,8 @@ import ( "strings" "time" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/chain/snapcfg" libcommon "github.com/ledgerwatch/erigon-lib/common" @@ -23,15 +25,14 @@ import ( "github.com/ledgerwatch/erigon-lib/kv/rawdbv3" libstate "github.com/ledgerwatch/erigon-lib/state" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/consensus/ethash" "github.com/ledgerwatch/erigon/core/state/temporal" "github.com/ledgerwatch/erigon/core/systemcontracts" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/eth/ethconfig" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/contract" "github.com/ledgerwatch/erigon/rpc/rpccfg" "github.com/ledgerwatch/erigon/turbo/debug" "github.com/ledgerwatch/erigon/turbo/logging" diff --git a/consensus/misc/eip1559.go b/consensus/misc/eip1559.go index e7729a4be..de5b4ec01 100644 --- a/consensus/misc/eip1559.go +++ b/consensus/misc/eip1559.go @@ -22,7 +22,7 @@ import ( "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon/common/math" "github.com/ledgerwatch/erigon/core/types" diff --git a/core/rawdb/accessors_metadata.go b/core/rawdb/accessors_metadata.go index c2ee9218b..732922589 100644 --- a/core/rawdb/accessors_metadata.go +++ b/core/rawdb/accessors_metadata.go @@ -19,7 +19,7 @@ package rawdb import ( "encoding/json" "fmt" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" diff --git a/core/system_contract_lookup.go b/core/system_contract_lookup.go index 6b6908dda..dc0805a19 100644 --- a/core/system_contract_lookup.go +++ b/core/system_contract_lookup.go @@ -7,7 +7,7 @@ import ( "github.com/ledgerwatch/erigon-lib/chain/networkname" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/hexutility" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon/core/systemcontracts" "github.com/ledgerwatch/erigon/core/types" diff --git a/eth/backend.go b/eth/backend.go index c15a08f75..bbec2e31c 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -79,10 +79,6 @@ import ( "github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli" "github.com/ledgerwatch/erigon/common/debug" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/finality/flags" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdallgrpc" "github.com/ledgerwatch/erigon/consensus/clique" "github.com/ledgerwatch/erigon/consensus/ethash" "github.com/ledgerwatch/erigon/consensus/merge" @@ -110,6 +106,10 @@ import ( "github.com/ledgerwatch/erigon/p2p/sentry" "github.com/ledgerwatch/erigon/p2p/sentry/sentry_multi_client" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/finality/flags" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/heimdallgrpc" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/builder" "github.com/ledgerwatch/erigon/turbo/engineapi" diff --git a/eth/ethconsensusconfig/config.go b/eth/ethconsensusconfig/config.go index 04bf7cc08..5eb4399f3 100644 --- a/eth/ethconsensusconfig/config.go +++ b/eth/ethconsensusconfig/config.go @@ -8,15 +8,14 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/erigon-lib/chain" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon/consensus" "github.com/ledgerwatch/erigon/consensus/aura" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/consensus/clique" "github.com/ledgerwatch/erigon/consensus/ethash" "github.com/ledgerwatch/erigon/consensus/ethash/ethashcfg" @@ -24,6 +23,8 @@ import ( "github.com/ledgerwatch/erigon/node" "github.com/ledgerwatch/erigon/node/nodecfg" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/contract" "github.com/ledgerwatch/erigon/turbo/services" ) diff --git a/eth/stagedsync/bor_heimdall_shared.go b/eth/stagedsync/bor_heimdall_shared.go index 281774c5d..323d443ea 100644 --- a/eth/stagedsync/bor_heimdall_shared.go +++ b/eth/stagedsync/bor_heimdall_shared.go @@ -14,9 +14,9 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/turbo/services" ) diff --git a/eth/stagedsync/stage_bor_heimdall.go b/eth/stagedsync/stage_bor_heimdall.go index 9eebb6c50..a6953b370 100644 --- a/eth/stagedsync/stage_bor_heimdall.go +++ b/eth/stagedsync/stage_bor_heimdall.go @@ -19,18 +19,18 @@ import ( "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon/accounts/abi" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - "github.com/ledgerwatch/erigon/consensus/bor/finality/generics" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/dataflow" "github.com/ledgerwatch/erigon/eth/ethconfig/estimate" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/contract" + "github.com/ledgerwatch/erigon/polygon/bor/finality/generics" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" + "github.com/ledgerwatch/erigon/polygon/bor/valset" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/erigon/turbo/stages/headerdownload" ) diff --git a/eth/stagedsync/stage_bor_heimdall_test.go b/eth/stagedsync/stage_bor_heimdall_test.go index 8a11c7173..7da0f8c69 100644 --- a/eth/stagedsync/stage_bor_heimdall_test.go +++ b/eth/stagedsync/stage_bor_heimdall_test.go @@ -11,14 +11,14 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/crypto" "github.com/ledgerwatch/erigon/eth/stagedsync" "github.com/ledgerwatch/erigon/eth/stagedsync/stagedsynctest" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) func TestBorHeimdallForwardPersistsSpans(t *testing.T) { diff --git a/eth/stagedsync/stage_mining_bor_heimdall.go b/eth/stagedsync/stage_mining_bor_heimdall.go index 0befc9f1b..2dd96a98b 100644 --- a/eth/stagedsync/stage_mining_bor_heimdall.go +++ b/eth/stagedsync/stage_mining_bor_heimdall.go @@ -7,10 +7,10 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/dataflow" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" ) func MiningBorHeimdallForward( diff --git a/eth/stagedsync/stage_txlookup.go b/eth/stagedsync/stage_txlookup.go index 197a31909..67ded8145 100644 --- a/eth/stagedsync/stage_txlookup.go +++ b/eth/stagedsync/stage_txlookup.go @@ -14,7 +14,7 @@ import ( "github.com/ledgerwatch/erigon-lib/common/hexutility" "github.com/ledgerwatch/erigon-lib/etl" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/erigon/core/rawdb" diff --git a/eth/stagedsync/stagedsynctest/chain_configs.go b/eth/stagedsync/stagedsynctest/chain_configs.go index 7be909351..9db9429d3 100644 --- a/eth/stagedsync/stagedsynctest/chain_configs.go +++ b/eth/stagedsync/stagedsynctest/chain_configs.go @@ -2,8 +2,8 @@ package stagedsynctest import ( "github.com/ledgerwatch/erigon-lib/chain" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" ) func BorDevnetChainConfigWithNoBlockSealDelays() *chain.Config { diff --git a/eth/stagedsync/stagedsynctest/harness.go b/eth/stagedsync/stagedsynctest/harness.go index bba47ad40..76fddead0 100644 --- a/eth/stagedsync/stagedsynctest/harness.go +++ b/eth/stagedsync/stagedsynctest/harness.go @@ -7,29 +7,26 @@ import ( "encoding/json" "errors" "fmt" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" "math/big" "testing" "time" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/golang/mock/gomock" "github.com/holiman/uint256" "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" + heimdallmock "github.com/ledgerwatch/erigon/polygon/heimdall/mock" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv/memdb" "github.com/ledgerwatch/erigon-lib/wrap" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - heimdallmock "github.com/ledgerwatch/erigon/consensus/bor/heimdall/mock" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - bormock "github.com/ledgerwatch/erigon/consensus/bor/mock" - "github.com/ledgerwatch/erigon/consensus/bor/valset" consensusmock "github.com/ledgerwatch/erigon/consensus/mock" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/rawdb" @@ -38,6 +35,11 @@ import ( "github.com/ledgerwatch/erigon/eth/ethconfig" "github.com/ledgerwatch/erigon/eth/stagedsync" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/contract" + bormock "github.com/ledgerwatch/erigon/polygon/bor/mock" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/erigon/turbo/stages/mock" "github.com/ledgerwatch/erigon/turbo/testlog" diff --git a/params/config.go b/params/config.go index 23761442a..dc0c2c8ad 100644 --- a/params/config.go +++ b/params/config.go @@ -26,7 +26,7 @@ import ( "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/chain/networkname" libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon/common/paths" ) diff --git a/consensus/bor/abi/interface.go b/polygon/bor/abi/interface.go similarity index 100% rename from consensus/bor/abi/interface.go rename to polygon/bor/abi/interface.go diff --git a/consensus/bor/bor.go b/polygon/bor/bor.go similarity index 99% rename from consensus/bor/bor.go rename to polygon/bor/bor.go index e20f17208..e3c31bdee 100644 --- a/consensus/bor/bor.go +++ b/polygon/bor/bor.go @@ -22,20 +22,15 @@ import ( "golang.org/x/crypto/sha3" "golang.org/x/sync/errgroup" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/length" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon/common" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/finality" - "github.com/ledgerwatch/erigon/consensus/bor/finality/flags" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/statefull" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/consensus/misc" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/state" @@ -45,6 +40,12 @@ import ( "github.com/ledgerwatch/erigon/crypto/cryptopool" "github.com/ledgerwatch/erigon/eth/ethconfig/estimate" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/finality" + "github.com/ledgerwatch/erigon/polygon/bor/finality/flags" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" + "github.com/ledgerwatch/erigon/polygon/bor/statefull" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/services" diff --git a/consensus/bor/bor_test.go b/polygon/bor/bor_test.go similarity index 96% rename from consensus/bor/bor_test.go rename to polygon/bor/bor_test.go index 54744a730..c1341fb02 100644 --- a/consensus/bor/bor_test.go +++ b/polygon/bor/bor_test.go @@ -4,32 +4,35 @@ import ( "context" "encoding/json" "fmt" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" "math/big" "testing" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + + "github.com/ledgerwatch/log/v3" + + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/common" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/gointerfaces/sentry" "github.com/ledgerwatch/erigon-lib/kv/memdb" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" - "github.com/ledgerwatch/erigon/consensus/bor/contract" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/crypto" "github.com/ledgerwatch/erigon/eth/protocols/eth" "github.com/ledgerwatch/erigon/ethdb/prune" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/contract" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/turbo/stages/mock" - "github.com/ledgerwatch/log/v3" ) type test_heimdall struct { diff --git a/consensus/bor/borcfg/bor_config.go b/polygon/bor/borcfg/bor_config.go similarity index 100% rename from consensus/bor/borcfg/bor_config.go rename to polygon/bor/borcfg/bor_config.go diff --git a/consensus/bor/borcfg/bor_config_test.go b/polygon/bor/borcfg/bor_config_test.go similarity index 100% rename from consensus/bor/borcfg/bor_config_test.go rename to polygon/bor/borcfg/bor_config_test.go diff --git a/consensus/bor/clerk/clerk.go b/polygon/bor/clerk/clerk.go similarity index 100% rename from consensus/bor/clerk/clerk.go rename to polygon/bor/clerk/clerk.go diff --git a/consensus/bor/contract/client.go b/polygon/bor/contract/client.go similarity index 100% rename from consensus/bor/contract/client.go rename to polygon/bor/contract/client.go diff --git a/consensus/bor/errors.go b/polygon/bor/errors.go similarity index 97% rename from consensus/bor/errors.go rename to polygon/bor/errors.go index c70aff344..1b33eb634 100644 --- a/consensus/bor/errors.go +++ b/polygon/bor/errors.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" ) type MaxCheckpointLengthExceededError struct { diff --git a/consensus/bor/fake.go b/polygon/bor/fake.go similarity index 100% rename from consensus/bor/fake.go rename to polygon/bor/fake.go diff --git a/consensus/bor/finality/api.go b/polygon/bor/finality/api.go similarity index 95% rename from consensus/bor/finality/api.go rename to polygon/bor/finality/api.go index 288080e57..5df9ff2ca 100644 --- a/consensus/bor/finality/api.go +++ b/polygon/bor/finality/api.go @@ -3,9 +3,9 @@ package finality import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" ) func GetFinalizedBlockNumber(tx kv.Tx) uint64 { diff --git a/consensus/bor/finality/bor_verifier.go b/polygon/bor/finality/bor_verifier.go similarity index 97% rename from consensus/bor/finality/bor_verifier.go rename to polygon/bor/finality/bor_verifier.go index a8dde9dc1..1cbb566e0 100644 --- a/consensus/bor/finality/bor_verifier.go +++ b/polygon/bor/finality/bor_verifier.go @@ -9,9 +9,9 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/ledgerwatch/erigon-lib/metrics" - "github.com/ledgerwatch/erigon/consensus/bor/finality/generics" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" "github.com/ledgerwatch/erigon/core/rawdb" + "github.com/ledgerwatch/erigon/polygon/bor/finality/generics" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" ) var ( diff --git a/consensus/bor/finality/flags/flags.go b/polygon/bor/finality/flags/flags.go similarity index 100% rename from consensus/bor/finality/flags/flags.go rename to polygon/bor/finality/flags/flags.go diff --git a/consensus/bor/finality/generics/generics.go b/polygon/bor/finality/generics/generics.go similarity index 100% rename from consensus/bor/finality/generics/generics.go rename to polygon/bor/finality/generics/generics.go diff --git a/consensus/bor/finality/rawdb/checkpoint.go b/polygon/bor/finality/rawdb/checkpoint.go similarity index 100% rename from consensus/bor/finality/rawdb/checkpoint.go rename to polygon/bor/finality/rawdb/checkpoint.go diff --git a/consensus/bor/finality/rawdb/milestone.go b/polygon/bor/finality/rawdb/milestone.go similarity index 98% rename from consensus/bor/finality/rawdb/milestone.go rename to polygon/bor/finality/rawdb/milestone.go index d5ac8f496..db748a42f 100644 --- a/consensus/bor/finality/rawdb/milestone.go +++ b/polygon/bor/finality/rawdb/milestone.go @@ -7,7 +7,7 @@ import ( libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/generics" + "github.com/ledgerwatch/erigon/polygon/bor/finality/generics" "github.com/ledgerwatch/log/v3" ) diff --git a/consensus/bor/finality/whitelist.go b/polygon/bor/finality/whitelist.go similarity index 97% rename from consensus/bor/finality/whitelist.go rename to polygon/bor/finality/whitelist.go index 76abfcc0d..60a2731eb 100644 --- a/consensus/bor/finality/whitelist.go +++ b/polygon/bor/finality/whitelist.go @@ -6,12 +6,14 @@ import ( "fmt" "time" - "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/flags" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/log/v3" + + "github.com/ledgerwatch/erigon/polygon/heimdall" + + "github.com/ledgerwatch/erigon-lib/kv" + "github.com/ledgerwatch/erigon/polygon/bor/finality/flags" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" + "github.com/ledgerwatch/erigon/turbo/services" ) type config struct { diff --git a/consensus/bor/finality/whitelist/checkpoint.go b/polygon/bor/finality/whitelist/checkpoint.go similarity index 94% rename from consensus/bor/finality/whitelist/checkpoint.go rename to polygon/bor/finality/whitelist/checkpoint.go index fc4a14436..fd33dd656 100644 --- a/consensus/bor/finality/whitelist/checkpoint.go +++ b/polygon/bor/finality/whitelist/checkpoint.go @@ -3,8 +3,8 @@ package whitelist import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/metrics" - "github.com/ledgerwatch/erigon/consensus/bor/finality/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/rawdb" ) type checkpoint struct { diff --git a/consensus/bor/finality/whitelist/finality.go b/polygon/bor/finality/whitelist/finality.go similarity index 96% rename from consensus/bor/finality/whitelist/finality.go rename to polygon/bor/finality/whitelist/finality.go index f1abbbf3d..9469a95c9 100644 --- a/consensus/bor/finality/whitelist/finality.go +++ b/polygon/bor/finality/whitelist/finality.go @@ -5,8 +5,8 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/rawdb" "github.com/ledgerwatch/log/v3" ) diff --git a/consensus/bor/finality/whitelist/milestone.go b/polygon/bor/finality/whitelist/milestone.go similarity index 98% rename from consensus/bor/finality/whitelist/milestone.go rename to polygon/bor/finality/whitelist/milestone.go index 0d80ed4b5..b4777c13c 100644 --- a/consensus/bor/finality/whitelist/milestone.go +++ b/polygon/bor/finality/whitelist/milestone.go @@ -5,9 +5,9 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/metrics" - "github.com/ledgerwatch/erigon/consensus/bor/finality/flags" - "github.com/ledgerwatch/erigon/consensus/bor/finality/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/flags" + "github.com/ledgerwatch/erigon/polygon/bor/finality/rawdb" ) type milestone struct { diff --git a/consensus/bor/finality/whitelist/service.go b/polygon/bor/finality/whitelist/service.go similarity index 98% rename from consensus/bor/finality/whitelist/service.go rename to polygon/bor/finality/whitelist/service.go index 7bf7aa898..14dec13d7 100644 --- a/consensus/bor/finality/whitelist/service.go +++ b/polygon/bor/finality/whitelist/service.go @@ -5,8 +5,8 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/finality/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/rawdb" ) var ( diff --git a/consensus/bor/finality/whitelist/service_test.go b/polygon/bor/finality/whitelist/service_test.go similarity index 99% rename from consensus/bor/finality/whitelist/service_test.go rename to polygon/bor/finality/whitelist/service_test.go index 0a45e6fe7..62fe3651d 100644 --- a/consensus/bor/finality/whitelist/service_test.go +++ b/polygon/bor/finality/whitelist/service_test.go @@ -12,8 +12,8 @@ import ( libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv/memdb" - "github.com/ledgerwatch/erigon/consensus/bor/finality/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/finality/rawdb" "github.com/stretchr/testify/require" "pgregory.net/rapid" diff --git a/consensus/bor/finality/whitelist_helpers.go b/polygon/bor/finality/whitelist_helpers.go similarity index 97% rename from consensus/bor/finality/whitelist_helpers.go rename to polygon/bor/finality/whitelist_helpers.go index ddeb1e19d..b5d28cad0 100644 --- a/consensus/bor/finality/whitelist_helpers.go +++ b/polygon/bor/finality/whitelist_helpers.go @@ -4,10 +4,12 @@ import ( "context" "errors" - "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" "github.com/ledgerwatch/log/v3" + + "github.com/ledgerwatch/erigon/polygon/heimdall" + + "github.com/ledgerwatch/erigon-lib/common" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" ) var ( diff --git a/consensus/bor/genesis_contract.go b/polygon/bor/genesis_contract.go similarity index 100% rename from consensus/bor/genesis_contract.go rename to polygon/bor/genesis_contract.go diff --git a/consensus/bor/merkle.go b/polygon/bor/merkle.go similarity index 100% rename from consensus/bor/merkle.go rename to polygon/bor/merkle.go diff --git a/consensus/bor/mock/genesis_contract_mock.go b/polygon/bor/mock/genesis_contract_mock.go similarity index 96% rename from consensus/bor/mock/genesis_contract_mock.go rename to polygon/bor/mock/genesis_contract_mock.go index 9ad12ae63..475ae6ece 100644 --- a/consensus/bor/mock/genesis_contract_mock.go +++ b/polygon/bor/mock/genesis_contract_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ledgerwatch/erigon/consensus/bor (interfaces: GenesisContract) +// Source: github.com/ledgerwatch/erigon/polygon/bor (interfaces: GenesisContract) // Package mock is a generated GoMock package. package mock diff --git a/consensus/bor/mock/spanner_mock.go b/polygon/bor/mock/spanner_mock.go similarity index 94% rename from consensus/bor/mock/spanner_mock.go rename to polygon/bor/mock/spanner_mock.go index 70db933ed..07c9b881b 100644 --- a/consensus/bor/mock/spanner_mock.go +++ b/polygon/bor/mock/spanner_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ledgerwatch/erigon/consensus/bor (interfaces: Spanner) +// Source: github.com/ledgerwatch/erigon/polygon/bor (interfaces: Spanner) // Package mock is a generated GoMock package. package mock @@ -10,8 +10,8 @@ import ( gomock "github.com/golang/mock/gomock" common "github.com/ledgerwatch/erigon-lib/common" consensus "github.com/ledgerwatch/erigon/consensus" - span "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - valset "github.com/ledgerwatch/erigon/consensus/bor/valset" + span "github.com/ledgerwatch/erigon/polygon/heimdall/span" + valset "github.com/ledgerwatch/erigon/polygon/bor/valset" ) // MockSpanner is a mock of Spanner interface. diff --git a/consensus/bor/snapshot.go b/polygon/bor/snapshot.go similarity index 98% rename from consensus/bor/snapshot.go rename to polygon/bor/snapshot.go index 8eabd3241..7d0551648 100644 --- a/consensus/bor/snapshot.go +++ b/polygon/bor/snapshot.go @@ -10,9 +10,9 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) // Snapshot is the state of the authorization voting at a given point in time. diff --git a/consensus/bor/snapshot_test.go b/polygon/bor/snapshot_test.go similarity index 97% rename from consensus/bor/snapshot_test.go rename to polygon/bor/snapshot_test.go index d3d827ab3..c5bdb2154 100644 --- a/consensus/bor/snapshot_test.go +++ b/polygon/bor/snapshot_test.go @@ -6,8 +6,8 @@ import ( "testing" libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/log/v3" "github.com/maticnetwork/crand" "github.com/stretchr/testify/require" diff --git a/consensus/bor/spanner.go b/polygon/bor/spanner.go similarity index 84% rename from consensus/bor/spanner.go rename to polygon/bor/spanner.go index 77769ea83..ab7710dd5 100644 --- a/consensus/bor/spanner.go +++ b/polygon/bor/spanner.go @@ -1,10 +1,11 @@ package bor import ( + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) //go:generate mockgen -destination=./mock/spanner_mock.go -package=mock . Spanner diff --git a/consensus/bor/statefull/processor.go b/polygon/bor/statefull/processor.go similarity index 100% rename from consensus/bor/statefull/processor.go rename to polygon/bor/statefull/processor.go diff --git a/consensus/bor/valset/error.go b/polygon/bor/valset/error.go similarity index 100% rename from consensus/bor/valset/error.go rename to polygon/bor/valset/error.go diff --git a/consensus/bor/valset/validator.go b/polygon/bor/valset/validator.go similarity index 100% rename from consensus/bor/valset/validator.go rename to polygon/bor/valset/validator.go diff --git a/consensus/bor/valset/validator_set.go b/polygon/bor/valset/validator_set.go similarity index 100% rename from consensus/bor/valset/validator_set.go rename to polygon/bor/valset/validator_set.go diff --git a/consensus/bor/heimdall/checkpoint/checkpoint.go b/polygon/heimdall/checkpoint/checkpoint.go similarity index 100% rename from consensus/bor/heimdall/checkpoint/checkpoint.go rename to polygon/heimdall/checkpoint/checkpoint.go diff --git a/consensus/bor/heimdall/client.go b/polygon/heimdall/client.go similarity index 98% rename from consensus/bor/heimdall/client.go rename to polygon/heimdall/client.go index 0085a6360..6b2f83c6f 100644 --- a/consensus/bor/heimdall/client.go +++ b/polygon/heimdall/client.go @@ -15,11 +15,12 @@ import ( "github.com/ledgerwatch/log/v3" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/metrics" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" ) var ( diff --git a/consensus/bor/heimdall/client_test.go b/polygon/heimdall/client_test.go similarity index 96% rename from consensus/bor/heimdall/client_test.go rename to polygon/heimdall/client_test.go index 8f3c88e76..b8804bba6 100644 --- a/consensus/bor/heimdall/client_test.go +++ b/polygon/heimdall/client_test.go @@ -11,7 +11,8 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/mock" + "github.com/ledgerwatch/erigon/polygon/heimdall/mock" + "github.com/ledgerwatch/erigon/turbo/testlog" ) diff --git a/consensus/bor/heimdall/heimdall.go b/polygon/heimdall/heimdall.go similarity index 85% rename from consensus/bor/heimdall/heimdall.go rename to polygon/heimdall/heimdall.go index 6d81f1aac..673a5ff4a 100644 --- a/consensus/bor/heimdall/heimdall.go +++ b/polygon/heimdall/heimdall.go @@ -3,11 +3,12 @@ package heimdall import ( "context" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" - "github.com/ledgerwatch/erigon/consensus/bor/finality/generics" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + + "github.com/ledgerwatch/erigon/polygon/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/finality/generics" ) func MilestoneRewindPending() bool { diff --git a/consensus/bor/heimdallgrpc/checkpoint.go b/polygon/heimdall/heimdallgrpc/checkpoint.go similarity index 94% rename from consensus/bor/heimdallgrpc/checkpoint.go rename to polygon/heimdall/heimdallgrpc/checkpoint.go index 17a86ae9e..f02398a3b 100644 --- a/consensus/bor/heimdallgrpc/checkpoint.go +++ b/polygon/heimdall/heimdallgrpc/checkpoint.go @@ -4,7 +4,7 @@ import ( "context" "math/big" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" proto "github.com/maticnetwork/polyproto/heimdall" protoutils "github.com/maticnetwork/polyproto/utils" diff --git a/consensus/bor/heimdallgrpc/client.go b/polygon/heimdall/heimdallgrpc/client.go similarity index 100% rename from consensus/bor/heimdallgrpc/client.go rename to polygon/heimdall/heimdallgrpc/client.go diff --git a/consensus/bor/heimdallgrpc/milestone.go b/polygon/heimdall/heimdallgrpc/milestone.go similarity index 97% rename from consensus/bor/heimdallgrpc/milestone.go rename to polygon/heimdall/heimdallgrpc/milestone.go index a42bab955..a20b4d7dc 100644 --- a/consensus/bor/heimdallgrpc/milestone.go +++ b/polygon/heimdall/heimdallgrpc/milestone.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" proto "github.com/maticnetwork/polyproto/heimdall" protoutils "github.com/maticnetwork/polyproto/utils" diff --git a/consensus/bor/heimdallgrpc/server.go b/polygon/heimdall/heimdallgrpc/server.go similarity index 99% rename from consensus/bor/heimdallgrpc/server.go rename to polygon/heimdall/heimdallgrpc/server.go index 8139c33dd..ea0ee45ad 100644 --- a/consensus/bor/heimdallgrpc/server.go +++ b/polygon/heimdall/heimdallgrpc/server.go @@ -6,8 +6,6 @@ import ( "net" "time" - "github.com/ledgerwatch/erigon-lib/gointerfaces" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" "github.com/ledgerwatch/log/v3" proto "github.com/maticnetwork/polyproto/heimdall" "google.golang.org/grpc" @@ -15,6 +13,10 @@ import ( "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" "google.golang.org/protobuf/types/known/timestamppb" + + "github.com/ledgerwatch/erigon/polygon/heimdall" + + "github.com/ledgerwatch/erigon-lib/gointerfaces" ) type HeimdallGRPCServer struct { diff --git a/consensus/bor/heimdallgrpc/span.go b/polygon/heimdall/heimdallgrpc/span.go similarity index 93% rename from consensus/bor/heimdallgrpc/span.go rename to polygon/heimdall/heimdallgrpc/span.go index 7bc6ddb8f..9d9a24b78 100644 --- a/consensus/bor/heimdallgrpc/span.go +++ b/polygon/heimdall/heimdallgrpc/span.go @@ -3,8 +3,9 @@ package heimdallgrpc import ( "context" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + + "github.com/ledgerwatch/erigon/polygon/bor/valset" proto "github.com/maticnetwork/polyproto/heimdall" protoutils "github.com/maticnetwork/polyproto/utils" diff --git a/consensus/bor/heimdallgrpc/state_sync.go b/polygon/heimdall/heimdallgrpc/state_sync.go similarity index 96% rename from consensus/bor/heimdallgrpc/state_sync.go rename to polygon/heimdall/heimdallgrpc/state_sync.go index e1b49e67d..0d32a1908 100644 --- a/consensus/bor/heimdallgrpc/state_sync.go +++ b/polygon/heimdall/heimdallgrpc/state_sync.go @@ -6,7 +6,7 @@ import ( "io" libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/clerk" + "github.com/ledgerwatch/erigon/polygon/bor/clerk" proto "github.com/maticnetwork/polyproto/heimdall" ) diff --git a/consensus/bor/heimdall/metrics.go b/polygon/heimdall/metrics.go similarity index 100% rename from consensus/bor/heimdall/metrics.go rename to polygon/heimdall/metrics.go diff --git a/consensus/bor/heimdall/milestone/milestone.go b/polygon/heimdall/milestone/milestone.go similarity index 100% rename from consensus/bor/heimdall/milestone/milestone.go rename to polygon/heimdall/milestone/milestone.go diff --git a/consensus/bor/heimdall/mock/heimdall_client_mock.go b/polygon/heimdall/mock/heimdall_client_mock.go similarity index 94% rename from consensus/bor/heimdall/mock/heimdall_client_mock.go rename to polygon/heimdall/mock/heimdall_client_mock.go index e7d29b17e..de1762716 100644 --- a/consensus/bor/heimdall/mock/heimdall_client_mock.go +++ b/polygon/heimdall/mock/heimdall_client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ledgerwatch/erigon/consensus/bor/heimdall (interfaces: IHeimdallClient) +// Source: github.com/ledgerwatch/erigon/polygon/heimdall (interfaces: IHeimdallClient) // Package mock is a generated GoMock package. package mock @@ -9,10 +9,10 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - clerk "github.com/ledgerwatch/erigon/consensus/bor/clerk" - checkpoint "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - milestone "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - span "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" + clerk "github.com/ledgerwatch/erigon/polygon/bor/clerk" + checkpoint "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + milestone "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + span "github.com/ledgerwatch/erigon/polygon/heimdall/span" ) // MockIHeimdallClient is a mock of IHeimdallClient interface. diff --git a/consensus/bor/heimdall/mock/http_client_mock.go b/polygon/heimdall/mock/http_client_mock.go similarity index 95% rename from consensus/bor/heimdall/mock/http_client_mock.go rename to polygon/heimdall/mock/http_client_mock.go index aa6310b17..b41cfa8f1 100644 --- a/consensus/bor/heimdall/mock/http_client_mock.go +++ b/polygon/heimdall/mock/http_client_mock.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/ledgerwatch/erigon/consensus/bor/heimdall (interfaces: HttpClient) +// Source: github.com/ledgerwatch/erigon/polygon/heimdall (interfaces: HttpClient) // Package mock is a generated GoMock package. package mock diff --git a/consensus/bor/heimdall/span/span.go b/polygon/heimdall/span/span.go similarity index 94% rename from consensus/bor/heimdall/span/span.go rename to polygon/heimdall/span/span.go index 22d3dff25..7ab715b53 100644 --- a/consensus/bor/heimdall/span/span.go +++ b/polygon/heimdall/span/span.go @@ -2,7 +2,7 @@ package span import ( "github.com/google/btree" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) // Span represents a current bor span diff --git a/consensus/bor/heimdall/span/span_id.go b/polygon/heimdall/span/span_id.go similarity index 94% rename from consensus/bor/heimdall/span/span_id.go rename to polygon/heimdall/span/span_id.go index 509552128..0485aa6fb 100644 --- a/consensus/bor/heimdall/span/span_id.go +++ b/polygon/heimdall/span/span_id.go @@ -1,7 +1,7 @@ package span import ( - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" ) const ( diff --git a/consensus/bor/heimdall/span/span_id_test.go b/polygon/heimdall/span/span_id_test.go similarity index 95% rename from consensus/bor/heimdall/span/span_id_test.go rename to polygon/heimdall/span/span_id_test.go index a7c80891c..34c2b669f 100644 --- a/consensus/bor/heimdall/span/span_id_test.go +++ b/polygon/heimdall/span/span_id_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" ) func TestSpanIDAt(t *testing.T) { diff --git a/consensus/bor/heimdall/span/spanner.go b/polygon/heimdall/span/spanner.go similarity index 96% rename from consensus/bor/heimdall/span/spanner.go rename to polygon/heimdall/span/spanner.go index 9af95abf7..315617f9e 100644 --- a/consensus/bor/heimdall/span/spanner.go +++ b/polygon/heimdall/span/spanner.go @@ -10,9 +10,9 @@ import ( "github.com/ledgerwatch/erigon-lib/chain" libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor/abi" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/abi" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rlp" ) diff --git a/consensus/bor/heimdall/span/testValidators.go b/polygon/heimdall/span/testValidators.go similarity index 95% rename from consensus/bor/heimdall/span/testValidators.go rename to polygon/heimdall/span/testValidators.go index 29cf1cc2e..1dfaa722e 100644 --- a/consensus/bor/heimdall/span/testValidators.go +++ b/polygon/heimdall/span/testValidators.go @@ -3,7 +3,7 @@ package span import ( "github.com/ledgerwatch/erigon-lib/chain/networkname" "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) // NetworkNameVals is a map of network name to validator set for tests/devnets diff --git a/polygon/sync/canonical_chain_builder.go b/polygon/sync/canonical_chain_builder.go index 9acd3cf07..0ddcf2c32 100644 --- a/polygon/sync/canonical_chain_builder.go +++ b/polygon/sync/canonical_chain_builder.go @@ -5,8 +5,8 @@ import ( "fmt" libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor" ) //go:generate mockgen -destination=./mock/canonical_chain_builder_mock.go -package=mock . CanonicalChainBuilder diff --git a/polygon/sync/canonical_chain_builder_test.go b/polygon/sync/canonical_chain_builder_test.go index 802009e2c..a515738b7 100644 --- a/polygon/sync/canonical_chain_builder_test.go +++ b/polygon/sync/canonical_chain_builder_test.go @@ -9,7 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - heimdallspan "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" + heimdallspan "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon/core/types" ) diff --git a/polygon/sync/difficulty.go b/polygon/sync/difficulty.go index c63205002..74ec83958 100644 --- a/polygon/sync/difficulty.go +++ b/polygon/sync/difficulty.go @@ -6,12 +6,13 @@ import ( "github.com/ledgerwatch/erigon/eth/stagedsync" + heimdallspan "github.com/ledgerwatch/erigon/polygon/heimdall/span" + libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - heimdallspan "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) type DifficultyCalculator interface { diff --git a/polygon/sync/difficulty_test.go b/polygon/sync/difficulty_test.go index 77b0711c3..11d463952 100644 --- a/polygon/sync/difficulty_test.go +++ b/polygon/sync/difficulty_test.go @@ -8,10 +8,11 @@ import ( "github.com/stretchr/testify/require" + heimdallspan "github.com/ledgerwatch/erigon/polygon/heimdall/span" + libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" - heimdallspan "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" ) type testValidatorSetInterface struct { diff --git a/polygon/sync/header_downloader_test.go b/polygon/sync/header_downloader_test.go index f60ef0c65..ae650902a 100644 --- a/polygon/sync/header_downloader_test.go +++ b/polygon/sync/header_downloader_test.go @@ -12,9 +12,10 @@ import ( "github.com/ledgerwatch/log/v3" "github.com/stretchr/testify/require" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/polygon/sync/mock" "github.com/ledgerwatch/erigon/polygon/sync/peerinfo" diff --git a/polygon/sync/heimdall.go b/polygon/sync/heimdall.go index cdf8077b9..b3e3f1e95 100644 --- a/polygon/sync/heimdall.go +++ b/polygon/sync/heimdall.go @@ -8,11 +8,12 @@ import ( "github.com/ledgerwatch/log/v3" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" ) // Heimdall is a wrapper of Heimdall HTTP API diff --git a/polygon/sync/heimdall_test.go b/polygon/sync/heimdall_test.go index 2036feb84..2d809749d 100644 --- a/polygon/sync/heimdall_test.go +++ b/polygon/sync/heimdall_test.go @@ -11,10 +11,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - heimdallclient "github.com/ledgerwatch/erigon/consensus/bor/heimdall" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - heimdallmock "github.com/ledgerwatch/erigon/consensus/bor/heimdall/mock" + heimdallclient "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + heimdallmock "github.com/ledgerwatch/erigon/polygon/heimdall/mock" ) func makeCheckpoint(start uint64, len uint) *checkpoint.Checkpoint { diff --git a/polygon/sync/mock/heimdall_mock.go b/polygon/sync/mock/heimdall_mock.go index c38947dc5..fe887f30b 100644 --- a/polygon/sync/mock/heimdall_mock.go +++ b/polygon/sync/mock/heimdall_mock.go @@ -9,9 +9,9 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - checkpoint "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - milestone "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" - span "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" + checkpoint "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + milestone "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + span "github.com/ledgerwatch/erigon/polygon/heimdall/span" ) // MockHeimdall is a mock of Heimdall interface. diff --git a/polygon/sync/state_point.go b/polygon/sync/state_point.go index dfd61da38..cad44407d 100644 --- a/polygon/sync/state_point.go +++ b/polygon/sync/state_point.go @@ -3,9 +3,10 @@ package sync import ( "math/big" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" + "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" ) func statePointFromCheckpoint(checkpoint *checkpoint.Checkpoint) *statePoint { diff --git a/polygon/sync/state_points.go b/polygon/sync/state_points.go index 5577f24d2..e88c3160c 100644 --- a/polygon/sync/state_points.go +++ b/polygon/sync/state_points.go @@ -1,8 +1,8 @@ package sync import ( - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/checkpoint" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/milestone" + "github.com/ledgerwatch/erigon/polygon/heimdall/checkpoint" + "github.com/ledgerwatch/erigon/polygon/heimdall/milestone" ) func statePointsFromCheckpoints(checkpoints []*checkpoint.Checkpoint) statePoints { diff --git a/tests/bor/helper/miner.go b/tests/bor/helper/miner.go index 970116db6..ab94206a8 100644 --- a/tests/bor/helper/miner.go +++ b/tests/bor/helper/miner.go @@ -5,7 +5,7 @@ import ( "crypto/ecdsa" "encoding/json" "fmt" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "math/big" "os" "time" diff --git a/turbo/jsonrpc/bor_api.go b/turbo/jsonrpc/bor_api.go index 41ee908d3..835bd8cc1 100644 --- a/turbo/jsonrpc/bor_api.go +++ b/turbo/jsonrpc/bor_api.go @@ -7,8 +7,8 @@ import ( "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rpc" ) diff --git a/turbo/jsonrpc/bor_helper.go b/turbo/jsonrpc/bor_helper.go index 34a5ec35f..dd9ef47d5 100644 --- a/turbo/jsonrpc/bor_helper.go +++ b/turbo/jsonrpc/bor_helper.go @@ -9,12 +9,12 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/crypto" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/rpchelper" ) diff --git a/turbo/jsonrpc/bor_snapshot.go b/turbo/jsonrpc/bor_snapshot.go index 0fb6389c3..0b41a8117 100644 --- a/turbo/jsonrpc/bor_snapshot.go +++ b/turbo/jsonrpc/bor_snapshot.go @@ -10,14 +10,14 @@ import ( "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" - "github.com/ledgerwatch/erigon/consensus/bor/valset" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/types" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" + "github.com/ledgerwatch/erigon/polygon/bor/valset" "github.com/ledgerwatch/erigon/rpc" ) diff --git a/turbo/jsonrpc/daemon.go b/turbo/jsonrpc/daemon.go index ce98b9bbd..ca89bcd08 100644 --- a/turbo/jsonrpc/daemon.go +++ b/turbo/jsonrpc/daemon.go @@ -7,8 +7,8 @@ import ( libstate "github.com/ledgerwatch/erigon-lib/state" "github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli/httpcfg" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" "github.com/ledgerwatch/erigon/consensus/clique" + "github.com/ledgerwatch/erigon/polygon/bor" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/rpchelper" "github.com/ledgerwatch/erigon/turbo/services" diff --git a/turbo/jsonrpc/erigon_system.go b/turbo/jsonrpc/erigon_system.go index eac0b3515..54bcf65d4 100644 --- a/turbo/jsonrpc/erigon_system.go +++ b/turbo/jsonrpc/erigon_system.go @@ -7,9 +7,9 @@ import ( "github.com/ledgerwatch/erigon-lib/common" - borfinality "github.com/ledgerwatch/erigon/consensus/bor/finality" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" "github.com/ledgerwatch/erigon/core/forkid" + borfinality "github.com/ledgerwatch/erigon/polygon/bor/finality" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" "github.com/ledgerwatch/erigon/rpc" "github.com/ledgerwatch/erigon/turbo/rpchelper" ) diff --git a/turbo/jsonrpc/eth_block.go b/turbo/jsonrpc/eth_block.go index 50cfca6e2..e40cbff92 100644 --- a/turbo/jsonrpc/eth_block.go +++ b/turbo/jsonrpc/eth_block.go @@ -8,7 +8,7 @@ import ( "github.com/ledgerwatch/erigon-lib/common/hexutil" "github.com/ledgerwatch/erigon/cl/clparams" - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "github.com/ledgerwatch/log/v3" diff --git a/turbo/jsonrpc/validator_set.go b/turbo/jsonrpc/validator_set.go index 70c6a5ee5..7f4ddf735 100644 --- a/turbo/jsonrpc/validator_set.go +++ b/turbo/jsonrpc/validator_set.go @@ -13,7 +13,7 @@ import ( libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/log/v3" - "github.com/ledgerwatch/erigon/consensus/bor/valset" + "github.com/ledgerwatch/erigon/polygon/bor/valset" ) // MaxTotalVotingPower - the maximum allowed total voting power. diff --git a/turbo/rpchelper/helper.go b/turbo/rpchelper/helper.go index 497eaa952..2a6ccc054 100644 --- a/turbo/rpchelper/helper.go +++ b/turbo/rpchelper/helper.go @@ -9,13 +9,13 @@ import ( "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv/kvcache" "github.com/ledgerwatch/erigon-lib/kv/rawdbv3" - borfinality "github.com/ledgerwatch/erigon/consensus/bor/finality" - "github.com/ledgerwatch/erigon/consensus/bor/finality/whitelist" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/state" "github.com/ledgerwatch/erigon/core/systemcontracts" "github.com/ledgerwatch/erigon/eth/ethconfig" "github.com/ledgerwatch/erigon/eth/stagedsync/stages" + borfinality "github.com/ledgerwatch/erigon/polygon/bor/finality" + "github.com/ledgerwatch/erigon/polygon/bor/finality/whitelist" "github.com/ledgerwatch/erigon/rpc" ) diff --git a/turbo/snapshotsync/freezeblocks/block_reader.go b/turbo/snapshotsync/freezeblocks/block_reader.go index 6f20332bf..848370531 100644 --- a/turbo/snapshotsync/freezeblocks/block_reader.go +++ b/turbo/snapshotsync/freezeblocks/block_reader.go @@ -8,6 +8,10 @@ import ( "math" "sort" + "github.com/ledgerwatch/log/v3" + + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon-lib/common/dbg" "github.com/ledgerwatch/erigon-lib/common/length" @@ -15,13 +19,11 @@ import ( "github.com/ledgerwatch/erigon-lib/gointerfaces/remote" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/recsplit" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/eth/ethconfig" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/turbo/services" - "github.com/ledgerwatch/log/v3" ) type RemoteBlockReader struct { diff --git a/turbo/snapshotsync/freezeblocks/block_snapshots.go b/turbo/snapshotsync/freezeblocks/block_snapshots.go index 7bd828011..200d0bee5 100644 --- a/turbo/snapshotsync/freezeblocks/block_snapshots.go +++ b/turbo/snapshotsync/freezeblocks/block_snapshots.go @@ -21,6 +21,8 @@ import ( "golang.org/x/exp/slices" "golang.org/x/sync/errgroup" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/chain/snapcfg" common2 "github.com/ledgerwatch/erigon-lib/common" @@ -38,7 +40,6 @@ import ( "github.com/ledgerwatch/erigon-lib/recsplit" types2 "github.com/ledgerwatch/erigon-lib/types" "github.com/ledgerwatch/erigon/cmd/hack/tool/fromdb" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/rawdb/blockio" "github.com/ledgerwatch/erigon/core/types" diff --git a/turbo/snapshotsync/freezeblocks/bor_snapshots.go b/turbo/snapshotsync/freezeblocks/bor_snapshots.go index 62ff94ec8..39a683bbf 100644 --- a/turbo/snapshotsync/freezeblocks/bor_snapshots.go +++ b/turbo/snapshotsync/freezeblocks/bor_snapshots.go @@ -17,6 +17,8 @@ import ( "github.com/ledgerwatch/log/v3" "golang.org/x/exp/slices" + "github.com/ledgerwatch/erigon/polygon/heimdall/span" + "github.com/ledgerwatch/erigon-lib/chain" "github.com/ledgerwatch/erigon-lib/chain/snapcfg" common2 "github.com/ledgerwatch/erigon-lib/common" @@ -30,7 +32,6 @@ import ( "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/recsplit" "github.com/ledgerwatch/erigon/cmd/hack/tool/fromdb" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall/span" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/eth/ethconfig" diff --git a/turbo/snapshotsync/freezeblocks/dump_test.go b/turbo/snapshotsync/freezeblocks/dump_test.go index a3de0bad2..e056c64d2 100644 --- a/turbo/snapshotsync/freezeblocks/dump_test.go +++ b/turbo/snapshotsync/freezeblocks/dump_test.go @@ -1,7 +1,7 @@ package freezeblocks_test import ( - "github.com/ledgerwatch/erigon/consensus/bor/borcfg" + "github.com/ledgerwatch/erigon/polygon/bor/borcfg" "math/big" "testing" diff --git a/turbo/stages/mock/mock_sentry.go b/turbo/stages/mock/mock_sentry.go index af9bf9241..eb973d9d7 100644 --- a/turbo/stages/mock/mock_sentry.go +++ b/turbo/stages/mock/mock_sentry.go @@ -35,7 +35,6 @@ import ( types2 "github.com/ledgerwatch/erigon-lib/types" "github.com/ledgerwatch/erigon-lib/wrap" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" "github.com/ledgerwatch/erigon/consensus/ethash" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/rawdb" @@ -54,6 +53,7 @@ import ( "github.com/ledgerwatch/erigon/p2p" "github.com/ledgerwatch/erigon/p2p/sentry/sentry_multi_client" "github.com/ledgerwatch/erigon/params" + "github.com/ledgerwatch/erigon/polygon/bor" "github.com/ledgerwatch/erigon/rlp" "github.com/ledgerwatch/erigon/turbo/builder" "github.com/ledgerwatch/erigon/turbo/engineapi/engine_helpers" diff --git a/turbo/stages/stageloop.go b/turbo/stages/stageloop.go index 18537dc68..951dc4b7b 100644 --- a/turbo/stages/stageloop.go +++ b/turbo/stages/stageloop.go @@ -21,10 +21,9 @@ import ( "github.com/ledgerwatch/erigon-lib/state" "github.com/ledgerwatch/erigon-lib/wrap" + "github.com/ledgerwatch/erigon/polygon/heimdall" + "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" - "github.com/ledgerwatch/erigon/consensus/bor/finality/flags" - "github.com/ledgerwatch/erigon/consensus/bor/heimdall" "github.com/ledgerwatch/erigon/consensus/misc" "github.com/ledgerwatch/erigon/core/rawdb" "github.com/ledgerwatch/erigon/core/rawdb/blockio" @@ -35,6 +34,8 @@ import ( "github.com/ledgerwatch/erigon/eth/stagedsync/stages" "github.com/ledgerwatch/erigon/p2p" "github.com/ledgerwatch/erigon/p2p/sentry/sentry_multi_client" + "github.com/ledgerwatch/erigon/polygon/bor" + "github.com/ledgerwatch/erigon/polygon/bor/finality/flags" "github.com/ledgerwatch/erigon/turbo/engineapi/engine_helpers" "github.com/ledgerwatch/erigon/turbo/services" "github.com/ledgerwatch/erigon/turbo/shards" diff --git a/turbo/transactions/tracing.go b/turbo/transactions/tracing.go index 31c85f9c2..5f56a6071 100644 --- a/turbo/transactions/tracing.go +++ b/turbo/transactions/tracing.go @@ -17,7 +17,6 @@ import ( ethereum "github.com/ledgerwatch/erigon" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor/statefull" "github.com/ledgerwatch/erigon/core" "github.com/ledgerwatch/erigon/core/state" "github.com/ledgerwatch/erigon/core/types" @@ -26,6 +25,7 @@ import ( "github.com/ledgerwatch/erigon/eth/stagedsync" "github.com/ledgerwatch/erigon/eth/tracers" "github.com/ledgerwatch/erigon/eth/tracers/logger" + "github.com/ledgerwatch/erigon/polygon/bor/statefull" "github.com/ledgerwatch/erigon/turbo/rpchelper" "github.com/ledgerwatch/erigon/turbo/services" )