Skip to content

Commit

Permalink
fix final proof encoding (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM authored Feb 25, 2023
1 parent 3fbdde9 commit 3460dd4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strings"
"time"

"github.com/0xPolygonHermez/zkevm-node/encoding"
"github.com/0xPolygonHermez/zkevm-node/etherman/etherscan"
"github.com/0xPolygonHermez/zkevm-node/etherman/ethgasstation"
"github.com/0xPolygonHermez/zkevm-node/etherman/smartcontracts/matic"
Expand Down Expand Up @@ -463,7 +464,12 @@ func (etherMan *Client) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVe
var newStateRoot [32]byte
copy(newStateRoot[:], inputs.NewStateRoot)

proof := common.Hex2Bytes(inputs.FinalProof.Proof)
log.Info("Proof before trim: %v", inputs.FinalProof.Proof)
proof, err := encoding.DecodeBytes(&inputs.FinalProof.Proof)
if err != nil {
return nil, nil, fmt.Errorf("failed to decode proof, err: %w", err)
}
log.Info("Proof after trim: %v", common.Bytes2Hex(proof))

const pendStateNum = 0 // TODO hardcoded for now until we implement the pending state feature

Expand Down

0 comments on commit 3460dd4

Please sign in to comment.