Skip to content

Commit 82548b8

Browse files
Merge pull request #139 from Layr-Labs/kira--rebase-v3.8.0-rc.16
Rebase and merge upstream with v3.8.0-rc.16
2 parents 3cdb51e + 47bb088 commit 82548b8

File tree

10 files changed

+60
-17
lines changed

10 files changed

+60
-17
lines changed

.github/workflows/nightly-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Lint
7070
uses: golangci/golangci-lint-action@v8
7171
with:
72-
version: latest
72+
version: v2.5
7373
skip-cache: true
7474
skip-save-cache: true
7575

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ WORKDIR /workspace
115115
RUN export DEBIAN_FRONTEND=noninteractive && \
116116
apt-get update && \
117117
apt-get install -y make clang wabt && \
118-
cargo install --force cbindgen
118+
cargo install --force cbindgen --version 0.24.3
119119
COPY arbitrator/Cargo.* arbitrator/
120120
COPY ./Makefile ./
121121
COPY arbitrator/arbutil arbitrator/arbutil

arbnode/dataposter/data_poster.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,13 @@ func TxToSignTxArgs(addr common.Address, tx *types.Transaction) (*apitypes.SendT
258258
blobs []kzg4844.Blob
259259
commitments []kzg4844.Commitment
260260
proofs []kzg4844.Proof
261+
blobVersion byte
261262
)
262263
if tx.BlobTxSidecar() != nil {
263264
blobs = tx.BlobTxSidecar().Blobs
264265
commitments = tx.BlobTxSidecar().Commitments
265266
proofs = tx.BlobTxSidecar().Proofs
267+
blobVersion = tx.BlobTxSidecar().Version
266268
}
267269
return &apitypes.SendTxArgs{
268270
From: common.NewMixedcaseAddress(addr),
@@ -278,6 +280,7 @@ func TxToSignTxArgs(addr common.Address, tx *types.Transaction) (*apitypes.SendT
278280
ChainID: (*hexutil.Big)(tx.ChainId()),
279281
BlobFeeCap: (*hexutil.Big)(tx.BlobGasFeeCap()),
280282
BlobHashes: tx.BlobHashes(),
283+
BlobVersion: blobVersion,
281284
Blobs: blobs,
282285
Commitments: commitments,
283286
Proofs: proofs,

arbnode/inbox_reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ func (r *InboxReader) getNextBlockToRead(ctx context.Context) (*big.Int, error)
665665
if delayedCount == 0 {
666666
return new(big.Int).Set(r.firstMessageBlock), nil
667667
}
668-
_, _, parentChainBlockNumber, err := r.tracker.GetDelayedMessageAccumulatorAndParentChainBlockNumber(ctx, delayedCount-1)
668+
parentChainBlockNumber, err := r.tracker.GetParentChainBlockNumberFor(ctx, delayedCount-1)
669669
if err != nil {
670670
return nil, err
671671
}

arbnode/inbox_tracker.go

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,25 @@ func (t *InboxTracker) legacyGetDelayedMessageAndAccumulator(ctx context.Context
347347
}
348348

349349
func (t *InboxTracker) GetDelayedMessageAccumulatorAndParentChainBlockNumber(ctx context.Context, seqNum uint64) (*arbostypes.L1IncomingMessage, common.Hash, uint64, error) {
350+
msg, acc, blockNum, err := t.getRawDelayedMessageAccumulatorAndParentChainBlockNumber(ctx, seqNum)
351+
if err != nil {
352+
return msg, acc, blockNum, err
353+
}
354+
err = msg.FillInBatchGasFields(func(batchNum uint64) ([]byte, error) {
355+
data, _, err := t.txStreamer.inboxReader.GetSequencerMessageBytes(ctx, batchNum)
356+
return data, err
357+
})
358+
return msg, acc, blockNum, err
359+
}
360+
361+
// does not return message, so does not need to fill in batchGasFields
362+
func (t *InboxTracker) GetParentChainBlockNumberFor(ctx context.Context, seqNum uint64) (uint64, error) {
363+
_, _, blockNum, err := t.getRawDelayedMessageAccumulatorAndParentChainBlockNumber(ctx, seqNum)
364+
return blockNum, err
365+
}
366+
367+
// this function will not error
368+
func (t *InboxTracker) getRawDelayedMessageAccumulatorAndParentChainBlockNumber(ctx context.Context, seqNum uint64) (*arbostypes.L1IncomingMessage, common.Hash, uint64, error) {
350369
delayedMessageKey := dbKey(rlpDelayedMessagePrefix, seqNum)
351370
exists, err := t.db.Has(delayedMessageKey)
352371
if err != nil {
@@ -371,14 +390,6 @@ func (t *InboxTracker) GetDelayedMessageAccumulatorAndParentChainBlockNumber(ctx
371390
return msg, acc, 0, err
372391
}
373392

374-
err = msg.FillInBatchGasFields(func(batchNum uint64) ([]byte, error) {
375-
data, _, err := t.txStreamer.inboxReader.GetSequencerMessageBytes(ctx, batchNum)
376-
return data, err
377-
})
378-
if err != nil {
379-
return msg, acc, 0, err
380-
}
381-
382393
parentChainBlockNumberKey := dbKey(parentChainBlockNumberPrefix, seqNum)
383394
exists, err = t.db.Has(parentChainBlockNumberKey)
384395
if err != nil {

bold/chain-abstraction/sol-implementation/assertion_chain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ func (a *AssertionChain) createAndStakeOnAssertion(
661661
})
662662
opts := a.GetCallOptsWithDesiredRpcHeadBlockNumber(&bind.CallOpts{Context: ctx})
663663
if createErr := handleCreateAssertionError(err, postState.GlobalState.BlockHash); createErr != nil {
664-
if strings.Contains(err.Error(), "already exists") {
664+
if strings.Contains(createErr.Error(), "already exists") {
665665
assertionItem, err2 := a.GetAssertion(ctx, opts, protocol.AssertionHash{Hash: computedHash})
666666
if err2 != nil {
667667
return nil, err2

broadcastclient/broadcastclient.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ func (bc *BroadcastClient) Start(ctxIn context.Context) {
196196
errors.Is(err, ErrIncorrectChainId) ||
197197
errors.Is(err, ErrMissingFeedServerVersion) ||
198198
errors.Is(err, ErrIncorrectFeedServerVersion) {
199-
bc.fatalErrChan <- fmt.Errorf("failed connecting to server feed due to %w", err)
199+
select {
200+
case bc.fatalErrChan <- fmt.Errorf("failed connecting to server feed due to %w", err):
201+
case <-ctx.Done():
202+
}
200203
return
201204
}
202205
if err == nil {
@@ -486,7 +489,11 @@ func (bc *BroadcastClient) startBackgroundReader(earlyFrameData io.Reader) {
486489
}
487490
}
488491
if res.ConfirmedSequenceNumberMessage != nil && bc.confirmedSequenceNumberListener != nil {
489-
bc.confirmedSequenceNumberListener <- res.ConfirmedSequenceNumberMessage.SequenceNumber
492+
select {
493+
case bc.confirmedSequenceNumberListener <- res.ConfirmedSequenceNumberMessage.SequenceNumber:
494+
case <-ctx.Done():
495+
return
496+
}
490497
}
491498
}
492499
}

cmd/chaininfo/arbitrum_chain_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
"chain-name": "sepolia-rollup",
219219
"sequencer-url": "https://sepolia-rollup-sequencer.arbitrum.io/rpc",
220220
"feed-url": "wss://sepolia-rollup.arbitrum.io/feed",
221-
"feed-signed": true,
221+
"feed-signed": false,
222222
"block-metadata-url": "https://sepolia-rollup.arbitrum.io/rpc",
223223
"track-block-metadata-from": 123000000,
224224
"chain-config": {

staker/legacy/staker.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,16 +478,38 @@ func (s *Staker) tryFastConfirmationNodeNumber(ctx context.Context, number uint6
478478
return s.tryFastConfirmation(ctx, nodeInfo.AfterState().GlobalState.BlockHash, nodeInfo.AfterState().GlobalState.SendRoot, hash)
479479
}
480480

481+
func (s *Staker) flushTransactions(ctx context.Context) error {
482+
arbTx, err := s.builder.ExecuteTransactions(ctx)
483+
if err != nil {
484+
return err
485+
}
486+
if arbTx != nil {
487+
_, err = s.l1Reader.WaitForTxApproval(ctx, arbTx)
488+
if err == nil {
489+
log.Info("successfully executed staker transaction", "hash", arbTx.Hash())
490+
} else {
491+
return fmt.Errorf("error waiting for tx receipt: %w", err)
492+
}
493+
}
494+
return nil
495+
}
496+
481497
func (s *Staker) tryFastConfirmation(ctx context.Context, blockHash common.Hash, sendRoot common.Hash, nodeHash common.Hash) error {
482498
if !s.config().EnableFastConfirmation {
483499
return nil
484500
}
501+
// Make sure all previous transactions are flushed before trying to fast confirm
502+
// to ensure that the newly created node is known on-chain before fast confirming it.
503+
err := s.flushTransactions(ctx)
504+
if err != nil {
505+
return err
506+
}
485507
if s.fastConfirmSafe != nil {
486508
return s.fastConfirmSafe.tryFastConfirmation(ctx, blockHash, sendRoot, nodeHash)
487509
}
488510
auth := s.builder.Auth(ctx)
489511
log.Info("Fast confirming node with wallet", "wallet", auth.From, "nodeHash", nodeHash)
490-
_, err := s.rollup.FastConfirmNextNode(auth, blockHash, sendRoot, nodeHash)
512+
_, err = s.rollup.FastConfirmNextNode(auth, blockHash, sendRoot, nodeHash)
491513
return err
492514
}
493515

0 commit comments

Comments
 (0)