Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion agglayer/grpc/agglayer_grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)

var (
errUndefinedAggchainData = errors.New("undefined aggchain data parameter")

Check failure on line 21 in agglayer/grpc/agglayer_grpc_client.go

View workflow job for this annotation

GitHub Actions / lint

var errUndefinedAggchainData is unused (unused)
errUnknownAggchainData = errors.New("unknown aggchain data type")
errNilCertificate = errors.New("nil certificate provided for conversion to proto")
)
Expand Down Expand Up @@ -272,7 +272,7 @@
// convertAggchainData converts the aggchain data to a proto aggchain data
func convertAggchainData(aggchainData types.AggchainData) (*v1types.AggchainData, error) {
if aggchainData == nil {
return nil, errUndefinedAggchainData
return nil, nil
}

switch ad := aggchainData.(type) {
Expand Down
2 changes: 1 addition & 1 deletion aggsender/aggsender.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (a *AggSender) sendCertificate(ctx context.Context) (*agglayertypes.Certifi
}

if _, err := a.localValidator.ValidateAndSignCertificate(ctx, certificate, certificateParams.ToBlock); err != nil {
return nil, fmt.Errorf("error validating certificate locally: %w", err)
a.log.Errorf("error validating certificate locally: %w", err)
}

multisig, err := a.validatorPoller.PollValidators(ctx, &types.ValidationRequest{
Expand Down
4 changes: 2 additions & 2 deletions aggsender/block_notifier_polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (b *BlockNotifierPolling) step(ctx context.Context,
}
if previousState.lastBlockSeen > currentBlock {
b.logger.Warnf("Block number decreased [finality:%s]: %d -> %d",
b.config.BlockFinalityType, previousState.lastBlockSeen, currentBlock)
b.config.BlockFinalityType.String(), previousState.lastBlockSeen, currentBlock)
// It start from scratch because something fails in calculation of block period
newState := previousState.initialBlock(currentBlock)
return b.nextBlockRequestDelay(nil, nil), newState, eventToEmit
Expand All @@ -161,7 +161,7 @@ func (b *BlockNotifierPolling) step(ctx context.Context,
if currentBlock-previousState.lastBlockSeen != 1 {
if !b.config.BlockFinalityType.IsSafe() && !b.config.BlockFinalityType.IsFinalized() {
b.logger.Warnf("Missed block(s) [finality:%s]: %d -> %d",
b.config.BlockFinalityType, previousState.lastBlockSeen, currentBlock)
b.config.BlockFinalityType.String(), previousState.lastBlockSeen, currentBlock)
}

// It start from scratch because something fails in calculation of block period
Expand Down
2 changes: 1 addition & 1 deletion aggsender/epoch_notifier_per_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (e *EpochNotifierPerBlock) step(status internalStatus,
logFunc = e.logger.Infof
}
logFunc("New block seen [finality:%s]: %d. blockRate:%s Epoch:%d Percent:%.2f%% notify:%v config:%s",
newBlock.BlockFinalityType, newBlock.BlockNumber, newBlock.BlockRate, closingEpoch,
newBlock.BlockFinalityType.String(), newBlock.BlockNumber, newBlock.BlockRate, closingEpoch,
percentEpoch*maxPercent, needNotify, e.Config.String())
if needNotify {
// Notify the epoch has started
Expand Down
2 changes: 1 addition & 1 deletion test/config/fep-config.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ AggSenderPrivateKey = {Path = "{{.zkevm_l2_sequencer_keystore_file_path}}", Pass
# LatestBlock, SafeBlock, PendingBlock, FinalizedBlock, EarliestBlock
# Default value is "LatestBlock"
# ------------------------------------------------------------------------------
BlockFinality = "LatestBlock"
#BlockFinality = "LatestBlock"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note, maybe we can remove this, AFAIK there is no BlockFinality in the AggSender config (anymore)?

Suggested change
#BlockFinality = "LatestBlock"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, in the next PR I'll remove definitely


Mode = "AggchainProof"
CheckStatusCertificateInterval = "1s"
Expand Down
Loading