Skip to content
Open
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
a86f4b7
bet
calbera May 28, 2025
275e139
nit
calbera May 28, 2025
fbfdcc5
empty eth1data
calbera May 28, 2025
d39fb79
nit
calbera May 28, 2025
a6f4d3b
more simplifications
calbera May 28, 2025
65c201c
lint
calbera May 28, 2025
2e3098d
process electra1 fork
calbera May 29, 2025
b7dae5e
EL genesis config update
calbera May 29, 2025
9ea411b
lint
calbera May 29, 2025
2b364dd
upgradeToElectra1
calbera May 29, 2025
c847971
Merge branch 'main' of github.com:berachain/beacon-kit into tmp-6110-poc
calbera Jun 2, 2025
2df992f
fix some unit tests
calbera Jun 3, 2025
3b0912a
fix withdrawals fork handling
calbera Jun 3, 2025
3a88dba
refactor for readability
calbera Jun 3, 2025
af9313c
nit
calbera Jun 3, 2025
741e0d0
fix nilaway
calbera Jun 3, 2025
d7d485c
Merge branch 'main' of github.com:berachain/beacon-kit into tmp-6110-poc
calbera Jun 4, 2025
fdac98b
handle all fork versions
calbera Jun 4, 2025
3b9f7f0
Merge branch 'main' of github.com:berachain/beacon-kit into tmp-6110-poc
calbera Aug 28, 2025
e283f37
lint
calbera Aug 28, 2025
f544fc1
Merge branch 'main' into tmp-6110-poc
calbera Aug 31, 2025
9742809
Merge branch 'main' into tmp-6110-poc
calbera Sep 10, 2025
2bafcaf
Merge branch 'main' of github.com:berachain/beacon-kit into tmp-6110-poc
calbera Dec 10, 2025
05ed5d1
fix merge conflict
calbera Dec 10, 2025
f8b4392
nits to Electra2
calbera Dec 10, 2025
febd7f0
electra2 in chain spec
calbera Dec 11, 2025
932b51b
format && lint
calbera Dec 11, 2025
339f692
tmp nit
calbera Jan 6, 2026
652c122
Merge branch 'main' into tmp-6110-poc
calbera Feb 26, 2026
c387d79
feat(deposits): add Electra2 fork with EIP-6110 style deposit process…
calbera Mar 4, 2026
2cb095a
Merge branch 'main' into tmp-6110-poc
calbera Mar 4, 2026
a119ca7
Merge branch 'main' into tmp-6110-poc
calbera Mar 18, 2026
944d594
fix catchup logic for block building
calbera Mar 19, 2026
79956a3
refactored beacon services to allow catchup deposits
calbera Mar 19, 2026
c3991e7
add validation logic
calbera Mar 19, 2026
700ecfd
format
calbera Mar 19, 2026
24e7bc5
fix default network configs for electra2
calbera Mar 20, 2026
03d2c27
validation deposits unit tests
calbera Mar 20, 2026
9a692e5
fix more tests
calbera Mar 20, 2026
5069d62
Fix state-transition UTs
calbera Mar 20, 2026
25e45a6
fix TestSubmitPartialWithdrawalTransaction
calbera Mar 20, 2026
1f109fd
use bera-reth image with 6110 enabled
calbera Mar 21, 2026
4ea7da0
fix processOperations logic
calbera Mar 21, 2026
9bd3177
format
calbera Mar 21, 2026
1e09f1c
sim test for deposits catchup
calbera Mar 21, 2026
00269f6
only fetch catchup deposits once
calbera Mar 21, 2026
4263338
correct approach
calbera Mar 21, 2026
9647cb3
try pectra deposit sim test fix
calbera Mar 21, 2026
0419af5
use fulu instead of electra2
calbera Mar 21, 2026
ed0e6c1
format
calbera Mar 23, 2026
5f1f731
Address comments
calbera Mar 24, 2026
ee2ed00
fix sim test log check
calbera Mar 24, 2026
40b66d5
reorder catchup func
calbera Mar 25, 2026
03faa80
atomic.Uint64
calbera Mar 26, 2026
7806133
supported version
calbera Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 0 additions & 125 deletions beacon/blockchain/deposit.go

This file was deleted.

15 changes: 12 additions & 3 deletions beacon/blockchain/finalize_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"fmt"
"time"

