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

Commit

Permalink
better alias name in config.go and added rollupID to etherman.BuildTr…
Browse files Browse the repository at this point in the history
…ustedVerifyBatchesTxData
  • Loading branch information
nivida committed Jan 9, 2024
1 parent c6b8dc3 commit 19765e7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (
"github.com/spf13/viper"
"github.com/urfave/cli/v2"

beethovenTypes "github.com/0xPolygon/beethoven/rpc/types"
rpcTypes "github.com/0xPolygon/beethoven/rpc/types"
)

const (
// FlagCfg flag used for config aka cfg
FlagCfg = "cfg"
)

type FullNodeRPCs map[beethovenTypes.ArgUint64]string
type FullNodeRPCs map[rpcTypes.ArgUint64]string

// Config represents the full configuration of the data node
type Config struct {
Expand Down
8 changes: 7 additions & 1 deletion etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ func (e *Etherman) GetSequencerAddr(rollupID rpcTypes.ArgUint64) (common.Address
return address, nil
}

func (e *Etherman) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, proof tx.ZKP) (data []byte, err error) {
func (e *Etherman) BuildTrustedVerifyBatchesTxData(
lastVerifiedBatch,
newVerifiedBatch uint64,
proof tx.ZKP,
rollupId rpcTypes.ArgUint64,
) (data []byte, err error) {
var newLocalExitRoot [HashLength]byte
copy(newLocalExitRoot[:], proof.NewLocalExitRoot.Bytes())
var newStateRoot [HashLength]byte
Expand All @@ -70,6 +75,7 @@ func (e *Etherman) BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifie

return abi.Pack(
"verifyBatchesTrustedAggregator",
rollupId,
pendStateNum,
lastVerifiedBatch,
newVerifiedBatch,
Expand Down
1 change: 1 addition & 0 deletions interop/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func (e *Executor) Settle(ctx context.Context, signedTx tx.SignedTx, dbTx pgx.Tx
uint64(signedTx.Tx.LastVerifiedBatch),
uint64(signedTx.Tx.NewVerifiedBatch),
signedTx.Tx.ZKP,
signedTx.Tx.RollupID,
)
if err != nil {
return common.Hash{}, fmt.Errorf("failed to build verify ZKP tx: %s", err)
Expand Down
4 changes: 3 additions & 1 deletion types/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/jackc/pgx/v4"

rpcTypes "github.com/0xPolygon/beethoven/rpc/types"
)

type DBInterface interface {
Expand All @@ -18,7 +20,7 @@ type DBInterface interface {

type EthermanInterface interface {
GetSequencerAddr(rollupID types.ArgUint64) (common.Address, error)
BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, proof tx.ZKP) (data []byte, err error)
BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, proof tx.ZKP, rollupId rpcTypes.ArgUint64) (data []byte, err error)
CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
}

Expand Down

0 comments on commit 19765e7

Please sign in to comment.