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

Commit

Permalink
feat(bindings): update Go contract bindings (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Apr 10, 2024
1 parent 553c432 commit a97255d
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 48 deletions.
2 changes: 1 addition & 1 deletion bindings/.githead
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2c63cb0c796495948f1dd887662044397394d852
03d610d8a94e4f1ef52b4c3e5656ed9081b8585f
7 changes: 2 additions & 5 deletions bindings/encoding/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import (

// ABI arguments marshaling components.
var (
assignmentPayloadPrefix = "PROVER_ASSIGNMENT"
assignmentPayloadPrefixSize = len([]byte(assignmentPayloadPrefix))
paddedAssignmentPayloadPrefixBytes = common.LeftPadBytes([]byte(assignmentPayloadPrefix), assignmentPayloadPrefixSize)
blockMetadataComponents = []abi.ArgumentMarshaling{
blockMetadataComponents = []abi.ArgumentMarshaling{
{
Name: "l1Hash",
Type: "bytes32",
Expand Down Expand Up @@ -367,7 +364,7 @@ func EncodeProverAssignmentPayload(
binary.BigEndian.PutUint64(chainIDBytes, chainID)

return bytes.Join([][]byte{
paddedAssignmentPayloadPrefixBytes[len(paddedAssignmentPayloadPrefixBytes)-assignmentPayloadPrefixSize:],
common.RightPadBytes([]byte("PROVER_ASSIGNMENT"), 32),
chainIDBytes,
taikoAddress.Bytes(),
blockProposer.Bytes(),
Expand Down
33 changes: 1 addition & 32 deletions bindings/gen_lib_proving.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/flags/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package flags
import (
"time"

"github.com/cenkalti/backoff/v4"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -119,7 +120,7 @@ var (
Name: "backoff.retryInterval",
Usage: "Retry interval in seconds when there is an error",
Category: commonCategory,
Value: 12 * time.Second,
Value: backoff.DefaultMaxInterval,
}
RPCTimeout = &cli.DurationFlag{
Name: "rpc.timeout",
Expand Down
2 changes: 1 addition & 1 deletion cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ var (
// Confirmations specific flag
BlockConfirmations = &cli.Uint64Flag{
Name: "prover.blockConfirmations",
Usage: "Confirmations to the latest l1 block before submitting a proof for a l2 block",
Usage: "Confirmations to the latest L1 block before submitting a proof for a L2 block",
Value: 6,
Category: proverCategory,
}
Expand Down
9 changes: 8 additions & 1 deletion integration_test/l1_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@ export GUARDIAN_PROVERS=${GUARDIAN_PROVERS_ADDRESSES:1}
export MIN_GUARDIANS=${#GUARDIAN_PROVERS_ADDRESSES_LIST[@]}

# Get the hash of L2 genesis.
export L2_GENESIS_HASH=$(cast block --rpc-url "$L2_EXECUTION_ENGINE_WS_ENDPOINT" 0x0 -f hash)
export L2_GENESIS_HASH=$(
curl \
--silent \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":0,"method":"eth_getBlockByNumber","params":["0x0", false]}' \
$L2_EXECUTION_ENGINE_HTTP_ENDPOINT | jq .result.hash | sed 's/\"//g'
)
echo "L2_GENESIS_HASH: $L2_GENESIS_HASH"
9 changes: 4 additions & 5 deletions prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,20 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
if err := c.Set(flags.ProveUnassignedBlocks.Name, "true"); err != nil {
return nil, err
}

if err := c.Set(flags.ContesterMode.Name, "true"); err != nil {
return nil, err
}

// l1 and l2 node version flags are required only if guardian prover
// L1 and L2 node version flags are required only if guardian prover
if !c.IsSet(flags.L1NodeVersion.Name) {
return nil, errors.New("L1NodeVersion is required if guardian prover is set")
return nil, errors.New("--prover.l1NodeVersion flag is required if guardian prover is set")
}

if !c.IsSet(flags.L2NodeVersion.Name) {
return nil, errors.New("L2NodeVersion is required if guardian prover is set")
return nil, errors.New("--prover.l2NodeVersion flag is required if guardian prover is set")
}
}

// If we are not running a guardian prover, a raiko host endpoint is required.
if !c.IsSet(flags.GuardianProver.Name) && !c.IsSet(flags.RaikoHostEndpoint.Name) {
return nil, fmt.Errorf("raiko host not provided")
}
Expand Down
3 changes: 1 addition & 2 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ func (p *Prover) withRetry(f func() error) {
p.wg.Add(1)
go func() {
defer p.wg.Done()
err := backoff.Retry(f, p.backoff)
if err != nil {
if err := backoff.Retry(f, p.backoff); err != nil {
log.Error("Operation failed", "error", err)
}
}()
Expand Down

0 comments on commit a97255d

Please sign in to comment.