"github.com/berachain/beacon-kit/beacon/deposits"
ctypes "github.com/berachain/beacon-kit/consensus-types/types"
"github.com/berachain/beacon-kit/consensus/types"
datypes "github.com/berachain/beacon-kit/da/types"
Expand Down Expand Up @@ -126,9 +127,10 @@ func (s *Service) PostFinalizeBlockOps(ctx sdk.Context, blk *ctypes.BeaconBlock)
// TODO: consider extracting LatestExecutionPayloadHeader instead of using state here
st := s.storageBackend.StateFromContext(ctx)

// Fetch and store the deposit for the block.
blockNum := blk.GetBody().GetExecutionPayload().GetNumber()
s.depositFetcher(ctx, blockNum)
// Before Fulu, deposits must be fetched from the EL (at the eth1 follow distance).
deposits.FetchPreviousDepositsPreFulu(
ctx, s.depositContract, blk, s.eth1FollowDistance, s.storageBackend.DepositStore(), s.logger,
)

// Store the finalized block in the KVStore.
slot := blk.GetSlot()
Expand Down Expand Up @@ -169,6 +171,13 @@ func (s *Service) finalizeBeaconBlock(
return nil, ErrNilBlk
}

// If on the first block of Fulu, catchup the previous block's deposits.
if err := deposits.CatchupFuluDeposits(
ctx, s.depositContract, st, beaconBlk, s.chainSpec, s.storageBackend.DepositStore(), s.logger,
); err != nil {
return nil, err
}

valUpdates, err := s.executeStateTransition(ctx, st, blk)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions beacon/blockchain/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,5 @@ type ServiceChainSpec interface {
EpochsPerHistoricalVector() uint64
SlotToEpoch(slot math.Slot) math.Epoch
Eth1FollowDistance() uint64
MaxDepositsPerBlock() uint64
}
8 changes: 8 additions & 0 deletions beacon/blockchain/process_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"slices"
"time"

"github.com/berachain/beacon-kit/beacon/deposits"
ctypes "github.com/berachain/beacon-kit/consensus-types/types"
"github.com/berachain/beacon-kit/consensus/cometbft/service/cache"
"github.com/berachain/beacon-kit/consensus/types"
Expand Down Expand Up @@ -328,6 +329,13 @@ func (s *Service) VerifyIncomingBlock(
}
}

// If on the first block of Fulu, catchup the previous block's deposits.
if err = deposits.CatchupFuluDeposits(
ctx, s.depositContract, state, beaconBlk, s.chainSpec, s.storageBackend.DepositStore(), s.logger,
); err != nil {
return nil, err
}

// Verify the state root of the incoming block.
valUpdates, err := s.verifyStateRoot(ctx, state, blk)
if err != nil {
Expand Down
13 changes: 1 addition & 12 deletions beacon/blockchain/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,11 @@ type Service struct {
depositContract deposit.Contract
// eth1FollowDistance is the follow distance for Ethereum 1.0 blocks.
eth1FollowDistance math.U64
// failedBlocksMu protects failedBlocks for concurrent access.
failedBlocksMu sync.RWMutex
// failedBlocks is a map of blocks that failed to be processed
// and should be retried.
failedBlocks map[math.U64]struct{}
// logger is used for logging messages in the service.
logger log.Logger
// chainSpec holds the chain specifications.
chainSpec ServiceChainSpec
// executionEngine is the execution engine responsible for processing
//
// execution payloads.
executionEngine ExecutionEngine
// localBuilder is a local builder for constructing new beacon states.
Expand All @@ -64,7 +58,6 @@ type Service struct {
metrics *chainMetrics
// forceStartupSyncOnce is used to force a sync of the startup head.
forceStartupSyncOnce *sync.Once

// latestFcuReq holds a copy of the latest FCU sent to the execution layer.
// It helps avoid resending the same FCU data (and spares a network call)
// in case optimistic block building is active
Expand All @@ -88,7 +81,6 @@ func NewService(
blobProcessor: blobProcessor,
depositContract: depositContract,
eth1FollowDistance: math.U64(chainSpec.Eth1FollowDistance()),
failedBlocks: make(map[math.Slot]struct{}),
logger: logger,
chainSpec: chainSpec,
executionEngine: executionEngine,
Expand All @@ -105,10 +97,7 @@ func (s *Service) Name() string {
}

// Start starts the blockchain service.
func (s *Service) Start(ctx context.Context) error {
// Catchup deposits for failed blocks. TODO: remove.
go s.depositCatchupFetcher(ctx)

func (s *Service) Start(context.Context) error {
return nil
}

Expand Down
Loading
Loading