diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 053daf3960c..c910a2f7996 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -398,8 +398,6 @@ services: - sh - -c - | - echo "Delaying op-batcher-tee for 45 minutes..." - sleep 2700 export DEPLOYMENT_MODE=local export L1_RPC_URL="http://127.0.0.1:${L1_HTTP_PORT}" export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" diff --git a/espresso/docker/l1-geth/devnet-genesis-template.json b/espresso/docker/l1-geth/devnet-genesis-template.json index 8af2de39e98..e852d989532 100644 --- a/espresso/docker/l1-geth/devnet-genesis-template.json +++ b/espresso/docker/l1-geth/devnet-genesis-template.json @@ -36,7 +36,7 @@ "nonce": "0x0", "timestamp": "0x685c6a58", "extraData": "0x", - "gasLimit": "0xaf79e0", + "gasLimit": "0x2aea540", "difficulty": "0x0", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 9ae4c68f624..fc0f9bec107 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1022,7 +1022,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return nil } - log.Info("Batch authenticator address", "value", l.RollupConfig.BatchAuthenticatorAddress) + l.Log.Info("Batch authenticator address", "value", l.RollupConfig.BatchAuthenticatorAddress) code, err := l.L1Client.CodeAt(ctx, l.RollupConfig.BatchAuthenticatorAddress, nil) if err != nil { return fmt.Errorf("Failed to check code at contrat address: %w", err) @@ -1074,7 +1074,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { // Verify every CA certiciate in the chain in an individual transaction. This avoids running into block gas limit // that could happen if CertManager verifies the whole certificate chain in one transaction. parentCertHash := crypto.Keccak256Hash(l.Attestation.Document.CABundle[0]) - for _, cert := range l.Attestation.Document.CABundle { + for i, cert := range l.Attestation.Document.CABundle { txData, err := createVerifyCertTransaction(certManager, certManagerAbi, cert, true, parentCertHash) if err != nil { return fmt.Errorf("failed to create verify certificate transaction: %w", err) @@ -1088,6 +1088,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { continue } + l.Log.Info("Verifying CABundle", "certNumber", i, "certsTotal", len(l.Attestation.Document.CABundle)) _, err = l.Txmgr.Send(ctx, txmgr.TxCandidate{ TxData: txData, To: &certManagerAddress, @@ -1103,6 +1104,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return fmt.Errorf("failed to create verify client certificate transaction: %w", err) } if txData != nil { + l.Log.Info("Verifying Client Certificate") _, err = l.Txmgr.Send(ctx, txmgr.TxCandidate{ TxData: txData, To: &certManagerAddress, @@ -1128,9 +1130,10 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { To: &l.RollupConfig.BatchAuthenticatorAddress, } + l.Log.Info("Registering batcher with the batch inbox contract") _, err = l.Txmgr.Send(ctx, candidate) if err != nil { - return fmt.Errorf("failed to send transaction: %w", err) + return fmt.Errorf("failed to send registerBatcher transaction: %w", err) } l.Log.Info("Registered batcher with the batch inbox contract") diff --git a/op-batcher/enclave-tools/cmd/main.go b/op-batcher/enclave-tools/cmd/main.go index b021e36c6a0..972f8262df0 100644 --- a/op-batcher/enclave-tools/cmd/main.go +++ b/op-batcher/enclave-tools/cmd/main.go @@ -5,6 +5,7 @@ import ( "encoding/hex" "fmt" "log" + "log/slog" "os" "strings" @@ -124,17 +125,17 @@ func buildAction(c *cli.Context) error { } ctx := context.Background() - fmt.Printf("Building enclave image...") + slog.Info("Building enclave image...") measurements, err := enclave_tools.BuildBatcherImage(ctx, opRoot, tag, batcherArgs...) if err != nil { return fmt.Errorf("failed to build enclave image: %w", err) } - fmt.Println("Build completed successfully!") - fmt.Println("Measurements:") - fmt.Printf(" PCR0: %s\n", measurements.PCR0) - fmt.Printf(" PCR1: %s\n", measurements.PCR1) - fmt.Printf(" PCR2: %s\n", measurements.PCR2) + slog.Info("Build completed successfully!") + slog.Info("Measurements", + "PCR0", measurements.PCR0, + "PCR1", measurements.PCR1, + "PCR2", measurements.PCR2) return nil } @@ -163,13 +164,13 @@ func registerAction(c *cli.Context) error { } ctx := context.Background() - fmt.Printf("Registering enclave hash...") + slog.Info("Registering enclave hash...") err = enclave_tools.RegisterEnclaveHash(ctx, authAddr, l1URL, key, pcr0Bytes) if err != nil { return fmt.Errorf("failed to register enclave hash: %w", err) } - fmt.Printf("Enclave hash registered successfully!") + slog.Info("Enclave hash registered successfully!") return nil } @@ -186,7 +187,7 @@ func runAction(c *cli.Context) error { ctx := context.Background() enclaverCli := &enclave_tools.EnclaverCli{} - fmt.Printf("Starting enclave: %s\n", imageName) + slog.Info("Starting enclave", "image", imageName) err = enclaverCli.RunEnclave(ctx, imageName, args) if err != nil { return err diff --git a/op-batcher/enclave-tools/enclaver.go b/op-batcher/enclave-tools/enclaver.go index df7b187733d..5469f0c0595 100644 --- a/op-batcher/enclave-tools/enclaver.go +++ b/op-batcher/enclave-tools/enclaver.go @@ -12,6 +12,7 @@ import ( "regexp" "time" + "github.com/ethereum/go-ethereum/log" "github.com/google/uuid" "gopkg.in/yaml.v2" ) @@ -138,13 +139,15 @@ func (*EnclaverCli) RunEnclave(ctx context.Context, name string, args []string) "-d", "--privileged", "--net=host", - fmt.Sprintf("--name=batcher-enclaver-%s", nameSuffix), + "--name=batcher-enclaver-"+nameSuffix, "--device=/dev/nitro_enclaves", name, ) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr + log.Info("Starting enclave container: %v...\n", "command", cmd.Args) + if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start enclave container: %w", err) }