Skip to content

Commit

Permalink
Lint and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJeremyHe committed Nov 19, 2024
1 parent c76af34 commit 3248f96
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions arbnode/transaction_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type TransactionStreamerConfig struct {
HotShotUrl string `koanf:"hotshot-url"`
EspressoNamespace uint64 `koanf:"espresso-namespace"`
EspressoTxnsPollingInterval time.Duration `koanf:"espresso-txns-polling-interval"`
EspressoSwitchDelayThreshold uint64 `koanf:"espresso-switch-delay-thresold"`
EspressoSwitchDelayThreshold uint64 `koanf:"espresso-switch-delay-threshold"`
}

type TransactionStreamerConfigFetcher func() *TransactionStreamerConfig
Expand Down Expand Up @@ -126,7 +126,7 @@ func TransactionStreamerConfigAddOptions(prefix string, f *flag.FlagSet) {
f.String(prefix+".hotshot-url", DefaultTransactionStreamerConfig.HotShotUrl, "url of the hotshot sequencer")
f.Uint64(prefix+".espresso-namespace", DefaultTransactionStreamerConfig.EspressoNamespace, "espresso namespace that corresponds the L2 chain")
f.Duration(prefix+".espresso-txns-polling-interval", DefaultTransactionStreamerConfig.EspressoTxnsPollingInterval, "interval between polling for transactions to be included in the block")
f.Uint64(prefix+".espresso-switch-delay-thresold", DefaultTransactionStreamerConfig.EspressoSwitchDelayThreshold, "specifies the switch delay threshold used to determine hotshot liveness")
f.Uint64(prefix+".espresso-switch-delay-threshold", DefaultTransactionStreamerConfig.EspressoSwitchDelayThreshold, "specifies the switch delay threshold used to determine hotshot liveness")
}

func NewTransactionStreamer(
Expand Down Expand Up @@ -1429,7 +1429,7 @@ func (s *TransactionStreamer) getEspressoSubmittedHash() (*espressoTypes.TaggedB
if hashParsed == nil {
return nil, err
}
return nil, nil
return hashParsed, nil
}

func (s *TransactionStreamer) getLastConfirmedPos() (*arbutil.MessageIndex, error) {
Expand Down Expand Up @@ -1468,6 +1468,9 @@ func (s *TransactionStreamer) getEspressoPendingTxnsPos() ([]*arbutil.MessageInd

pendingTxnsBytes, err := s.db.Get(espressoPendingTxnsPositions)
if err != nil {
if dbutil.IsErrNotFound(err) {
return nil, nil
}
return nil, err
}
var pendingTxnsPos []*arbutil.MessageIndex
Expand Down Expand Up @@ -1790,13 +1793,12 @@ func (s *TransactionStreamer) espressoSwitch(ctx context.Context, ignored struct
log.Error("ArbOS Config is nil")
return retryRate
}
if config.ArbitrumChainParams.EnableEspresso {
if config.ArbitrumChainParams.EnableEspresso && s.config().SovereignSequencerEnabled {
err := s.toggleEscapeHatch(ctx)
if err != nil {
log.Error("error checking escape hatch", "err", err)
return retryRate
}

canSubmit := s.pollSubmittedTransactionForFinality(ctx)
if canSubmit {
return s.submitEspressoTransactions(ctx)
Expand Down

0 comments on commit 3248f96

Please sign in to comment.