Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Add more logging to the executor
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Feb 12, 2024
1 parent 5220742 commit ed286b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/0xPolygon/agglayer/config"
"github.com/0xPolygon/agglayer/tx"

"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonrollupmanager"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/polygonzkevm"
Expand All @@ -19,8 +20,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/jackc/pgx/v4"

"github.com/0xPolygon/agglayer/tx"
)

const (
Expand Down
5 changes: 5 additions & 0 deletions interop/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ func (e *Executor) verifyZKP(ctx context.Context, stx tx.SignedTx) error {
if err != nil {
return fmt.Errorf("failed to build verify ZKP tx: %s", err)
}

msg := ethereum.CallMsg{
From: e.interopAdminAddr,
To: &e.config.L1.RollupManagerContract,
Data: l1TxData,
}
log.Debugf("verify batches trusted L1 call: %v", msg)

res, err := e.etherman.CallContract(ctx, msg, nil)
if err != nil {
return fmt.Errorf("failed to call verify ZKP response: %s, error: %s", res, err)
Expand Down Expand Up @@ -126,6 +129,8 @@ func (e *Executor) Execute(ctx context.Context, signedTx tx.SignedTx) error {
if err != nil {
return fmt.Errorf("failed to get batch from our node, error: %s", err)
}
log.Debugf("get batch by number: %v", batch)

if batch.StateRoot != signedTx.Tx.ZKP.NewStateRoot || batch.LocalExitRoot != signedTx.Tx.ZKP.NewLocalExitRoot {
return fmt.Errorf(
"Mismatch detected, expected local exit root: %s actual: %s. expected state root: %s actual: %s",
Expand Down

0 comments on commit ed286b3

Please sign in to comment.