diff --git a/cl/beacon/handler/block_production.go b/cl/beacon/handler/block_production.go index 5c2c6700a3e..c6b607f8927 100644 --- a/cl/beacon/handler/block_production.go +++ b/cl/beacon/handler/block_production.go @@ -33,30 +33,6 @@ import ( "time" "github.com/go-chi/chi/v5" -<<<<<<< HEAD - "github.com/ledgerwatch/erigon-lib/common" - libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon-lib/common/hexutil" - "github.com/ledgerwatch/erigon-lib/common/length" - "github.com/ledgerwatch/erigon-lib/gointerfaces/sentinel" - "github.com/ledgerwatch/erigon-lib/kv" - "github.com/ledgerwatch/erigon/cl/abstract" - "github.com/ledgerwatch/erigon/cl/beacon/beaconhttp" - "github.com/ledgerwatch/erigon/cl/clparams" - "github.com/ledgerwatch/erigon/cl/cltypes" - "github.com/ledgerwatch/erigon/cl/cltypes/solid" - "github.com/ledgerwatch/erigon/cl/gossip" - "github.com/ledgerwatch/erigon/cl/persistence/beacon_indicies" - "github.com/ledgerwatch/erigon/cl/phase1/core/state" - "github.com/ledgerwatch/erigon/cl/transition" - "github.com/ledgerwatch/erigon/cl/transition/impl/eth2" - "github.com/ledgerwatch/erigon/cl/transition/machine" - "github.com/ledgerwatch/erigon/cl/utils" - "github.com/ledgerwatch/erigon/core/types" - "github.com/ledgerwatch/erigon/turbo/engineapi/engine_types" - "github.com/ledgerwatch/log/v3" - "golang.org/x/exp/slices" -======= "golang.org/x/exp/slices" "github.com/erigontech/erigon-lib/common" @@ -81,7 +57,6 @@ import ( "github.com/erigontech/erigon/cl/utils" "github.com/erigontech/erigon/core/types" "github.com/erigontech/erigon/turbo/engineapi/engine_types" ->>>>>>> v3.0.0-alpha1 ) type BlockPublishingValidation string @@ -170,8 +145,6 @@ func (a *ApiHandler) GetEthV3ValidatorBlock( http.StatusBadRequest, fmt.Errorf("invalid slot: %v", err), ) -<<<<<<< HEAD -======= } // builder boost factor controls block choice between local execution node or builder @@ -185,7 +158,6 @@ func (a *ApiHandler) GetEthV3ValidatorBlock( fmt.Errorf("invalid builder_boost_factor: %v", err), ) } ->>>>>>> v3.0.0-alpha1 } s := a.syncedData.HeadState() @@ -229,55 +201,15 @@ func (a *ApiHandler) GetEthV3ValidatorBlock( if err := transition.DefaultMachine.ProcessSlots(baseState, targetSlot); err != nil { return nil, err } -<<<<<<< HEAD - - beaconBody, executionValue, err := a.produceBeaconBody( - ctx, - 3, - sourceBlock.Block, - baseState, - targetSlot, - randaoReveal, - graffiti, - ) -======= block, err := a.produceBlock(ctx, builderBoostFactor, sourceBlock.Block, baseState, targetSlot, randaoReveal, graffiti) ->>>>>>> v3.0.0-alpha1 if err != nil { log.Warn("Failed to produce block", "err", err, "slot", targetSlot) return nil, err } -<<<<<<< HEAD - proposerIndex, err := baseState.GetBeaconProposerIndex() - if err != nil { - return nil, err - } - - rewardsCollector := ð2.BlockRewardsCollector{} - block := &cltypes.BeaconBlock{ - Slot: targetSlot, - ProposerIndex: proposerIndex, - ParentRoot: baseBlockRoot, - Body: beaconBody, - } - log.Info( - "BlockProduction: Computing HashSSZ block", - "slot", - targetSlot, - "execution_value", - executionValue, - "proposerIndex", - proposerIndex, - ) - - // compute the state root now - if err := machine.ProcessBlock(transition.DefaultMachine, baseState, &cltypes.SignedBeaconBlock{Block: block}); err != nil { -======= // do state transition if err := machine.ProcessBlock(transition.DefaultMachine, baseState, block.ToGeneric()); err != nil { log.Warn("Failed to process execution block", "err", err, "slot", targetSlot) ->>>>>>> v3.0.0-alpha1 return nil, err } block.StateRoot, err = baseState.HashSSZ() @@ -298,10 +230,6 @@ func (a *ApiHandler) GetEthV3ValidatorBlock( // todo: consensusValue rewardsCollector := ð2.BlockRewardsCollector{} consensusValue := rewardsCollector.Attestations + rewardsCollector.ProposerSlashings + rewardsCollector.AttesterSlashings + rewardsCollector.SyncAggregate -<<<<<<< HEAD - isSSZBlinded := false -======= ->>>>>>> v3.0.0-alpha1 a.setupHeaderReponseForBlockProduction( w, block.Version(), @@ -321,8 +249,6 @@ func (a *ApiHandler) GetEthV3ValidatorBlock( With("consensus_block_value", strconv.FormatUint(consensusValue, 10)), nil } -<<<<<<< HEAD -======= func (a *ApiHandler) produceBlock( ctx context.Context, boostFactor uint64, @@ -504,7 +430,6 @@ func (a *ApiHandler) getBuilderPayload( return header, nil } ->>>>>>> v3.0.0-alpha1 func (a *ApiHandler) produceBeaconBody( ctx context.Context, apiVersion int, @@ -985,14 +910,8 @@ func (a *ApiHandler) parseBlockPublishingValidation( func (a *ApiHandler) parseRequestBeaconBlock( version clparams.StateVersion, r *http.Request, -<<<<<<< HEAD -) (*cltypes.SignedBeaconBlock, error) { - block := cltypes.NewSignedBeaconBlock(a.beaconChainCfg) - block.Block.Body.Version = version -======= ) (*cltypes.DenebSignedBeaconBlock, error) { block := cltypes.NewDenebSignedBeaconBlock(a.beaconChainCfg) ->>>>>>> v3.0.0-alpha1 // check content type switch r.Header.Get("Content-Type") { case "application/json": diff --git a/cl/beacon/handler/handler.go b/cl/beacon/handler/handler.go index d0f7865e90e..ef6cc8fc34f 100644 --- a/cl/beacon/handler/handler.go +++ b/cl/beacon/handler/handler.go @@ -244,11 +244,7 @@ func (a *ApiHandler) init() { r.Get("/{block_id}", beaconhttp.HandleEndpointFunc(a.getHeader)) }) r.Route("/blocks", func(r chi.Router) { -<<<<<<< HEAD - r.Post("/", a.PostEthV1BeaconBlocks) -======= r.Post("/", beaconhttp.HandleEndpointFunc(a.PostEthV1BeaconBlocks)) ->>>>>>> v3.0.0-alpha1 r.Get("/{block_id}", beaconhttp.HandleEndpointFunc(a.GetEthV1BeaconBlock)) r.Get("/{block_id}/attestations", beaconhttp.HandleEndpointFunc(a.GetEthV1BeaconBlockAttestations)) r.Get("/{block_id}/root", beaconhttp.HandleEndpointFunc(a.GetEthV1BeaconBlockRoot)) @@ -328,14 +324,10 @@ func (a *ApiHandler) init() { if a.routerCfg.Beacon { r.Route("/beacon", func(r chi.Router) { r.Get("/blocks/{block_id}", beaconhttp.HandleEndpointFunc(a.GetEthV1BeaconBlock)) -<<<<<<< HEAD - r.Post("/blocks", a.PostEthV2BeaconBlocks) -======= r.Post("/blocks", beaconhttp.HandleEndpointFunc(a.PostEthV2BeaconBlocks)) if a.routerCfg.Builder { r.Post("/blinded_blocks", beaconhttp.HandleEndpointFunc(a.PostEthV2BlindedBlocks)) } ->>>>>>> v3.0.0-alpha1 }) } if a.routerCfg.Validator { diff --git a/cl/beacon/handler/node.go b/cl/beacon/handler/node.go index 49740421058..c1f900a66f9 100644 --- a/cl/beacon/handler/node.go +++ b/cl/beacon/handler/node.go @@ -23,13 +23,8 @@ import ( "runtime" "strconv" -<<<<<<< HEAD - "github.com/ledgerwatch/erigon-lib/gointerfaces/sentinel" - "github.com/ledgerwatch/erigon/cl/beacon/beaconhttp" -======= sentinel "github.com/erigontech/erigon-lib/gointerfaces/sentinelproto" "github.com/erigontech/erigon/cl/beacon/beaconhttp" ->>>>>>> v3.0.0-alpha1 ) /* diff --git a/cl/clparams/config.go b/cl/clparams/config.go index 5327302c8ef..055c3bd68bf 100644 --- a/cl/clparams/config.go +++ b/cl/clparams/config.go @@ -304,13 +304,7 @@ func (b ConfigByte) MarshalJSON() ([]byte, error) { type ConfigForkVersion uint32 func (v ConfigForkVersion) MarshalJSON() ([]byte, error) { -<<<<<<< HEAD - tmp := make([]byte, 4) - binary.BigEndian.PutUint32(tmp, uint32(v)) - return []byte(fmt.Sprintf("\"0x%x\"", tmp)), nil -======= return []byte(fmt.Sprintf("\"0x%08x\"", v)), nil ->>>>>>> v3.0.0-alpha1 } // BeaconChainConfig contains constant configs for node to participate in beacon chain. diff --git a/cl/phase1/forkchoice/fork_graph/fork_graph_disk.go b/cl/phase1/forkchoice/fork_graph/fork_graph_disk.go index cf174833552..00ce755a447 100644 --- a/cl/phase1/forkchoice/fork_graph/fork_graph_disk.go +++ b/cl/phase1/forkchoice/fork_graph/fork_graph_disk.go @@ -40,11 +40,7 @@ import ( "github.com/erigontech/erigon/cl/transition/impl/eth2" ) -<<<<<<< HEAD -const dumpSlotFrequency = 17 -======= const dumpSlotFrequency = 4 ->>>>>>> v3.0.0-alpha1 type syncCommittees struct { currentSyncCommittee *solid.SyncCommittee diff --git a/cl/sentinel/gossip.go b/cl/sentinel/gossip.go index e4d32adce27..3c83050d6ba 100644 --- a/cl/sentinel/gossip.go +++ b/cl/sentinel/gossip.go @@ -533,46 +533,6 @@ type GossipSubscription struct { closeOnce sync.Once } -<<<<<<< HEAD -func (sub *GossipSubscription) Listen() { - go func() { - var err error - checkingInterval := time.NewTicker(100 * time.Millisecond) - for { - select { - case <-sub.ctx.Done(): - return - case <-checkingInterval.C: - - expirationTime := sub.expiration.Load().(time.Time) - if sub.subscribed.Load() && time.Now().After(expirationTime) { - sub.stopCh <- struct{}{} - if cancelFunc := sub.cf; cancelFunc != nil { - cancelFunc() // stop pubsub.Subscription.Next - } - sub.topic.Close() - sub.subscribed.Store(false) - log.Info("[Gossip] Unsubscribed from topic", "topic", sub.sub.Topic()) - sub.s.updateENROnSubscription(sub.sub.Topic(), false) - continue - } - if !sub.subscribed.Load() && time.Now().Before(expirationTime) { - sub.stopCh = make(chan struct{}, 3) - sub.sub, err = sub.topic.Subscribe() - if err != nil { - log.Warn("[Gossip] failed to begin topic subscription", "err", err) - time.Sleep(30 * time.Second) - continue - } - var sctx context.Context - sctx, sub.cf = context.WithCancel(sub.ctx) - go sub.run(sctx, sub.sub, sub.sub.Topic()) - sub.subscribed.Store(true) - sub.s.updateENROnSubscription(sub.sub.Topic(), true) - log.Info("[Gossip] Subscribed to topic", "topic", sub.sub.Topic()) - } - } -======= func (sub *GossipSubscription) checkIfTopicNeedsToEnabledOrDisabled() { var err error expirationTime := sub.expiration.Load().(time.Time) @@ -590,7 +550,6 @@ func (sub *GossipSubscription) checkIfTopicNeedsToEnabledOrDisabled() { if err != nil { log.Warn("[Gossip] failed to begin topic subscription", "err", err) return ->>>>>>> v3.0.0-alpha1 } var sctx context.Context sctx, sub.cf = context.WithCancel(sub.ctx) diff --git a/cl/sentinel/service/start.go b/cl/sentinel/service/start.go index 1edfe9d034e..5df3ee9c2a1 100644 --- a/cl/sentinel/service/start.go +++ b/cl/sentinel/service/start.go @@ -23,15 +23,6 @@ import ( "strings" "time" -<<<<<<< HEAD - "github.com/ledgerwatch/erigon/cl/gossip" - "github.com/ledgerwatch/erigon/cl/persistence/blob_storage" - "github.com/ledgerwatch/erigon/cl/phase1/forkchoice" - "github.com/ledgerwatch/erigon/cl/sentinel" - "github.com/ledgerwatch/erigon/cl/utils/eth_clock" - "github.com/ledgerwatch/erigon/common/math" - "github.com/ledgerwatch/erigon/turbo/snapshotsync/freezeblocks" -======= "github.com/erigontech/erigon/cl/gossip" "github.com/erigontech/erigon/cl/persistence/blob_storage" "github.com/erigontech/erigon/cl/phase1/forkchoice" @@ -39,7 +30,6 @@ import ( "github.com/erigontech/erigon/cl/utils/eth_clock" "github.com/erigontech/erigon/common/math" "github.com/erigontech/erigon/turbo/snapshotsync/freezeblocks" ->>>>>>> v3.0.0-alpha1 "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/cl/transition/impl/eth2/operations.go b/cl/transition/impl/eth2/operations.go index 0d062fc8fd3..3d9dab984f5 100644 --- a/cl/transition/impl/eth2/operations.go +++ b/cl/transition/impl/eth2/operations.go @@ -363,11 +363,7 @@ func (I *impl) ProcessExecutionPayload(s abstract.BeaconState, parentHash, prevR return fmt.Errorf("ProcessExecutionPayload: invalid eth1 chain. mismatching parent") } } -<<<<<<< HEAD - if payload.PrevRandao != s.GetRandaoMixes(state.Epoch(s)) { -======= if prevRandao != s.GetRandaoMixes(state.Epoch(s)) { ->>>>>>> v3.0.0-alpha1 return fmt.Errorf( "ProcessExecutionPayload: randao mix mismatches with mix digest, expected %x, got %x", s.GetRandaoMixes(state.Epoch(s)), diff --git a/merge_status.txt b/merge_status.txt index d41ddb7cbe9..65e7ef387ac 100644 --- a/merge_status.txt +++ b/merge_status.txt @@ -2293,14 +2293,6 @@ Unmerged paths: both modified: Makefile both modified: accounts/abi/bind/backends/simulated.go both modified: accounts/abi/bind/template.go - both modified: cl/beacon/handler/block_production.go - both modified: cl/beacon/handler/handler.go - both modified: cl/beacon/handler/node.go - both modified: cl/clparams/config.go - both modified: cl/phase1/forkchoice/fork_graph/fork_graph_disk.go - both modified: cl/sentinel/gossip.go - both modified: cl/sentinel/service/start.go - both modified: cl/transition/impl/eth2/operations.go both modified: cmd/devnet/main.go both modified: cmd/devnet/services/polygon/proofgenerator_test.go both modified: cmd/diag/db/db.go