diff --git a/agglayer/grpc/agglayer_grpc_client.go b/agglayer/grpc/agglayer_grpc_client.go index 4501cd397..215153031 100644 --- a/agglayer/grpc/agglayer_grpc_client.go +++ b/agglayer/grpc/agglayer_grpc_client.go @@ -18,9 +18,8 @@ import ( ) var ( - errUndefinedAggchainData = errors.New("undefined aggchain data parameter") - errUnknownAggchainData = errors.New("unknown aggchain data type") - errNilCertificate = errors.New("nil certificate provided for conversion to proto") + errUnknownAggchainData = errors.New("unknown aggchain data type") + errNilCertificate = errors.New("nil certificate provided for conversion to proto") ) type AgglayerGRPCClient struct { @@ -272,7 +271,7 @@ func ConvertCertToProtoCertificate( // 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) { diff --git a/agglayer/grpc/agglayer_grpc_client_test.go b/agglayer/grpc/agglayer_grpc_client_test.go index e4684a079..ffff677e2 100644 --- a/agglayer/grpc/agglayer_grpc_client_test.go +++ b/agglayer/grpc/agglayer_grpc_client_test.go @@ -343,11 +343,6 @@ func TestSendCertificate(t *testing.T) { expectedCertID common.Hash expectedError string }{ - { - name: "returns error when AggchainData not defined", - certificate: &types.Certificate{}, - expectedError: "undefined aggchain data", - }, { name: "returns error from submission service", certificate: &types.Certificate{ diff --git a/aggsender/aggsender.go b/aggsender/aggsender.go index faaa9a030..436f13cd8 100644 --- a/aggsender/aggsender.go +++ b/aggsender/aggsender.go @@ -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{ diff --git a/aggsender/block_notifier_polling.go b/aggsender/block_notifier_polling.go index e59c3b446..0f54e6b3a 100644 --- a/aggsender/block_notifier_polling.go +++ b/aggsender/block_notifier_polling.go @@ -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 @@ -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 diff --git a/aggsender/block_notifier_polling_test.go b/aggsender/block_notifier_polling_test.go index 0f44c75ae..55951a861 100644 --- a/aggsender/block_notifier_polling_test.go +++ b/aggsender/block_notifier_polling_test.go @@ -107,7 +107,7 @@ func TestBlockNotifierPollingStep(t *testing.T) { }, mockLoggerFn: func() aggkitcommon.Logger { mockLogger := mocks.NewLogger(t) - mockLogger.EXPECT().Warnf("Missed block(s) [finality:%s]: %d -> %d", aggkittypes.LatestBlock, uint64(100), uint64(105)).Once() + mockLogger.EXPECT().Warnf("Missed block(s) [finality:%s]: %d -> %d", aggkittypes.LatestBlock.String(), uint64(100), uint64(105)).Once() return mockLogger }, headerByNumberError: false, diff --git a/aggsender/epoch_notifier_per_block.go b/aggsender/epoch_notifier_per_block.go index 8f84a0ddf..0a8493e45 100644 --- a/aggsender/epoch_notifier_per_block.go +++ b/aggsender/epoch_notifier_per_block.go @@ -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 diff --git a/test/config/fep-config.toml.template b/test/config/fep-config.toml.template index f7a58b0a6..957a3e0f4 100644 --- a/test/config/fep-config.toml.template +++ b/test/config/fep-config.toml.template @@ -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" Mode = "AggchainProof" CheckStatusCertificateInterval = "1s"