From 8ab884c4e3701dc94116f08e18f982de59620d9f Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 10:58:47 -0800 Subject: [PATCH 01/33] Add support for ZK attestation service --- op-batcher/batcher/driver.go | 16 + op-batcher/batcher/espresso.go | 158 ++++------ op-batcher/batcher/service.go | 9 +- op-batcher/bindings/batch_authenticator.go | 115 +------ op-batcher/bindings/batch_inbox.go | 296 +----------------- .../src/L1/BatchAuthenticator.sol | 13 - 6 files changed, 94 insertions(+), 513 deletions(-) diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index 664d483de67..b9bcc443324 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -112,6 +112,22 @@ type DriverSetup struct { Attestation *nitrite.Result } +type OnchainProof struct { + Zktype string `json:"zktype"` + ZkvmVersion string `json:"zkvm_version"` + ProgramID struct { + VerifierID string `json:"verifier_id"` + VerifierProofID string `json:"verifier_proof_id"` + AggregatorID string `json:"aggregator_id"` + } `json:"program_id"` + RawProof struct { + EncodedProof string `json:"encoded_proof"` + Journal string `json:"journal"` + } `json:"raw_proof"` + OnchainProof string `json:"onchain_proof"` + ProofType string `json:"proof_type"` +} + // BatchSubmitter encapsulates a service responsible for submitting L2 tx // batches to L1 for availability. type BatchSubmitter struct { diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index b4ba62af4f8..a4ab3fd6845 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1,8 +1,13 @@ package batcher import ( + "bytes" + "encoding/hex" + "encoding/json" "errors" "fmt" + "io" + "net/http" "time" "context" @@ -12,9 +17,6 @@ import ( espressoClient "github.com/EspressoSystems/espresso-network/sdks/go/client" tagged_base64 "github.com/EspressoSystems/espresso-network/sdks/go/tagged-base64" espressoCommon "github.com/EspressoSystems/espresso-network/sdks/go/types" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" @@ -950,26 +952,6 @@ func (l *BatchSubmitter) fetchBlock(ctx context.Context, blockNumber uint64) (*t return block, nil } -// createVerifyCertTransaction creates transactiondata to verify a certificate `cert` against provided certManager. -// Returns (nil, nil) in case `cert` is already verified. -func createVerifyCertTransaction(certManager *bindings.CertManagerCaller, certManagerAbi *abi.ABI, cert []byte, isCa bool, parentCertHash common.Hash) ([]byte, error) { - certHash := crypto.Keccak256Hash(cert) - verified, err := certManager.Verified(nil, certHash) - if err != nil { - return nil, err - } - - if len(verified) != 0 { - return nil, nil - } - - if isCa { - return certManagerAbi.Pack("verifyCACert", cert, parentCertHash) - } else { - return certManagerAbi.Pack("verifyClientCert", cert, parentCertHash) - } -} - func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { if l.Attestation == nil { l.Log.Warn("Attestation is nil, skipping registration") @@ -979,128 +961,87 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { 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) + return fmt.Errorf("failed to check code at contrat address: %w", err) } if len(code) == 0 { - return fmt.Errorf("No contract deployed at this address %w", err) + return fmt.Errorf("no contract deployed at this address %w", err) } - batchAuthenticator, err := bindings.NewBatchAuthenticator(l.RollupConfig.BatchAuthenticatorAddress, l.L1Client) + abi, err := bindings.BatchAuthenticatorMetaData.GetAbi() if err != nil { - return fmt.Errorf("failed to create BatchAuthenticator contract bindings: %w", err) + return fmt.Errorf("failed to get Batch Authenticator ABI: %w", err) } - verifierAddress, err := batchAuthenticator.EspressoTEEVerifier(&bind.CallOpts{}) + attestationDocBytes, err := json.Marshal(l.Attestation.Document) if err != nil { - return fmt.Errorf("failed to get EspressoTEEVerifier address from BatchAuthenticator contract: %w", err) + return fmt.Errorf("failed to marshal attestation document: %w", err) } - - espressoTEEVerifier, err := bindings.NewEspressoTEEVerifierCaller(verifierAddress, l.L1Client) + onchainProof, err := l.GenerateZKProof(ctx, attestationDocBytes) if err != nil { - return fmt.Errorf("failed to create EspressoTEEVerifier contract bindings: %w", err) + return fmt.Errorf("failed to generate zk proof from nitro attestation: %w", err) } - nitroVerifierAddress, err := espressoTEEVerifier.EspressoNitroTEEVerifier(&bind.CallOpts{}) + journalBytes, err := hex.DecodeString(stripHexPrefix(onchainProof.RawProof.Journal)) if err != nil { - return fmt.Errorf("failed to get EspressoNitroTEEVerifier address from verifier contract: %w", err) + return fmt.Errorf("failed to decode journal hex string: %w", err) } - - nitroVerifier, err := bindings.NewEspressoNitroTEEVerifierCaller(nitroVerifierAddress, l.L1Client) + onchainProofBytes, err := hex.DecodeString(stripHexPrefix(onchainProof.OnchainProof)) if err != nil { - return fmt.Errorf("failed to create EspressoNitroTEEVerifier contract bindings: %w", err) + return fmt.Errorf("failed to decode onchain proof hex string: %w", err) } + log.Info("successfully generated zk proof from nitro attestation") - certManagerAddress, err := nitroVerifier.CertManager(&bind.CallOpts{}) + txData, err := abi.Pack("registerSigner", journalBytes, onchainProofBytes) if err != nil { - return fmt.Errorf("failed to get CertManager address from EspressoNitroTEEVerifier contract: %w", err) + return fmt.Errorf("failed to create registerSigner transaction: %w", err) } - certManager, err := bindings.NewCertManagerCaller(certManagerAddress, l.L1Client) - if err != nil { - return fmt.Errorf("failed to create CertManager contract bindings: %w", err) + candidate := txmgr.TxCandidate{ + TxData: txData, + To: &l.RollupConfig.BatchAuthenticatorAddress, } - certManagerAbi, err := bindings.CertManagerMetaData.GetAbi() + l.Log.Info("Registering batcher with the batch inbox contract") + _, err = l.Txmgr.Send(ctx, candidate) if err != nil { - return fmt.Errorf("failed to create CertManager contract bindings: %w", err) + return fmt.Errorf("failed to send registerBatcher transaction: %w", err) } - // 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 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) - } - - parentCertHash = crypto.Keccak256Hash(cert) - - // If createVerifyCertTransaction returned nil, certificate is already verified - // and there's no need to send a verification transaction for this certificate - if txData == nil { - continue - } + l.Log.Info("Registered batcher with the batch inbox contract") - l.Log.Info("Verifying CABundle", "certNumber", i, "certsTotal", len(l.Attestation.Document.CABundle)) - _, err = l.Txmgr.Send(ctx, txmgr.TxCandidate{ - TxData: txData, - To: &certManagerAddress, - }) + return nil +} - if err != nil { - return fmt.Errorf("verify certificate transaction failed: %w", err) - } +func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*OnchainProof, error) { + if l.Config.EspressoAttestationServiceURL == "" { + return nil, fmt.Errorf("espresso attestation service URL is not set") } - - txData, err := createVerifyCertTransaction(certManager, certManagerAbi, l.Attestation.Document.Certificate, false, parentCertHash) + request, err := http.NewRequestWithContext(ctx, "POST", l.Config.EspressoAttestationServiceURL+"/generate_proof", bytes.NewBuffer(attestationBytes)) if err != nil { - return fmt.Errorf("failed to create verify client certificate transaction: %w", err) + return nil, err } - if txData != nil { - l.Log.Info("Verifying Client Certificate") - _, err = l.Txmgr.Send(ctx, txmgr.TxCandidate{ - TxData: txData, - To: &certManagerAddress, - }) - - if err != nil { - return fmt.Errorf("verify client certificate transaction failed: %w", err) - } + request.Header.Set("Content-Type", "application/octet-stream") + client := http.Client{ + Timeout: 30 * time.Second, } - - abi, err := bindings.BatchAuthenticatorMetaData.GetAbi() + res, err := client.Do(request) if err != nil { - return fmt.Errorf("failed to get Batch Authenticator ABI: %w", err) + return nil, err } + defer res.Body.Close() - // Extract PCR0 hash from attestation document - pcr0Hash := crypto.Keccak256Hash(l.Attestation.Document.PCRs[0]) - - // Extract enclave address from attestation document public key - // The publicKey's first byte 0x04 determines if the public key is compressed or not, so we ignore it - publicKeyHash := crypto.Keccak256Hash(l.Attestation.Document.PublicKey[1:]) - enclaveAddress := common.BytesToAddress(publicKeyHash[12:]) - - txData, err = abi.Pack("registerSignerWithoutAttestationVerification", pcr0Hash, l.Attestation.COSESign1, l.Attestation.Signature, enclaveAddress) + responseData, err := io.ReadAll(res.Body) if err != nil { - return fmt.Errorf("failed to create RegisterSignerWithoutAttestationVerification transaction: %w", err) - } - - candidate := txmgr.TxCandidate{ - TxData: txData, - To: &l.RollupConfig.BatchAuthenticatorAddress, + return nil, err } - l.Log.Info("Registering batcher with the batch inbox contract") - _, err = l.Txmgr.Send(ctx, candidate) + var zkProof OnchainProof + err = json.Unmarshal(responseData, &zkProof) if err != nil { - return fmt.Errorf("failed to send registerBatcher transaction: %w", err) + return nil, err } - l.Log.Info("Registered batcher with the batch inbox contract") - - return nil + return &zkProof, nil } // sendTxWithEspresso uses the txmgr queue to send the given transaction candidate after setting @@ -1184,3 +1125,10 @@ func (l *BatchSubmitter) sendTxWithEspresso(txdata txData, isCancel bool, candid l.Log.Debug("Queueing transaction", "txRef", transactionReference) queue.Send(transactionReference, *candidate, receiptsCh) } + +func stripHexPrefix(hexStr string) string { + if len(hexStr) >= 2 && hexStr[:2] == "0x" { + return hexStr[2:] + } + return hexStr +} diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index bded41e01b0..32b2da5a8fa 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -39,10 +39,11 @@ import ( var ErrAlreadyStopped = errors.New("already stopped") type BatcherConfig struct { - NetworkTimeout time.Duration - PollInterval time.Duration - EspressoPollInterval time.Duration - MaxPendingTransactions uint64 + NetworkTimeout time.Duration + PollInterval time.Duration + EspressoPollInterval time.Duration + EspressoAttestationServiceURL string + MaxPendingTransactions uint64 // UseAltDA is true if the rollup config has a DA challenge address so the batcher // will post inputs to the DA server and post commitments to blobs or calldata. diff --git a/op-batcher/bindings/batch_authenticator.go b/op-batcher/bindings/batch_authenticator.go index f279acfe157..69c749f6aea 100644 --- a/op-batcher/bindings/batch_authenticator.go +++ b/op-batcher/bindings/batch_authenticator.go @@ -31,8 +31,8 @@ var ( // BatchAuthenticatorMetaData contains all meta data concerning the BatchAuthenticator contract. var BatchAuthenticatorMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"},{\"name\":\"_teeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonTeeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"activeIsTee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerSignerWithoutAttestationVerification\",\"inputs\":[{\"name\":\"pcr0Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"enclaveAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"switchBatcher\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"teeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", - Bin: "0x6101006040523461007b5761001e610015610197565b9291909161045e565b610026610080565b611dc1610668823960805181818161088001526115ba015260a0518161075e015260c0518181816109b801528181610bc501528181610f9201526114b9015260e05181818161029b0152610e780152611dc190f35b610086565b60405190565b5f80fd5b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906100b29061008a565b810190811060018060401b038211176100ca57604052565b610094565b906100e26100db610080565b92836100a8565b565b5f80fd5b60018060a01b031690565b6100fc906100e8565b90565b610108906100f3565b90565b610114816100ff565b0361011b57565b5f80fd5b9050519061012c8261010b565b565b610137816100f3565b0361013e57565b5f80fd5b9050519061014f8261012e565b565b60808183031261019257610167825f830161011f565b9261018f6101788460208501610142565b936101868160408601610142565b93606001610142565b90565b6100e4565b6101b5612429803803806101aa816100cf565b928339810190610151565b90919293565b90565b90565b6101d56101d06101da926101bb565b6101be565b6100e8565b90565b6101e6906101c1565b90565b60209181520190565b60207f6368657200000000000000000000000000000000000000000000000000000000917f426174636841757468656e74696361746f723a207a65726f20746565206261745f8201520152565b61024c60246040926101e9565b610255816101f2565b0190565b61026e9060208101905f81830391015261023f565b90565b1561027857565b610280610080565b62461bcd60e51b81528061029660048201610259565b0390fd5b60207f2062617463686572000000000000000000000000000000000000000000000000917f426174636841757468656e74696361746f723a207a65726f206e6f6e2d7465655f8201520152565b6102f460286040926101e9565b6102fd8161029a565b0190565b6103169060208101905f8183039101526102e7565b90565b1561032057565b610328610080565b62461bcd60e51b81528061033e60048201610301565b0390fd5b61034c90516100ff565b90565b61036361035e610368926100e8565b6101be565b6100e8565b90565b6103749061034f565b90565b6103809061036b565b90565b60e01b90565b610392906100f3565b90565b61039e81610389565b036103a557565b5f80fd5b905051906103b682610395565b565b906020828203126103d1576103ce915f016103a9565b90565b6100e4565b5f0190565b6103e3610080565b3d5f823e3d90fd5b6103f49061036b565b90565b6104009061034f565b90565b61040c906103f7565b90565b5f1b90565b9061042060ff9161040f565b9181191691161790565b151590565b6104389061042a565b90565b90565b9061045361044e61045a9261042f565b61043b565b8254610414565b9055565b906104ea93929161046d61056a565b6104928261048b6104856104805f6101dd565b6100f3565b916100f3565b1415610271565b6104b7836104b06104aa6104a55f6101dd565b6100f3565b916100f3565b1415610319565b60c05260805260a05260206104d46104cf60c0610342565b610377565b63d80a4c28906104e2610080565b948592610383565b825281806104fa600482016103d6565b03915afa80156105655761051c61052191610535945f91610537575b506103eb565b610403565b60e0526105306001600261043e565b6105f7565b565b610558915060203d811161055e575b61055081836100a8565b8101906103b8565b5f610516565b503d610546565b6103db565b61057a61057561065a565b6105f7565b565b5f1c90565b60018060a01b031690565b61059861059d9161057c565b610581565b90565b6105aa905461058c565b90565b906105be60018060a01b039161040f565b9181191691161790565b6105d19061036b565b90565b90565b906105ec6105e76105f3926105c8565b6105d4565b82546105ad565b9055565b6106005f6105a0565b61060a825f6105d7565b9061063e6106387f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0936105c8565b916105c8565b91610647610080565b80610651816103d6565b0390a3565b5f90565b610662610656565b50339056fe60806040526004361015610013575b610ab7565b61001d5f3561010c565b806302afd6e3146101075780631b076a4c1461010257806354fd4d50146100fd578063715018a6146100f85780637877a9ed146100f35780638da5cb5b146100ee578063a903a277146100e9578063b1bd4285146100e4578063ba58e82a146100df578063bc347f47146100da578063d909ba7c146100d5578063f2fde38b146100d0578063f81f2083146100cb578063fa14fe6d146100c65763fc619e410361000e57610a83565b610a08565b610981565b6108f5565b6108a2565b61084b565b610814565b610780565b610726565b6105c8565b610571565b6104d8565b6104a3565b610316565b610250565b60e01c90565b60405190565b5f80fd5b5f80fd5b5f80fd5b90565b61013081610124565b0361013757565b5f80fd5b9050359061014882610127565b565b5f80fd5b5f80fd5b5f80fd5b909182601f830112156101905781359167ffffffffffffffff831161018b57602001926001830284011161018657565b610152565b61014e565b61014a565b60018060a01b031690565b6101a990610195565b90565b6101b5816101a0565b036101bc57565b5f80fd5b905035906101cd826101ac565b565b9190608083820312610246576101e7815f850161013b565b92602081013567ffffffffffffffff81116102415782610208918301610156565b929093604083013567ffffffffffffffff811161023c5761022e83610239928601610156565b9390946060016101c0565b90565b610120565b610120565b61011c565b5f0190565b346102855761026f6102633660046101cf565b94939093929192610bb6565b610277610112565b806102818161024b565b0390f35b610118565b5f91031261029457565b61011c565b7f000000000000000000000000000000000000000000000000000000000000000090565b90565b6102d46102cf6102d992610195565b6102bd565b610195565b90565b6102e5906102c0565b90565b6102f1906102dc565b90565b6102fd906102e8565b9052565b9190610314905f602085019401906102f4565b565b346103465761032636600461028a565b610342610331610299565b610339610112565b91829182610301565b0390f35b610118565b601f801991011690565b634e487b7160e01b5f52604160045260245ffd5b906103739061034b565b810190811067ffffffffffffffff82111761038d57604052565b610355565b906103a561039e610112565b9283610369565b565b67ffffffffffffffff81116103c5576103c160209161034b565b0190565b610355565b906103dc6103d7836103a7565b610392565b918252565b5f7f312e302e30000000000000000000000000000000000000000000000000000000910152565b61041260056103ca565b9061041f602083016103e1565b565b610429610408565b90565b610434610421565b90565b61043f61042c565b90565b5190565b60209181520190565b90825f9392825e0152565b6104796104826020936104879361047081610442565b93848093610446565b9586910161044f565b61034b565b0190565b6104a09160208201915f81840391015261045a565b90565b346104d3576104b336600461028a565b6104cf6104be610437565b6104c6610112565b9182918261048b565b0390f35b610118565b34610506576104e836600461028a565b6104f0610d34565b6104f8610112565b806105028161024b565b0390f35b610118565b1c90565b60ff1690565b61052590600861052a930261050b565b61050f565b90565b906105389154610515565b90565b61054760025f9061052d565b90565b151590565b6105589061054a565b9052565b919061056f905f6020850194019061054f565b565b346105a15761058136600461028a565b61059d61058c61053b565b610594610112565b9182918261055c565b0390f35b610118565b6105af906101a0565b9052565b91906105c6905f602085019401906105a6565b565b346105f8576105d836600461028a565b6105f46105e3610d73565b6105eb610112565b918291826105b3565b0390f35b610118565b5f80fd5b67ffffffffffffffff811161061f5761061b60209161034b565b0190565b610355565b90825f939282370152565b9092919261064461063f82610601565b610392565b938185526020850190828401116106605761065e92610624565b565b6105fd565b9080601f83011215610683578160206106809335910161062f565b90565b61014a565b906020828203126106b8575f82013567ffffffffffffffff81116106b3576106b09201610665565b90565b610120565b61011c565b5190565b60209181520190565b6106e96106f26020936106f7936106e0816106bd565b938480936106c1565b9586910161044f565b61034b565b0190565b90916107156107239360408401908482035f8601526106ca565b9160208184039101526106ca565b90565b346107575761073e610739366004610688565b610e5b565b9061075361074a610112565b928392836106fb565b0390f35b610118565b7f000000000000000000000000000000000000000000000000000000000000000090565b346107b05761079036600461028a565b6107ac61079b61075c565b6107a3610112565b918291826105b3565b0390f35b610118565b909160408284031261080f575f82013567ffffffffffffffff811161080a57836107e0918401610156565b929093602082013567ffffffffffffffff8111610805576108019201610156565b9091565b610120565b610120565b61011c565b34610846576108306108273660046107b5565b92919091610f8a565b610838610112565b806108428161024b565b0390f35b610118565b346108795761085b36600461028a565b6108636110d9565b61086b610112565b806108758161024b565b0390f35b610118565b7f000000000000000000000000000000000000000000000000000000000000000090565b346108d2576108b236600461028a565b6108ce6108bd61087e565b6108c5610112565b918291826105b3565b0390f35b610118565b906020828203126108f0576108ed915f016101c0565b90565b61011c565b346109235761090d6109083660046108d7565b6111ce565b610915610112565b8061091f8161024b565b0390f35b610118565b906020828203126109415761093e915f0161013b565b90565b61011c565b61094f90610124565b90565b9061095c90610946565b5f5260205260405f2090565b61097e906109796001915f92610952565b61052d565b90565b346109b1576109ad61099c610997366004610928565b610968565b6109a4610112565b9182918261055c565b0390f35b610118565b7f000000000000000000000000000000000000000000000000000000000000000090565b6109e3906102dc565b90565b6109ef906109da565b9052565b9190610a06905f602085019401906109e6565b565b34610a3857610a1836600461028a565b610a34610a236109b6565b610a2b610112565b918291826109f3565b0390f35b610118565b919091604081840312610a7e57610a56835f830161013b565b92602082013567ffffffffffffffff8111610a7957610a759201610156565b9091565b610120565b61011c565b34610ab257610a9c610a96366004610a3d565b91611436565b610aa4610112565b80610aae8161024b565b0390f35b610118565b5f80fd5b5f80fd5b60e01b90565b610ace906101a0565b90565b610ada81610ac5565b03610ae157565b5f80fd5b90505190610af282610ad1565b565b90602082820312610b0d57610b0a915f01610ae5565b90565b61011c565b610b1a610112565b3d5f823e3d90fd5b610b2b906102dc565b90565b5f910312610b3857565b61011c565b610b4690610124565b9052565b9190610b6481610b5d81610b69956106c1565b8095610624565b61034b565b0190565b9695939094610b9e88606095610bac95610b91610bb49a5f60808601950190610b3d565b8b830360208d0152610b4a565b9188830360408a0152610b4a565b9401906105a6565b565b9194909293610bff6020610be97f00000000000000000000000000000000000000000000000000000000000000006109da565b63d80a4c2890610bf7610112565b938492610abf565b82528180610c0f6004820161024b565b03915afa8015610cdf57610c2a915f91610cb1575b50610b22565b926302afd6e390949695919295843b15610cac575f96610c5e948894610c6993610c52610112565b9b8c9a8b998a98610abf565b885260048801610b6d565b03925af18015610ca757610c7b575b50565b610c9a905f3d8111610ca0575b610c928183610369565b810190610b2e565b5f610c78565b503d610c88565b610b12565b610abb565b610cd2915060203d8111610cd8575b610cca8183610369565b810190610af4565b5f610c24565b503d610cc0565b610b12565b610cec61174a565b610cf4610d21565b565b90565b610d0d610d08610d1292610cf6565b6102bd565b610195565b90565b610d1e90610cf9565b90565b610d32610d2d5f610d15565b6117c0565b565b610d3c610ce4565b565b5f90565b5f1c90565b60018060a01b031690565b610d5e610d6391610d42565b610d47565b90565b610d709054610d52565b90565b610d7b610d3e565b50610d855f610d66565b90565b606090565b90929192610da2610d9d82610601565b610392565b93818552602085019082840111610dbe57610dbc9261044f565b565b6105fd565b9080601f83011215610de157816020610dde93519101610d8d565b90565b61014a565b919091604081840312610e3e575f81015167ffffffffffffffff8111610e395783610e12918301610dc3565b92602082015167ffffffffffffffff8111610e3457610e319201610dc3565b90565b610120565b610120565b61011c565b610e589160208201915f8184039101526106ca565b90565b905f610ec392610e69610d88565b50610e72610d88565b50610e9c7f00000000000000000000000000000000000000000000000000000000000000006102e8565b610eb863a903a277610eac610112565b96879485938493610abf565b835260048301610e43565b03915afa8015610f03575f80939091610edc575b509190565b9050610efb9192503d805f833e610ef38183610369565b810190610de6565b91905f610ed7565b610b12565b634e487b7160e01b5f52602160045260245ffd5b60021115610f2657565b610f08565b90610f3582610f1c565b565b610f4090610f2b565b90565b610f4c90610f37565b9052565b959492610f8894610f72610f809360409560608b01918b83035f8d0152610b4a565b9188830360208a0152610b4a565b940190610f43565b565b929192610fb67f00000000000000000000000000000000000000000000000000000000000000006109da565b906335ecb4c190929493600191833b1561103857610ff5610fea935f97938894610fde610112565b9a8b998a988997610abf565b875260048701610f50565b03925af1801561103357611007575b50565b611026905f3d811161102c575b61101e8183610369565b810190610b2e565b5f611004565b503d611014565b610b12565b610abb565b61104561174a565b61104d6110ba565b565b61105b61106091610d42565b61050f565b90565b61106d905461104f565b90565b5f1b90565b9061108160ff91611070565b9181191691161790565b6110949061054a565b90565b90565b906110af6110aa6110b69261108b565b611097565b8254611075565b9055565b6110d76110d06110ca6002611063565b1561054a565b600261109a565b565b6110e161103d565b565b6110f4906110ef61174a565b61119e565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201520152565b6111506026604092610446565b611159816110f6565b0190565b6111729060208101905f818303910152611143565b90565b1561117c57565b611184610112565b62461bcd60e51b81528061119a6004820161115d565b0390fd5b6111cc906111c7816111c06111ba6111b55f610d15565b6101a0565b916101a0565b1415611175565b6117c0565b565b6111d7906110e3565b565b6111e491369161062f565b90565b634e487b7160e01b5f52603260045260245ffd5b90611205826106bd565b81101561121757600160209102010190565b6111e7565b90565b90565b61123661123161123b9261121c565b6102bd565b61121f565b90565b60ff60f81b1690565b611251905161123e565b90565b60f81c90565b60ff1690565b61127461126f6112799261125a565b6102bd565b61125a565b90565b61128861128d91611254565b611260565b90565b6112a461129f6112a992610cf6565b6102bd565b61125a565b90565b90565b6112c36112be6112c8926112ac565b6102bd565b61125a565b90565b90565b6112e26112dd6112e7926112cb565b6102bd565b61125a565b90565b634e487b7160e01b5f52601160045260245ffd5b61130a6113109161125a565b9161125a565b019060ff821161131c57565b6112ea565b60f81b90565b61133b6113366113409261125a565b611321565b61123e565b90565b5f7f496e76616c6964207369676e6174757265000000000000000000000000000000910152565b6113776011602092610446565b61138081611343565b0190565b6113999060208101905f81830391015261136a565b90565b6113a58161054a565b036113ac57565b5f80fd5b905051906113bd8261139c565b565b906020828203126113d8576113d5915f016113b0565b90565b61011c565b5f7f496e76616c6964207369676e6572000000000000000000000000000000000000910152565b611411600e602092610446565b61141a816113dd565b0190565b6114339060208101905f818303910152611404565b90565b916114449061148f926111d9565b61146861146361145e836114586040611222565b906111fb565b611247565b61127c565b8061147b6114755f611290565b9161125a565b1480156116ae575b611673575b508261181f565b806114aa6114a461149f5f610d15565b6101a0565b916101a0565b14611651576114f360206114dd7f00000000000000000000000000000000000000000000000000000000000000006109da565b63d80a4c28906114eb610112565b938492610abf565b825281806115036004820161024b565b03915afa801561164c5761152460209161154e935f9161161f575b50610b22565b630123d0c1906115438592611537610112565b95869485938493610abf565b8352600483016105b3565b03915afa801561161a5761156a915f916115ec575b501561054a565b90816115b0575b5061158e5761158c906115876001916001610952565b61109a565b565b611596610112565b62461bcd60e51b8152806115ac6004820161141e565b0390fd5b90506115e46115de7f00000000000000000000000000000000000000000000000000000000000000006101a0565b916101a0565b14155f611571565b61160d915060203d8111611613575b6116058183610369565b8101906113bf565b5f611563565b503d6115fb565b610b12565b61163f9150833d8111611645575b6116378183610369565b810190610af4565b5f61151e565b503d61162d565b610b12565b611659610112565b62461bcd60e51b81528061166f60048201611384565b0390fd5b61168a61168f91611684601b6112ce565b906112fe565b611327565b6116a7826116a16040935f1a93611222565b906111fb565b535f611488565b50806116c36116bd60016112af565b9161125a565b14611483565b5f7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6116fc60208092610446565b611705816116c9565b0190565b61171e9060208101905f8183039101526116f0565b90565b1561172857565b611730610112565b62461bcd60e51b81528061174660048201611709565b0390fd5b611774611755610d73565b61176e611768611763611840565b6101a0565b916101a0565b14611721565b565b9061178760018060a01b0391611070565b9181191691161790565b61179a906102dc565b90565b90565b906117b56117b06117bc92611791565b61179d565b8254611776565b9055565b6117c95f610d66565b6117d3825f6117a0565b906118076118017f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093611791565b91611791565b91611810610112565b8061181a8161024b565b0390a3565b61183d916118359161182f610d3e565b50611878565b919091611ac7565b90565b611848610d3e565b503390565b5f90565b90565b61186861186361186d92611851565b6102bd565b61121f565b90565b5f90565b5f90565b611880610d3e565b5061188961184d565b50611893826106bd565b6118a66118a06041611854565b9161121f565b145f146118eb576118e5916118b9611870565b506118c2611870565b506118cb611874565b506020810151606060408301519201515f1a909192611c90565b91909190565b50506118f65f610d15565b90600290565b6005111561190657565b610f08565b90611915826118fc565b565b60207f7565000000000000000000000000000000000000000000000000000000000000917f45434453413a20696e76616c6964207369676e6174757265202776272076616c5f8201520152565b6119716022604092610446565b61197a81611917565b0190565b6119939060208101905f818303910152611964565b90565b60207f7565000000000000000000000000000000000000000000000000000000000000917f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201520152565b6119f06022604092610446565b6119f981611996565b0190565b611a129060208101905f8183039101526119e3565b90565b5f7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800910152565b611a49601f602092610446565b611a5281611a15565b0190565b611a6b9060208101905f818303910152611a3c565b90565b5f7f45434453413a20696e76616c6964207369676e61747572650000000000000000910152565b611aa26018602092610446565b611aab81611a6e565b0190565b611ac49060208101905f818303910152611a95565b90565b80611ada611ad45f61190b565b9161190b565b145f14611ae45750565b80611af8611af2600161190b565b9161190b565b145f14611b2157611b07610112565b62461bcd60e51b815280611b1d60048201611aaf565b0390fd5b80611b35611b2f600261190b565b9161190b565b145f14611b5e57611b44610112565b62461bcd60e51b815280611b5a60048201611a56565b0390fd5b80611b72611b6c600361190b565b9161190b565b145f14611b9b57611b81610112565b62461bcd60e51b815280611b97600482016119fd565b0390fd5b611bae611ba8600461190b565b9161190b565b14611bb557565b611bbd610112565b62461bcd60e51b815280611bd36004820161197e565b0390fd5b611beb611be6611bf09261121f565b6102bd565b61121f565b90565b611bff611c0491610d42565b611bd7565b90565b90565b611c1e611c19611c2392611c07565b6102bd565b61121f565b90565b90565b611c3d611c38611c4292611c26565b6102bd565b61125a565b90565b611c4e9061125a565b9052565b611c87611c8e94611c7d606094989795611c73608086019a5f870190610b3d565b6020850190611c45565b6040830190610b3d565b0190610b3d565b565b929190611c9b610d3e565b50611ca461184d565b50611cae83611bf3565b611ce0611cda7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0611c0a565b9161121f565b11611da15780611cf9611cf3601b6112ce565b9161125a565b141580611d85575b611d7257611d205f936020959293611d17610112565b94859485611c52565b838052039060015afa15611d6d57611d385f51611070565b80611d53611d4d611d485f610d15565b6101a0565b916101a0565b14611d5d57905f90565b50611d675f610d15565b90600190565b610b12565b50505050611d7f5f610d15565b90600490565b5080611d9a611d94601c611c29565b9161125a565b1415611d01565b50505050611dae5f610d15565b9060039056fea164736f6c634300081c000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"},{\"name\":\"_preApprovedBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preApprovedBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerSignerWithoutAttestationVerification\",\"inputs\":[{\"name\":\"pcr0Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"enclaveAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60e0806040523461012c57606081611575803803809161001f8285610143565b83398101031261012c5780516001600160a01b0381169182820361012c576004928161005a6040610053602080960161017a565b920161017a565b936100643361018e565b60a052608052604051631b01498560e31b815293849182905afa8015610138575f906100ee575b6001600160a01b031660c0526100a1915061018e565b6040516113a090816101d582396080518181816102de0152610b8f015260a0518181816101950152818161051f015281816107690152610cf8015260c0518181816109000152610bfe0152f35b50906020813d602011610130575b8161010960209383610143565b8101031261012c5751906001600160a01b038216820361012c576100a19161008b565b5f80fd5b3d91506100fc565b6040513d5f823e3d90fd5b601f909101601f19168101906001600160401b0382119082101761016657604052565b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361012c57565b5f80546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816302afd6e314610c22575080631b076a4c14610bb35780631f568b1814610b4457806354fd4d5014610ac5578063715018a614610a295780638da5cb5b146109d8578063a903a27714610847578063ba58e82a146106dd578063f2fde38b14610590578063f81f208314610543578063fa14fe6d146104d45763fc619e41146100a2575f80fd5b346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043560243567ffffffffffffffff81116104cf576100f76100fe913690600401610e1c565b3691610f35565b8051604010156104a25760608101805160f81c80158015610498575b6103db575b505061014b61014373ffffffffffffffffffffffffffffffffffffffff9284611099565b9190916110ce565b16801561037d576040517fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9081156103455773ffffffffffffffffffffffffffffffffffffffff916020918691610350575b506024604051809481937f0123d0c1000000000000000000000000000000000000000000000000000000008352876004840152165afa908115610345578491610306575b501590816102c5575b5061026757815260016020526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905580f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c6964207369676e65720000000000000000000000000000000000006044820152fd5b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614155f61022b565b90506020813d60201161033d575b8161032160209383610e4a565b8101031261033957518015158103610339575f610222565b8380fd5b3d9150610314565b6040513d86823e3d90fd5b6103709150823d8411610376575b6103688183610e4a565b810190610f6b565b5f6101de565b503d61035e565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152fd5b601b0160ff811161046b5782516040101561043e5773ffffffffffffffffffffffffffffffffffffffff9261014b927fff000000000000000000000000000000000000000000000000000000000000006101439360f81b16871a9053925061011f565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b506001811461011a565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b825b80fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760ff60406020926004358152600184522054166040519015158152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043573ffffffffffffffffffffffffffffffffffffffff81168091036106d9576105e961101b565b80156106555773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b5080fd5b50346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1578060043567ffffffffffffffff81116108445761072e903690600401610e1c565b9060243567ffffffffffffffff81116108415761074f903690600401610e1c565b92909173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690813b1561083d57856107d9936108098296604051988997889687957f35ecb4c1000000000000000000000000000000000000000000000000000000008752606060048801526064870191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc858403016024860152610f97565b6001604483015203925af18015610832576108215750f35b8161082b91610e4a565b6104d15780f35b6040513d84823e3d90fd5b8580fd5b50505b50fd5b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043567ffffffffffffffff81116106d95781366023830112156104d1576108ac6108e7923690602481600401359101610f35565b604051809381927fa903a277000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ef2565b038173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9182156109cc5780918193610960575b61094e8361095c86604051938493604085526040850190610ef2565b908382036020850152610ef2565b0390f35b915091503d8083833e6109738183610e4a565b8101916040828403126104d157815167ffffffffffffffff81116106d9578361099d918401610fd5565b9160208101519167ffffffffffffffff83116104d1575061094e9361095c926109c69201610fd5565b92610932565b604051903d90823e3d90fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157610a6061101b565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1575061095c604051610b06604082610e4a565b600581527f312e302e300000000000000000000000000000000000000000000000000000006020820152604051918291602083526020830190610ef2565b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b905034610df95760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610df95760243567ffffffffffffffff8111610df957610c73903690600401610e1c565b909160443567ffffffffffffffff8111610df957610c95903690600401610e1c565b936064359273ffffffffffffffffffffffffffffffffffffffff8416809403610df9577fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa8015610dee5773ffffffffffffffffffffffffffffffffffffffff915f91610dfd575b501691823b15610df9575f94610d9894610dc88793604051998a98899788967f02afd6e30000000000000000000000000000000000000000000000000000000088526004356004890152608060248901526084880191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc868403016044870152610f97565b90606483015203925af18015610dee57610de0575080f35b610dec91505f90610e4a565b005b6040513d5f823e3d90fd5b5f80fd5b610e16915060203d602011610376576103688183610e4a565b5f610d3d565b9181601f84011215610df95782359167ffffffffffffffff8311610df95760208381860195010111610df957565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610e8b57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b67ffffffffffffffff8111610e8b57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b929192610f4182610eb8565b91610f4f6040519384610e4a565b829481845281830111610df9578281602093845f960137010152565b90816020910312610df9575173ffffffffffffffffffffffffffffffffffffffff81168103610df95790565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe093818652868601375f8582860101520116010190565b81601f82011215610df957805190610fec82610eb8565b92610ffa6040519485610e4a565b82845260208383010111610df957815f9260208093018386015e8301015290565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361103b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9060418151145f146110c5576110c191602082015190606060408401519301515f1a906112f1565b9091565b50505f90600290565b60058110156112c457806110df5750565b600181036111455760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036111ab5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600381036112375760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461124057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116113955760ff1690601b8214158061138a575b61137f576020935f93608093604051938452868401526040830152606082015282805260015afa15610dee575f5173ffffffffffffffffffffffffffffffffffffffff81161561137757905f90565b505f90600190565b505050505f90600490565b50601c821415611328565b505050505f9060039056", } // BatchAuthenticatorABI is the input ABI used to generate the binding from. @@ -44,7 +44,7 @@ var BatchAuthenticatorABI = BatchAuthenticatorMetaData.ABI var BatchAuthenticatorBin = BatchAuthenticatorMetaData.Bin // DeployBatchAuthenticator deploys a new Ethereum contract, binding an instance of BatchAuthenticator to it. -func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBackend, _espressoTEEVerifier common.Address, _teeBatcher common.Address, _nonTeeBatcher common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchAuthenticator, error) { +func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBackend, _espressoTEEVerifier common.Address, _preApprovedBatcher common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchAuthenticator, error) { parsed, err := BatchAuthenticatorMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -53,7 +53,7 @@ func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBack return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchAuthenticatorBin), backend, _espressoTEEVerifier, _teeBatcher, _nonTeeBatcher, _owner) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchAuthenticatorBin), backend, _espressoTEEVerifier, _preApprovedBatcher, _owner) if err != nil { return common.Address{}, nil, nil, err } @@ -202,37 +202,6 @@ func (_BatchAuthenticator *BatchAuthenticatorTransactorRaw) Transact(opts *bind. return _BatchAuthenticator.Contract.contract.Transact(opts, method, params...) } -// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. -// -// Solidity: function activeIsTee() view returns(bool) -func (_BatchAuthenticator *BatchAuthenticatorCaller) ActiveIsTee(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "activeIsTee") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. -// -// Solidity: function activeIsTee() view returns(bool) -func (_BatchAuthenticator *BatchAuthenticatorSession) ActiveIsTee() (bool, error) { - return _BatchAuthenticator.Contract.ActiveIsTee(&_BatchAuthenticator.CallOpts) -} - -// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. -// -// Solidity: function activeIsTee() view returns(bool) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) ActiveIsTee() (bool, error) { - return _BatchAuthenticator.Contract.ActiveIsTee(&_BatchAuthenticator.CallOpts) -} - // DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. // // Solidity: function decodeAttestationTbs(bytes attestation) view returns(bytes, bytes) @@ -327,37 +296,6 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) NitroValidator() (co return _BatchAuthenticator.Contract.NitroValidator(&_BatchAuthenticator.CallOpts) } -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCaller) NonTeeBatcher(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "nonTeeBatcher") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorSession) NonTeeBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.NonTeeBatcher(&_BatchAuthenticator.CallOpts) -} - -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) NonTeeBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.NonTeeBatcher(&_BatchAuthenticator.CallOpts) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -389,12 +327,12 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) Owner() (common.Addr return _BatchAuthenticator.Contract.Owner(&_BatchAuthenticator.CallOpts) } -// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. +// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. // -// Solidity: function teeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCaller) TeeBatcher(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function preApprovedBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCaller) PreApprovedBatcher(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "teeBatcher") + err := _BatchAuthenticator.contract.Call(opts, &out, "preApprovedBatcher") if err != nil { return *new(common.Address), err @@ -406,18 +344,18 @@ func (_BatchAuthenticator *BatchAuthenticatorCaller) TeeBatcher(opts *bind.CallO } -// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. +// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. // -// Solidity: function teeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorSession) TeeBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.TeeBatcher(&_BatchAuthenticator.CallOpts) +// Solidity: function preApprovedBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorSession) PreApprovedBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.PreApprovedBatcher(&_BatchAuthenticator.CallOpts) } -// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. +// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. // -// Solidity: function teeBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) TeeBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.TeeBatcher(&_BatchAuthenticator.CallOpts) +// Solidity: function preApprovedBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCallerSession) PreApprovedBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.PreApprovedBatcher(&_BatchAuthenticator.CallOpts) } // ValidBatchInfo is a free data retrieval call binding the contract method 0xf81f2083. @@ -566,27 +504,6 @@ func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) RenounceOwnershi return _BatchAuthenticator.Contract.RenounceOwnership(&_BatchAuthenticator.TransactOpts) } -// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. -// -// Solidity: function switchBatcher() returns() -func (_BatchAuthenticator *BatchAuthenticatorTransactor) SwitchBatcher(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BatchAuthenticator.contract.Transact(opts, "switchBatcher") -} - -// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. -// -// Solidity: function switchBatcher() returns() -func (_BatchAuthenticator *BatchAuthenticatorSession) SwitchBatcher() (*types.Transaction, error) { - return _BatchAuthenticator.Contract.SwitchBatcher(&_BatchAuthenticator.TransactOpts) -} - -// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. -// -// Solidity: function switchBatcher() returns() -func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) SwitchBatcher() (*types.Transaction, error) { - return _BatchAuthenticator.Contract.SwitchBatcher(&_BatchAuthenticator.TransactOpts) -} - // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() diff --git a/op-batcher/bindings/batch_inbox.go b/op-batcher/bindings/batch_inbox.go index 7009f1b2330..1848251c715 100644 --- a/op-batcher/bindings/batch_inbox.go +++ b/op-batcher/bindings/batch_inbox.go @@ -31,8 +31,8 @@ var ( // BatchInboxMetaData contains all meta data concerning the BatchInbox contract. var BatchInboxMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"batchAuthenticator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", - Bin: "0x60c060405234801561000f575f5ffd5b50604051610f9b380380610f9b8339818101604052810190610031919061029d565b61004d61004261013c60201b60201c565b61014360201b60201c565b5f8273ffffffffffffffffffffffffffffffffffffffff1663b1bd42856040518163ffffffff1660e01b8152600401602060405180830381865afa158015610097573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100bb91906102db565b90508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250506101348261014360201b60201c565b505050610306565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61023182610208565b9050919050565b5f61024282610227565b9050919050565b61025281610238565b811461025c575f5ffd5b50565b5f8151905061026d81610249565b92915050565b61027c81610227565b8114610286575f5ffd5b50565b5f8151905061029781610273565b92915050565b5f5f604083850312156102b3576102b2610204565b5b5f6102c08582860161025f565b92505060206102d185828601610289565b9150509250929050565b5f602082840312156102f0576102ef610204565b5b5f6102fd84828501610289565b91505092915050565b60805160a051610c596103425f395f8181605c0152818161019a0152818161029401526104e101525f818161037201526104bd0152610c595ff3fe608060405234801561000f575f5ffd5b5060043610610059575f3560e01c8063715018a6146104015780638da5cb5b1461040b578063b1bd428514610429578063e758457314610447578063f2fde38b146104655761005a565b5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637877a9ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e79190610704565b15610370575f5f1b5f4914610277575f5f67ffffffffffffffff8111156101115761011061072f565b5b6040519080825280601f01601f1916602001820160405280156101435781602001600182028036833780820191505090505b5090505f5f90505b5f5f1b81491461018d578181496040516020016101699291906107d7565b6040516020818303038152906040529150808061018590610834565b91505061014b565b5f828051906020012090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016101f1919061088a565b602060405180830381865afa15801561020c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102309190610704565b61026f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610266906108fd565b60405180910390fd5b50505061036b565b5f5f3660405161028892919061094d565b604051809103902090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016102eb919061088a565b602060405180830381865afa158015610306573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061032a9190610704565b610369576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906109af565b60405180910390fd5b505b6103ff565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f590610a17565b60405180910390fd5b5b005b610409610481565b005b610413610494565b6040516104209190610a74565b60405180910390f35b6104316104bb565b60405161043e9190610a74565b60405180910390f35b61044f6104df565b60405161045c9190610ae8565b60405180910390f35b61047f600480360381019061047a9190610b2b565b610503565b005b610489610585565b6104925f610603565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61050b610585565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090610bc6565b60405180910390fd5b61058281610603565b50565b61058d6106c4565b73ffffffffffffffffffffffffffffffffffffffff166105ab610494565b73ffffffffffffffffffffffffffffffffffffffff1614610601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f890610c2e565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f5ffd5b5f8115159050919050565b6106e3816106cf565b81146106ed575f5ffd5b50565b5f815190506106fe816106da565b92915050565b5f60208284031215610719576107186106cb565b5b5f610726848285016106f0565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6107888261075c565b6107928185610766565b93506107a2818560208601610770565b80840191505092915050565b5f819050919050565b5f819050919050565b6107d16107cc826107ae565b6107b7565b82525050565b5f6107e2828561077e565b91506107ee82846107c0565b6020820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f819050919050565b5f61083e8261082b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108705761086f6107fe565b5b600182019050919050565b610884816107ae565b82525050565b5f60208201905061089d5f83018461087b565b92915050565b5f82825260208201905092915050565b7f496e76616c696420626c6f6220626174636800000000000000000000000000005f82015250565b5f6108e76012836108a3565b91506108f2826108b3565b602082019050919050565b5f6020820190508181035f830152610914816108db565b9050919050565b828183375f83830152505050565b5f6109348385610766565b935061094183858461091b565b82840190509392505050565b5f610959828486610929565b91508190509392505050565b7f496e76616c69642063616c6c64617461206261746368000000000000000000005f82015250565b5f6109996016836108a3565b91506109a482610965565b602082019050919050565b5f6020820190508181035f8301526109c68161098d565b9050919050565b7f4261746368496e626f783a20756e617574686f72697a656420626174636865725f82015250565b5f610a016020836108a3565b9150610a0c826109cd565b602082019050919050565b5f6020820190508181035f830152610a2e816109f5565b9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a5e82610a35565b9050919050565b610a6e81610a54565b82525050565b5f602082019050610a875f830184610a65565b92915050565b5f819050919050565b5f610ab0610aab610aa684610a35565b610a8d565b610a35565b9050919050565b5f610ac182610a96565b9050919050565b5f610ad282610ab7565b9050919050565b610ae281610ac8565b82525050565b5f602082019050610afb5f830184610ad9565b92915050565b610b0a81610a54565b8114610b14575f5ffd5b50565b5f81359050610b2581610b01565b92915050565b5f60208284031215610b4057610b3f6106cb565b5b5f610b4d84828501610b17565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f610bb06026836108a3565b9150610bbb82610b56565b604082019050919050565b5f6020820190508181035f830152610bdd81610ba4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f610c186020836108a3565b9150610c2382610be4565b602082019050919050565b5f6020820190508181035f830152610c4581610c0c565b905091905056fea164736f6c634300081c000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"}]", + Bin: "0x60a0604052348015600e575f5ffd5b506040516103e33803806103e3833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f5ffd5b81516001600160a01b0381168114605f575f5ffd5b9392505050565b60805161035f6100845f395f8181609d01526101d0015261035f5ff3fe608060405234801561000f575f5ffd5b505f491561018857604080515f80825260208201909252905b804915610067578181496040516020016100439291906102b4565b6040516020818303038152906040529150808061005f906102ce565b915050610028565b815160208301206040517ff81f2083000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa1580156100f7573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061011b919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420626c6f62206261746368000000000000000000000000000060448201526064015b60405180910390fd5b005b5f5f36604051610199929190610350565b6040519081900381207ff81f20830000000000000000000000000000000000000000000000000000000082526004820181905291507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa15801561022a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061024e919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c69642063616c6c6461746120626174636800000000000000000000604482015260640161017d565b5f83518060208601845e9190910191825250602001919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610323577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f6020828403121561033a575f5ffd5b81518015158114610349575f5ffd5b9392505050565b818382375f910190815291905056", } // BatchInboxABI is the input ABI used to generate the binding from. @@ -44,7 +44,7 @@ var BatchInboxABI = BatchInboxMetaData.ABI var BatchInboxBin = BatchInboxMetaData.Bin // DeployBatchInbox deploys a new Ethereum contract, binding an instance of BatchInbox to it. -func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _batchAuthenticator common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchInbox, error) { +func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _batchAuthenticator common.Address) (common.Address, *types.Transaction, *BatchInbox, error) { parsed, err := BatchInboxMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -53,7 +53,7 @@ func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _ba return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchInboxBin), backend, _batchAuthenticator, _owner) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchInboxBin), backend, _batchAuthenticator) if err != nil { return common.Address{}, nil, nil, err } @@ -202,141 +202,6 @@ func (_BatchInbox *BatchInboxTransactorRaw) Transact(opts *bind.TransactOpts, me return _BatchInbox.Contract.contract.Transact(opts, method, params...) } -// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. -// -// Solidity: function batchAuthenticator() view returns(address) -func (_BatchInbox *BatchInboxCaller) BatchAuthenticator(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _BatchInbox.contract.Call(opts, &out, "batchAuthenticator") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. -// -// Solidity: function batchAuthenticator() view returns(address) -func (_BatchInbox *BatchInboxSession) BatchAuthenticator() (common.Address, error) { - return _BatchInbox.Contract.BatchAuthenticator(&_BatchInbox.CallOpts) -} - -// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. -// -// Solidity: function batchAuthenticator() view returns(address) -func (_BatchInbox *BatchInboxCallerSession) BatchAuthenticator() (common.Address, error) { - return _BatchInbox.Contract.BatchAuthenticator(&_BatchInbox.CallOpts) -} - -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchInbox *BatchInboxCaller) NonTeeBatcher(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _BatchInbox.contract.Call(opts, &out, "nonTeeBatcher") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchInbox *BatchInboxSession) NonTeeBatcher() (common.Address, error) { - return _BatchInbox.Contract.NonTeeBatcher(&_BatchInbox.CallOpts) -} - -// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. -// -// Solidity: function nonTeeBatcher() view returns(address) -func (_BatchInbox *BatchInboxCallerSession) NonTeeBatcher() (common.Address, error) { - return _BatchInbox.Contract.NonTeeBatcher(&_BatchInbox.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_BatchInbox *BatchInboxCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _BatchInbox.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_BatchInbox *BatchInboxSession) Owner() (common.Address, error) { - return _BatchInbox.Contract.Owner(&_BatchInbox.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_BatchInbox *BatchInboxCallerSession) Owner() (common.Address, error) { - return _BatchInbox.Contract.Owner(&_BatchInbox.CallOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_BatchInbox *BatchInboxTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _BatchInbox.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_BatchInbox *BatchInboxSession) RenounceOwnership() (*types.Transaction, error) { - return _BatchInbox.Contract.RenounceOwnership(&_BatchInbox.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_BatchInbox *BatchInboxTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _BatchInbox.Contract.RenounceOwnership(&_BatchInbox.TransactOpts) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_BatchInbox *BatchInboxTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _BatchInbox.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_BatchInbox *BatchInboxSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _BatchInbox.Contract.TransferOwnership(&_BatchInbox.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_BatchInbox *BatchInboxTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _BatchInbox.Contract.TransferOwnership(&_BatchInbox.TransactOpts, newOwner) -} - // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() returns() @@ -357,156 +222,3 @@ func (_BatchInbox *BatchInboxSession) Fallback(calldata []byte) (*types.Transact func (_BatchInbox *BatchInboxTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { return _BatchInbox.Contract.Fallback(&_BatchInbox.TransactOpts, calldata) } - -// BatchInboxOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the BatchInbox contract. -type BatchInboxOwnershipTransferredIterator struct { - Event *BatchInboxOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *BatchInboxOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(BatchInboxOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(BatchInboxOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *BatchInboxOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *BatchInboxOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// BatchInboxOwnershipTransferred represents a OwnershipTransferred event raised by the BatchInbox contract. -type BatchInboxOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_BatchInbox *BatchInboxFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BatchInboxOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _BatchInbox.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &BatchInboxOwnershipTransferredIterator{contract: _BatchInbox.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_BatchInbox *BatchInboxFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BatchInboxOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _BatchInbox.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(BatchInboxOwnershipTransferred) - if err := _BatchInbox.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_BatchInbox *BatchInboxFilterer) ParseOwnershipTransferred(log types.Log) (*BatchInboxOwnershipTransferred, error) { - event := new(BatchInboxOwnershipTransferred) - if err := _BatchInbox.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol index 26170f2a90c..0b28c2d1233 100644 --- a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol +++ b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol @@ -87,17 +87,4 @@ contract BatchAuthenticator is ISemver, Ownable { function registerSigner(bytes calldata attestationTbs, bytes calldata signature) external { espressoTEEVerifier.registerSigner(attestationTbs, signature, IEspressoTEEVerifier.TeeType.NITRO); } - - function registerSignerWithoutAttestationVerification( - bytes32 pcr0Hash, - bytes calldata attestationTbs, - bytes calldata signature, - address enclaveAddress - ) - external - { - espressoTEEVerifier.espressoNitroTEEVerifier().registerSignerWithoutAttestationVerification( - pcr0Hash, attestationTbs, signature, enclaveAddress - ); - } } From be5ebd81492d2a87cb06dbcde04a4436ff367ad9 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 11:04:23 -0800 Subject: [PATCH 02/33] check attestation service url is not nil --- espresso/cli.go | 4 ++++ op-batcher/batcher/driver.go | 2 +- op-batcher/batcher/espresso.go | 9 +++------ op-batcher/batcher/service.go | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/espresso/cli.go b/espresso/cli.go index 1b5cb9e177e..672d17b83c0 100644 --- a/espresso/cli.go +++ b/espresso/cli.go @@ -117,6 +117,7 @@ type CLIConfig struct { TestingBatcherPrivateKey *ecdsa.PrivateKey Namespace uint64 OriginHeight uint64 + AttestationServiceURL string } func (c CLIConfig) Check() error { @@ -137,6 +138,9 @@ func (c CLIConfig) Check() error { if c.Namespace == 0 { return fmt.Errorf("namespace is required when Espresso is enabled") } + if c.AttestationServiceURL == "" { + return fmt.Errorf("attestation service URL is required when Espresso is enabled") + } } return nil } diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index b9bcc443324..3414131bdcd 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -112,7 +112,7 @@ type DriverSetup struct { Attestation *nitrite.Result } -type OnchainProof struct { +type EspressoOnchainProof struct { Zktype string `json:"zktype"` ZkvmVersion string `json:"zkvm_version"` ProgramID struct { diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index a4ab3fd6845..9bf598d4122 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1012,17 +1012,14 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return nil } -func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*OnchainProof, error) { - if l.Config.EspressoAttestationServiceURL == "" { - return nil, fmt.Errorf("espresso attestation service URL is not set") - } +func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*EspressoOnchainProof, error) { request, err := http.NewRequestWithContext(ctx, "POST", l.Config.EspressoAttestationServiceURL+"/generate_proof", bytes.NewBuffer(attestationBytes)) if err != nil { return nil, err } request.Header.Set("Content-Type", "application/octet-stream") client := http.Client{ - Timeout: 30 * time.Second, + Timeout: 2 * time.Minute, } res, err := client.Do(request) if err != nil { @@ -1035,7 +1032,7 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ return nil, err } - var zkProof OnchainProof + var zkProof EspressoOnchainProof err = json.Unmarshal(responseData, &zkProof) if err != nil { return nil, err diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index 32b2da5a8fa..f1c1712ad35 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -565,6 +565,7 @@ func (bs *BatcherService) initEspresso(cfg *CLIConfig) error { bs.UseEspresso = true bs.EspressoPollInterval = cfg.Espresso.PollInterval + bs.EspressoAttestationServiceURL = cfg.Espresso.AttestationServiceURL urlZero := cfg.Espresso.QueryServiceURLs[0] espressoClient := espressoClient.NewClient(urlZero) From b41dae9c92b5bbeb227f40149ccca111ebf3d706 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 11:08:15 -0800 Subject: [PATCH 03/33] upgrade espresso tee verifier contracts --- packages/contracts-bedrock/lib/espresso-tee-contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts-bedrock/lib/espresso-tee-contracts b/packages/contracts-bedrock/lib/espresso-tee-contracts index 02a40281a40..0d73791be5d 160000 --- a/packages/contracts-bedrock/lib/espresso-tee-contracts +++ b/packages/contracts-bedrock/lib/espresso-tee-contracts @@ -1 +1 @@ -Subproject commit 02a40281a402d2684d8a056d1751474db9bd50a4 +Subproject commit 0d73791be5d5fc3549e7771a1aeee9939c56762e From 63ebe1289a94fee12b9a061cc2427cb7361d441f Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 13:01:35 -0800 Subject: [PATCH 04/33] fix contracts --- op-batcher/bindings/batch_authenticator.go | 26 ++----- op-batcher/bindings/batch_inbox.go | 5 ++ packages/contracts-bedrock/foundry.toml | 5 +- .../deploy/DeployAWSNitroVerifier.s.sol | 78 ------------------- .../src/L1/BatchAuthenticator.sol | 2 +- .../contracts-bedrock/src/L1/BatchInbox.sol | 2 +- .../test/L1/BatchAuthenticator.t.sol | 2 +- .../test/L1/BatchInbox.t.sol | 2 +- 8 files changed, 15 insertions(+), 107 deletions(-) delete mode 100644 packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol diff --git a/op-batcher/bindings/batch_authenticator.go b/op-batcher/bindings/batch_authenticator.go index 69c749f6aea..ad1c88b6857 100644 --- a/op-batcher/bindings/batch_authenticator.go +++ b/op-batcher/bindings/batch_authenticator.go @@ -31,8 +31,13 @@ var ( // BatchAuthenticatorMetaData contains all meta data concerning the BatchAuthenticator contract. var BatchAuthenticatorMetaData = &bind.MetaData{ +<<<<<<< Updated upstream ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"},{\"name\":\"_preApprovedBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preApprovedBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerSignerWithoutAttestationVerification\",\"inputs\":[{\"name\":\"pcr0Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"enclaveAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", Bin: "0x60e0806040523461012c57606081611575803803809161001f8285610143565b83398101031261012c5780516001600160a01b0381169182820361012c576004928161005a6040610053602080960161017a565b920161017a565b936100643361018e565b60a052608052604051631b01498560e31b815293849182905afa8015610138575f906100ee575b6001600160a01b031660c0526100a1915061018e565b6040516113a090816101d582396080518181816102de0152610b8f015260a0518181816101950152818161051f015281816107690152610cf8015260c0518181816109000152610bfe0152f35b50906020813d602011610130575b8161010960209383610143565b8101031261012c5751906001600160a01b038216820361012c576100a19161008b565b5f80fd5b3d91506100fc565b6040513d5f823e3d90fd5b601f909101601f19168101906001600160401b0382119082101761016657604052565b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361012c57565b5f80546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816302afd6e314610c22575080631b076a4c14610bb35780631f568b1814610b4457806354fd4d5014610ac5578063715018a614610a295780638da5cb5b146109d8578063a903a27714610847578063ba58e82a146106dd578063f2fde38b14610590578063f81f208314610543578063fa14fe6d146104d45763fc619e41146100a2575f80fd5b346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043560243567ffffffffffffffff81116104cf576100f76100fe913690600401610e1c565b3691610f35565b8051604010156104a25760608101805160f81c80158015610498575b6103db575b505061014b61014373ffffffffffffffffffffffffffffffffffffffff9284611099565b9190916110ce565b16801561037d576040517fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9081156103455773ffffffffffffffffffffffffffffffffffffffff916020918691610350575b506024604051809481937f0123d0c1000000000000000000000000000000000000000000000000000000008352876004840152165afa908115610345578491610306575b501590816102c5575b5061026757815260016020526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905580f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c6964207369676e65720000000000000000000000000000000000006044820152fd5b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614155f61022b565b90506020813d60201161033d575b8161032160209383610e4a565b8101031261033957518015158103610339575f610222565b8380fd5b3d9150610314565b6040513d86823e3d90fd5b6103709150823d8411610376575b6103688183610e4a565b810190610f6b565b5f6101de565b503d61035e565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152fd5b601b0160ff811161046b5782516040101561043e5773ffffffffffffffffffffffffffffffffffffffff9261014b927fff000000000000000000000000000000000000000000000000000000000000006101439360f81b16871a9053925061011f565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b506001811461011a565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b825b80fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760ff60406020926004358152600184522054166040519015158152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043573ffffffffffffffffffffffffffffffffffffffff81168091036106d9576105e961101b565b80156106555773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b5080fd5b50346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1578060043567ffffffffffffffff81116108445761072e903690600401610e1c565b9060243567ffffffffffffffff81116108415761074f903690600401610e1c565b92909173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690813b1561083d57856107d9936108098296604051988997889687957f35ecb4c1000000000000000000000000000000000000000000000000000000008752606060048801526064870191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc858403016024860152610f97565b6001604483015203925af18015610832576108215750f35b8161082b91610e4a565b6104d15780f35b6040513d84823e3d90fd5b8580fd5b50505b50fd5b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043567ffffffffffffffff81116106d95781366023830112156104d1576108ac6108e7923690602481600401359101610f35565b604051809381927fa903a277000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ef2565b038173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9182156109cc5780918193610960575b61094e8361095c86604051938493604085526040850190610ef2565b908382036020850152610ef2565b0390f35b915091503d8083833e6109738183610e4a565b8101916040828403126104d157815167ffffffffffffffff81116106d9578361099d918401610fd5565b9160208101519167ffffffffffffffff83116104d1575061094e9361095c926109c69201610fd5565b92610932565b604051903d90823e3d90fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157610a6061101b565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1575061095c604051610b06604082610e4a565b600581527f312e302e300000000000000000000000000000000000000000000000000000006020820152604051918291602083526020830190610ef2565b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b905034610df95760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610df95760243567ffffffffffffffff8111610df957610c73903690600401610e1c565b909160443567ffffffffffffffff8111610df957610c95903690600401610e1c565b936064359273ffffffffffffffffffffffffffffffffffffffff8416809403610df9577fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa8015610dee5773ffffffffffffffffffffffffffffffffffffffff915f91610dfd575b501691823b15610df9575f94610d9894610dc88793604051998a98899788967f02afd6e30000000000000000000000000000000000000000000000000000000088526004356004890152608060248901526084880191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc868403016044870152610f97565b90606483015203925af18015610dee57610de0575080f35b610dec91505f90610e4a565b005b6040513d5f823e3d90fd5b5f80fd5b610e16915060203d602011610376576103688183610e4a565b5f610d3d565b9181601f84011215610df95782359167ffffffffffffffff8311610df95760208381860195010111610df957565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610e8b57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b67ffffffffffffffff8111610e8b57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b929192610f4182610eb8565b91610f4f6040519384610e4a565b829481845281830111610df9578281602093845f960137010152565b90816020910312610df9575173ffffffffffffffffffffffffffffffffffffffff81168103610df95790565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe093818652868601375f8582860101520116010190565b81601f82011215610df957805190610fec82610eb8565b92610ffa6040519485610e4a565b82845260208383010111610df957815f9260208093018386015e8301015290565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361103b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9060418151145f146110c5576110c191602082015190606060408401519301515f1a906112f1565b9091565b50505f90600290565b60058110156112c457806110df5750565b600181036111455760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036111ab5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600381036112375760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461124057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116113955760ff1690601b8214158061138a575b61137f576020935f93608093604051938452868401526040830152606082015282805260015afa15610dee575f5173ffffffffffffffffffffffffffffffffffffffff81161561137757905f90565b505f90600190565b505050505f90600490565b50601c821415611328565b505050505f9060039056", +======= + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"},{\"name\":\"_teeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonTeeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"activeIsTee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"switchBatcher\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"teeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x610100604052348015610010575f5ffd5b506040516120ac3803806120ac833981810160405281019061003291906103fb565b61004e61004361029a60201b60201c565b6102a160201b60201c565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036100bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100b3906104df565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361012a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101219061056d565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505060c05173ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610211573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061023591906105c6565b73ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff1681525050600160025f6101000a81548160ff021916908315150217905550610291816102a160201b60201c565b505050506105f1565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61038f82610366565b9050919050565b5f6103a082610385565b9050919050565b6103b081610396565b81146103ba575f5ffd5b50565b5f815190506103cb816103a7565b92915050565b6103da81610385565b81146103e4575f5ffd5b50565b5f815190506103f5816103d1565b92915050565b5f5f5f5f6080858703121561041357610412610362565b5b5f610420878288016103bd565b9450506020610431878288016103e7565b9350506040610442878288016103e7565b9250506060610453878288016103e7565b91505092959194509250565b5f82825260208201905092915050565b7f426174636841757468656e74696361746f723a207a65726f20746565206261745f8201527f6368657200000000000000000000000000000000000000000000000000000000602082015250565b5f6104c960248361045f565b91506104d48261046f565b604082019050919050565b5f6020820190508181035f8301526104f6816104bd565b9050919050565b7f426174636841757468656e74696361746f723a207a65726f206e6f6e2d7465655f8201527f2062617463686572000000000000000000000000000000000000000000000000602082015250565b5f61055760288361045f565b9150610562826104fd565b604082019050919050565b5f6020820190508181035f8301526105848161054b565b9050919050565b5f61059582610385565b9050919050565b6105a58161058b565b81146105af575f5ffd5b50565b5f815190506105c08161059c565b92915050565b5f602082840312156105db576105da610362565b5b5f6105e8848285016105b2565b91505092915050565b60805160a05160c05160e051611a6c6106405f395f8181610289015261033501525f81816103fd01528181610587015261070101525f6103d901525f81816104c4015261080d0152611a6c5ff3fe608060405234801561000f575f5ffd5b50600436106100e8575f3560e01c8063ba58e82a1161008a578063f2fde38b11610064578063f2fde38b14610201578063f81f20831461021d578063fa14fe6d1461024d578063fc619e411461026b576100e8565b8063ba58e82a146101bd578063bc347f47146101d9578063d909ba7c146101e3576100e8565b80637877a9ed116100c65780637877a9ed146101325780638da5cb5b14610150578063a903a2771461016e578063b1bd42851461019f576100e8565b80631b076a4c146100ec57806354fd4d501461010a578063715018a614610128575b5f5ffd5b6100f4610287565b6040516101019190610dc9565b60405180910390f35b6101126102ab565b60405161011f9190610e52565b60405180910390f35b6101306102e4565b005b61013a6102f7565b6040516101479190610e8c565b60405180910390f35b610158610309565b6040516101659190610ec5565b60405180910390f35b6101886004803603810190610183919061101b565b610330565b6040516101969291906110b4565b60405180910390f35b6101a76103d7565b6040516101b49190610ec5565b60405180910390f35b6101d760048036038101906101d29190611146565b6103fb565b005b6101e1610490565b005b6101eb6104c2565b6040516101f89190610ec5565b60405180910390f35b61021b600480360381019061021691906111ee565b6104e6565b005b6102376004803603810190610232919061124c565b610568565b6040516102449190610e8c565b60405180910390f35b610255610585565b6040516102629190611297565b60405180910390f35b610285600480360381019061028091906112b0565b6105a9565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b6040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6102ec6108cc565b6102f55f61094a565b565b60025f9054906101000a900460ff1681565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a903a277846040518263ffffffff1660e01b815260040161038c919061130d565b5f60405180830381865afa1580156103a6573d5f5f3e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906103ce919061139b565b91509150915091565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166335ecb4c18585858560016040518663ffffffff1660e01b815260040161045d9594939291906114b0565b5f604051808303815f87803b158015610474575f5ffd5b505af1158015610486573d5f5f3e3d5ffd5b5050505050505050565b6104986108cc565b60025f9054906101000a900460ff161560025f6101000a81548160ff021916908315150217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b6104ee6108cc565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361055c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055390611567565b60405180910390fd5b6105658161094a565b50565b6001602052805f5260405f205f915054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f82828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505090505f8160408151811061060557610604611585565b5b602001015160f81c60f81b60f81c90505f8160ff161480610629575060018160ff16145b1561068457601b8161063b91906115eb565b90508060f81b8260408151811061065557610654611585565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505b5f61068f8684610a0b565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f690611669565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610768573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078c91906116c2565b73ffffffffffffffffffffffffffffffffffffffff16630123d0c1826040518263ffffffff1660e01b81526004016107c49190610ec5565b602060405180830381865afa1580156107df573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108039190611717565b15801561085c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b1561089c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108939061178c565b60405180910390fd5b6001805f8881526020019081526020015f205f6101000a81548160ff021916908315150217905550505050505050565b6108d4610a30565b73ffffffffffffffffffffffffffffffffffffffff166108f2610309565b73ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f906117f4565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f5f610a188585610a37565b91509150610a2581610a83565b819250505092915050565b5f33905090565b5f5f6041835103610a74575f5f5f602086015192506040860151915060608601515f1a9050610a6887828585610c4e565b94509450505050610a7c565b5f6002915091505b9250929050565b5f6004811115610a9657610a9561143d565b5b816004811115610aa957610aa861143d565b5b0315610c4b5760016004811115610ac357610ac261143d565b5b816004811115610ad657610ad561143d565b5b03610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d9061185c565b60405180910390fd5b60026004811115610b2a57610b2961143d565b5b816004811115610b3d57610b3c61143d565b5b03610b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b74906118c4565b60405180910390fd5b60036004811115610b9157610b9061143d565b5b816004811115610ba457610ba361143d565b5b03610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90611952565b60405180910390fd5b600480811115610bf757610bf661143d565b5b816004811115610c0a57610c0961143d565b5b03610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906119e0565b60405180910390fd5b5b50565b5f5f7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610c86575f600391509150610d46565b601b8560ff1614158015610c9e5750601c8560ff1614155b15610caf575f600491509150610d46565b5f6001878787876040515f8152602001604052604051610cd29493929190611a1c565b6020604051602081039080840390855afa158015610cf2573d5f5f3e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d3e575f60019250925050610d46565b805f92509250505b94509492505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610d91610d8c610d8784610d4f565b610d6e565b610d4f565b9050919050565b5f610da282610d77565b9050919050565b5f610db382610d98565b9050919050565b610dc381610da9565b82525050565b5f602082019050610ddc5f830184610dba565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610e2482610de2565b610e2e8185610dec565b9350610e3e818560208601610dfc565b610e4781610e0a565b840191505092915050565b5f6020820190508181035f830152610e6a8184610e1a565b905092915050565b5f8115159050919050565b610e8681610e72565b82525050565b5f602082019050610e9f5f830184610e7d565b92915050565b5f610eaf82610d4f565b9050919050565b610ebf81610ea5565b82525050565b5f602082019050610ed85f830184610eb6565b92915050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f2d82610e0a565b810181811067ffffffffffffffff82111715610f4c57610f4b610ef7565b5b80604052505050565b5f610f5e610ede565b9050610f6a8282610f24565b919050565b5f67ffffffffffffffff821115610f8957610f88610ef7565b5b610f9282610e0a565b9050602081019050919050565b828183375f83830152505050565b5f610fbf610fba84610f6f565b610f55565b905082815260208101848484011115610fdb57610fda610ef3565b5b610fe6848285610f9f565b509392505050565b5f82601f83011261100257611001610eef565b5b8135611012848260208601610fad565b91505092915050565b5f602082840312156110305761102f610ee7565b5b5f82013567ffffffffffffffff81111561104d5761104c610eeb565b5b61105984828501610fee565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f61108682611062565b611090818561106c565b93506110a0818560208601610dfc565b6110a981610e0a565b840191505092915050565b5f6040820190508181035f8301526110cc818561107c565b905081810360208301526110e0818461107c565b90509392505050565b5f5ffd5b5f5ffd5b5f5f83601f84011261110657611105610eef565b5b8235905067ffffffffffffffff811115611123576111226110e9565b5b60208301915083600182028301111561113f5761113e6110ed565b5b9250929050565b5f5f5f5f6040858703121561115e5761115d610ee7565b5b5f85013567ffffffffffffffff81111561117b5761117a610eeb565b5b611187878288016110f1565b9450945050602085013567ffffffffffffffff8111156111aa576111a9610eeb565b5b6111b6878288016110f1565b925092505092959194509250565b6111cd81610ea5565b81146111d7575f5ffd5b50565b5f813590506111e8816111c4565b92915050565b5f6020828403121561120357611202610ee7565b5b5f611210848285016111da565b91505092915050565b5f819050919050565b61122b81611219565b8114611235575f5ffd5b50565b5f8135905061124681611222565b92915050565b5f6020828403121561126157611260610ee7565b5b5f61126e84828501611238565b91505092915050565b5f61128182610d98565b9050919050565b61129181611277565b82525050565b5f6020820190506112aa5f830184611288565b92915050565b5f5f5f604084860312156112c7576112c6610ee7565b5b5f6112d486828701611238565b935050602084013567ffffffffffffffff8111156112f5576112f4610eeb565b5b611301868287016110f1565b92509250509250925092565b5f6020820190508181035f830152611325818461107c565b905092915050565b5f61133f61133a84610f6f565b610f55565b90508281526020810184848401111561135b5761135a610ef3565b5b611366848285610dfc565b509392505050565b5f82601f83011261138257611381610eef565b5b815161139284826020860161132d565b91505092915050565b5f5f604083850312156113b1576113b0610ee7565b5b5f83015167ffffffffffffffff8111156113ce576113cd610eeb565b5b6113da8582860161136e565b925050602083015167ffffffffffffffff8111156113fb576113fa610eeb565b5b6114078582860161136e565b9150509250929050565b5f61141c838561106c565b9350611429838584610f9f565b61143283610e0a565b840190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061147b5761147a61143d565b5b50565b5f81905061148b8261146a565b919050565b5f61149a8261147e565b9050919050565b6114aa81611490565b82525050565b5f6060820190508181035f8301526114c9818789611411565b905081810360208301526114de818587611411565b90506114ed60408301846114a1565b9695505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611551602683610dec565b915061155c826114f7565b604082019050919050565b5f6020820190508181035f83015261157e81611545565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff82169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6115f5826115b2565b9150611600836115b2565b9250828201905060ff811115611619576116186115be565b5b92915050565b7f496e76616c6964207369676e61747572650000000000000000000000000000005f82015250565b5f611653601183610dec565b915061165e8261161f565b602082019050919050565b5f6020820190508181035f83015261168081611647565b9050919050565b5f61169182610ea5565b9050919050565b6116a181611687565b81146116ab575f5ffd5b50565b5f815190506116bc81611698565b92915050565b5f602082840312156116d7576116d6610ee7565b5b5f6116e4848285016116ae565b91505092915050565b6116f681610e72565b8114611700575f5ffd5b50565b5f81519050611711816116ed565b92915050565b5f6020828403121561172c5761172b610ee7565b5b5f61173984828501611703565b91505092915050565b7f496e76616c6964207369676e65720000000000000000000000000000000000005f82015250565b5f611776600e83610dec565b915061178182611742565b602082019050919050565b5f6020820190508181035f8301526117a38161176a565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6117de602083610dec565b91506117e9826117aa565b602082019050919050565b5f6020820190508181035f83015261180b816117d2565b9050919050565b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f611846601883610dec565b915061185182611812565b602082019050919050565b5f6020820190508181035f8301526118738161183a565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f6118ae601f83610dec565b91506118b98261187a565b602082019050919050565b5f6020820190508181035f8301526118db816118a2565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f61193c602283610dec565b9150611947826118e2565b604082019050919050565b5f6020820190508181035f83015261196981611930565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6119ca602283610dec565b91506119d582611970565b604082019050919050565b5f6020820190508181035f8301526119f7816119be565b9050919050565b611a0781611219565b82525050565b611a16816115b2565b82525050565b5f608082019050611a2f5f8301876119fe565b611a3c6020830186611a0d565b611a4960408301856119fe565b611a5660608301846119fe565b9594505050505056fea164736f6c634300081e000a", +>>>>>>> Stashed changes } // BatchAuthenticatorABI is the input ABI used to generate the binding from. @@ -462,27 +467,6 @@ func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) RegisterSigner(a return _BatchAuthenticator.Contract.RegisterSigner(&_BatchAuthenticator.TransactOpts, attestationTbs, signature) } -// RegisterSignerWithoutAttestationVerification is a paid mutator transaction binding the contract method 0x02afd6e3. -// -// Solidity: function registerSignerWithoutAttestationVerification(bytes32 pcr0Hash, bytes attestationTbs, bytes signature, address enclaveAddress) returns() -func (_BatchAuthenticator *BatchAuthenticatorTransactor) RegisterSignerWithoutAttestationVerification(opts *bind.TransactOpts, pcr0Hash [32]byte, attestationTbs []byte, signature []byte, enclaveAddress common.Address) (*types.Transaction, error) { - return _BatchAuthenticator.contract.Transact(opts, "registerSignerWithoutAttestationVerification", pcr0Hash, attestationTbs, signature, enclaveAddress) -} - -// RegisterSignerWithoutAttestationVerification is a paid mutator transaction binding the contract method 0x02afd6e3. -// -// Solidity: function registerSignerWithoutAttestationVerification(bytes32 pcr0Hash, bytes attestationTbs, bytes signature, address enclaveAddress) returns() -func (_BatchAuthenticator *BatchAuthenticatorSession) RegisterSignerWithoutAttestationVerification(pcr0Hash [32]byte, attestationTbs []byte, signature []byte, enclaveAddress common.Address) (*types.Transaction, error) { - return _BatchAuthenticator.Contract.RegisterSignerWithoutAttestationVerification(&_BatchAuthenticator.TransactOpts, pcr0Hash, attestationTbs, signature, enclaveAddress) -} - -// RegisterSignerWithoutAttestationVerification is a paid mutator transaction binding the contract method 0x02afd6e3. -// -// Solidity: function registerSignerWithoutAttestationVerification(bytes32 pcr0Hash, bytes attestationTbs, bytes signature, address enclaveAddress) returns() -func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) RegisterSignerWithoutAttestationVerification(pcr0Hash [32]byte, attestationTbs []byte, signature []byte, enclaveAddress common.Address) (*types.Transaction, error) { - return _BatchAuthenticator.Contract.RegisterSignerWithoutAttestationVerification(&_BatchAuthenticator.TransactOpts, pcr0Hash, attestationTbs, signature, enclaveAddress) -} - // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() diff --git a/op-batcher/bindings/batch_inbox.go b/op-batcher/bindings/batch_inbox.go index 1848251c715..a9a69cf04f5 100644 --- a/op-batcher/bindings/batch_inbox.go +++ b/op-batcher/bindings/batch_inbox.go @@ -31,8 +31,13 @@ var ( // BatchInboxMetaData contains all meta data concerning the BatchInbox contract. var BatchInboxMetaData = &bind.MetaData{ +<<<<<<< Updated upstream ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"}]", Bin: "0x60a0604052348015600e575f5ffd5b506040516103e33803806103e3833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f5ffd5b81516001600160a01b0381168114605f575f5ffd5b9392505050565b60805161035f6100845f395f8181609d01526101d0015261035f5ff3fe608060405234801561000f575f5ffd5b505f491561018857604080515f80825260208201909252905b804915610067578181496040516020016100439291906102b4565b6040516020818303038152906040529150808061005f906102ce565b915050610028565b815160208301206040517ff81f2083000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa1580156100f7573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061011b919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420626c6f62206261746368000000000000000000000000000060448201526064015b60405180910390fd5b005b5f5f36604051610199929190610350565b6040519081900381207ff81f20830000000000000000000000000000000000000000000000000000000082526004820181905291507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa15801561022a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061024e919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c69642063616c6c6461746120626174636800000000000000000000604482015260640161017d565b5f83518060208601845e9190910191825250602001919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610323577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f6020828403121561033a575f5ffd5b81518015158114610349575f5ffd5b9392505050565b818382375f910190815291905056", +======= + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"batchAuthenticator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60c060405234801561000f575f5ffd5b50604051610f9b380380610f9b8339818101604052810190610031919061029d565b61004d61004261013c60201b60201c565b61014360201b60201c565b5f8273ffffffffffffffffffffffffffffffffffffffff1663b1bd42856040518163ffffffff1660e01b8152600401602060405180830381865afa158015610097573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100bb91906102db565b90508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250506101348261014360201b60201c565b505050610306565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61023182610208565b9050919050565b5f61024282610227565b9050919050565b61025281610238565b811461025c575f5ffd5b50565b5f8151905061026d81610249565b92915050565b61027c81610227565b8114610286575f5ffd5b50565b5f8151905061029781610273565b92915050565b5f5f604083850312156102b3576102b2610204565b5b5f6102c08582860161025f565b92505060206102d185828601610289565b9150509250929050565b5f602082840312156102f0576102ef610204565b5b5f6102fd84828501610289565b91505092915050565b60805160a051610c596103425f395f8181605c0152818161019a0152818161029401526104e101525f818161037201526104bd0152610c595ff3fe608060405234801561000f575f5ffd5b5060043610610059575f3560e01c8063715018a6146104015780638da5cb5b1461040b578063b1bd428514610429578063e758457314610447578063f2fde38b146104655761005a565b5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637877a9ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e79190610704565b15610370575f5f1b5f4914610277575f5f67ffffffffffffffff8111156101115761011061072f565b5b6040519080825280601f01601f1916602001820160405280156101435781602001600182028036833780820191505090505b5090505f5f90505b5f5f1b81491461018d578181496040516020016101699291906107d7565b6040516020818303038152906040529150808061018590610834565b91505061014b565b5f828051906020012090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016101f1919061088a565b602060405180830381865afa15801561020c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102309190610704565b61026f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610266906108fd565b60405180910390fd5b50505061036b565b5f5f3660405161028892919061094d565b604051809103902090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016102eb919061088a565b602060405180830381865afa158015610306573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061032a9190610704565b610369576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906109af565b60405180910390fd5b505b6103ff565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f590610a17565b60405180910390fd5b5b005b610409610481565b005b610413610494565b6040516104209190610a74565b60405180910390f35b6104316104bb565b60405161043e9190610a74565b60405180910390f35b61044f6104df565b60405161045c9190610ae8565b60405180910390f35b61047f600480360381019061047a9190610b2b565b610503565b005b610489610585565b6104925f610603565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61050b610585565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090610bc6565b60405180910390fd5b61058281610603565b50565b61058d6106c4565b73ffffffffffffffffffffffffffffffffffffffff166105ab610494565b73ffffffffffffffffffffffffffffffffffffffff1614610601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f890610c2e565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f5ffd5b5f8115159050919050565b6106e3816106cf565b81146106ed575f5ffd5b50565b5f815190506106fe816106da565b92915050565b5f60208284031215610719576107186106cb565b5b5f610726848285016106f0565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6107888261075c565b6107928185610766565b93506107a2818560208601610770565b80840191505092915050565b5f819050919050565b5f819050919050565b6107d16107cc826107ae565b6107b7565b82525050565b5f6107e2828561077e565b91506107ee82846107c0565b6020820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f819050919050565b5f61083e8261082b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108705761086f6107fe565b5b600182019050919050565b610884816107ae565b82525050565b5f60208201905061089d5f83018461087b565b92915050565b5f82825260208201905092915050565b7f496e76616c696420626c6f6220626174636800000000000000000000000000005f82015250565b5f6108e76012836108a3565b91506108f2826108b3565b602082019050919050565b5f6020820190508181035f830152610914816108db565b9050919050565b828183375f83830152505050565b5f6109348385610766565b935061094183858461091b565b82840190509392505050565b5f610959828486610929565b91508190509392505050565b7f496e76616c69642063616c6c64617461206261746368000000000000000000005f82015250565b5f6109996016836108a3565b91506109a482610965565b602082019050919050565b5f6020820190508181035f8301526109c68161098d565b9050919050565b7f4261746368496e626f783a20756e617574686f72697a656420626174636865725f82015250565b5f610a016020836108a3565b9150610a0c826109cd565b602082019050919050565b5f6020820190508181035f830152610a2e816109f5565b9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a5e82610a35565b9050919050565b610a6e81610a54565b82525050565b5f602082019050610a875f830184610a65565b92915050565b5f819050919050565b5f610ab0610aab610aa684610a35565b610a8d565b610a35565b9050919050565b5f610ac182610a96565b9050919050565b5f610ad282610ab7565b9050919050565b610ae281610ac8565b82525050565b5f602082019050610afb5f830184610ad9565b92915050565b610b0a81610a54565b8114610b14575f5ffd5b50565b5f81359050610b2581610b01565b92915050565b5f60208284031215610b4057610b3f6106cb565b5b5f610b4d84828501610b17565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f610bb06026836108a3565b9150610bbb82610b56565b604082019050919050565b5f6020820190508181035f830152610bdd81610ba4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f610c186020836108a3565b9150610c2382610be4565b602082019050919050565b5f6020820190508181035f830152610c4581610c0c565b905091905056fea164736f6c634300081e000a", +>>>>>>> Stashed changes } // BatchInboxABI is the input ABI used to generate the binding from. diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index c18a1f40ba7..f70f5566783 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -27,8 +27,6 @@ compilation_restrictions = [ { paths = "src/L1/OPContractsManagerStandardValidator.sol", optimizer_runs = 5000 }, { paths = "src/L1/StandardValidator.sol", optimizer_runs = 5000 }, { paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 }, - { paths = "lib/espresso-tee-contracts/lib/nitro-validator/**", via_ir = false }, - { paths = "lib/espresso-tee-contracts/lib/automata-dcap-attestation/**", via_ir = true }, ] extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout'] @@ -40,6 +38,7 @@ remappings = [ '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', '@espresso-tee-contracts/=lib/espresso-tee-contracts/src', '@nitro-validator/=lib/espresso-tee-contracts/lib/nitro-validator/src', + 'aws-nitro-enclave-attestation/=lib/espresso-tee-contracts/lib/aws-nitro-enclave-attestation/contracts/src', 'lib/espresso-tee-contracts/:@openzeppelin/contracts/=lib/espresso-tee-contracts/lib/openzeppelin-contracts/contracts', 'lib/espresso-tee-contracts/:solady/=lib/solady/src', '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts', @@ -151,8 +150,6 @@ compilation_restrictions = [ { paths = "src/L1/OPContractsManagerStandardValidator.sol", optimizer_runs = 5000 }, { paths = "src/L1/OptimismPortal2.sol", optimizer_runs = 5000 }, { paths = "src/L1/StandardValidator.sol", optimizer_runs = 5000 }, - { paths = "lib/espresso-tee-contracts/lib/nitro-validator/**", via_ir = false }, - { paths = "lib/espresso-tee-contracts/lib/automata-dcap-attestation/**", via_ir = true }, ] diff --git a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol deleted file mode 100644 index 619a35d10e1..00000000000 --- a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol +++ /dev/null @@ -1,78 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.22; - -import { CertManager } from "@nitro-validator/CertManager.sol"; -import { IEspressoNitroTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; -import { EspressoNitroTEEVerifier } from "@espresso-tee-contracts/EspressoNitroTEEVerifier.sol"; -import { BaseDeployIO } from "scripts/deploy/BaseDeployIO.sol"; -import { Script } from "forge-std/Script.sol"; -import { Solarray } from "scripts/libraries/Solarray.sol"; -import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; - -contract DeployAWSNitroVerifierInput is BaseDeployIO { - bytes32 internal _enclaveHash; - - function set(bytes4 _sel, bytes32 _val) public { - if (_sel == this.enclaveHash.selector) _enclaveHash = _val; - else revert("DeployAWSNitroVerifierInput: unknown selector"); - } - - function enclaveHash() public view returns (bytes32) { - require(_enclaveHash != 0, "DeployAWSNitroVerifierInput: enclaveHash not set"); - return _enclaveHash; - } -} - -contract DeployAWSNitroVerifierOutput is BaseDeployIO { - address internal _nitroTEEVerifierAddress; - - function set(bytes4 _sel, address _addr) public { - require(_addr != address(0), "DeployAWSNitroVerifierOutput: cannot set zero address"); - if (_sel == this.nitroTEEVerifierAddress.selector) { - _nitroTEEVerifierAddress = _addr; - } else { - revert("DeployAWSNitroVerifierOutput: unknown selector"); - } - } - - function nitroTEEVerifierAddress() public view returns (address) { - require(_nitroTEEVerifierAddress != address(0), "nitro TEE verifier address not set"); - return _nitroTEEVerifierAddress; - } -} - -contract DeployAWSNitroVerifier is Script { - function run(DeployAWSNitroVerifierInput input, DeployAWSNitroVerifierOutput output) public { - CertManager manager = deployCertManager(); - deployNitroTEEVerifier(input, output, manager); - checkOutput(output); - } - - function deployNitroTEEVerifier( - DeployAWSNitroVerifierInput input, - DeployAWSNitroVerifierOutput output, - CertManager certManager - ) - public - returns (IEspressoNitroTEEVerifier) - { - bytes32 enclaveHash = input.enclaveHash(); - vm.broadcast(msg.sender); - IEspressoNitroTEEVerifier impl = new EspressoNitroTEEVerifier(enclaveHash, certManager); - vm.label(address(impl), "NitroTEEVerifierImpl"); - output.set(output.nitroTEEVerifierAddress.selector, address(impl)); - return impl; - } - - function deployCertManager() public returns (CertManager) { - vm.broadcast(msg.sender); - CertManager impl = new CertManager(); - vm.label(address(impl), "CertManagerImpl"); - return impl; - } - - function checkOutput(DeployAWSNitroVerifierOutput output) public view { - address[] memory addresses = Solarray.addresses(address(output.nitroTEEVerifierAddress())); - DeployUtils.assertValidContractAddresses(addresses); - } -} diff --git a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol index 0b28c2d1233..9aebb6ad1f6 100644 --- a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol +++ b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.28; +pragma solidity ^0.8.0; import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/contracts-bedrock/src/L1/BatchInbox.sol b/packages/contracts-bedrock/src/L1/BatchInbox.sol index 8c29b66cdaa..d5b7e30f660 100644 --- a/packages/contracts-bedrock/src/L1/BatchInbox.sol +++ b/packages/contracts-bedrock/src/L1/BatchInbox.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.28; +pragma solidity ^0.8.0; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IBatchAuthenticator } from "interfaces/L1/IBatchAuthenticator.sol"; diff --git a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol index 16a26434830..2e136ff1b0a 100644 --- a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol +++ b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.28; +pragma solidity ^0.8.0; // Testing import { Test } from "forge-std/Test.sol"; diff --git a/packages/contracts-bedrock/test/L1/BatchInbox.t.sol b/packages/contracts-bedrock/test/L1/BatchInbox.t.sol index 61b9d559dc2..ad4941145a9 100644 --- a/packages/contracts-bedrock/test/L1/BatchInbox.t.sol +++ b/packages/contracts-bedrock/test/L1/BatchInbox.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.28; +pragma solidity ^0.8.0; // Testing import { Test } from "forge-std/Test.sol"; From a9ed48c35d41b4ea141a898f6b05a541c80af130 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 13:03:38 -0800 Subject: [PATCH 05/33] fix merge --- op-batcher/batcher/espresso.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index c26180b634f..9bf598d4122 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -17,11 +17,6 @@ import ( espressoClient "github.com/EspressoSystems/espresso-network/sdks/go/client" tagged_base64 "github.com/EspressoSystems/espresso-network/sdks/go/tagged-base64" espressoCommon "github.com/EspressoSystems/espresso-network/sdks/go/types" -<<<<<<< HEAD -======= - - "github.com/ethereum/go-ethereum/common" ->>>>>>> fc3e44cea150203d58649b171c22961f9b5684db "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" From af14e95a784052788eb2a16e599114074ec27631 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 13:26:46 -0800 Subject: [PATCH 06/33] fix tests --- espresso/docker-compose.yml | 16 + op-batcher/bindings/batch_authenticator.go | 116 +++++-- op-batcher/bindings/batch_inbox.go | 297 +++++++++++++++++- .../test/L1/BatchAuthenticator.t.sol | 19 -- 4 files changed, 403 insertions(+), 45 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 0a366e8d370..168883717e5 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -359,6 +359,7 @@ services: condition: service_healthy l2-genesis: condition: service_completed_successfully + environment: L1_RPC: http://l1-geth:${L1_HTTP_PORT} OP_BATCHER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT} @@ -374,6 +375,7 @@ services: - --espresso.enabled=true - --espresso.fetch-api=true - --espresso.poll-interval=1s + - --espresso.espresso-attestation-service=http://attestation-service-zk:8080 - --espresso.light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797 - --espresso.testing-batcher-private-key=${OP_TESTING_BATCHER_PRIVATE_KEY:-$OPERATOR_PRIVATE_KEY} - --private-key=${OP_BATCHER_PRIVATE_KEY:-$OPERATOR_PRIVATE_KEY} @@ -627,6 +629,20 @@ services: start_period: 240s restart: unless-stopped + attestation-service-zk: + image: ghcr.io/espressosystems/attestation-verifier-zk:sha-146d85a + platform: linux/amd64 + environment: + # This is a demo private key for tests, it doesnt contain any funds + NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" + NETWORK_RPC_URL: "https://rpc.mainnet.succinct.xyz" + SP1_PROVER: "mock" + RPC_URL: "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" + NITRO_VERIFIER_ADDRESS: "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" + USE_DOCKER: "1" + SKIP_TIME_VALIDITY_CHECK: "true" + RUST_LOG: "info" + espresso-dev-node: image: ${ESPRESSO_DEV_NODE_IMAGE} depends_on: diff --git a/op-batcher/bindings/batch_authenticator.go b/op-batcher/bindings/batch_authenticator.go index ad1c88b6857..27dc380cd36 100644 --- a/op-batcher/bindings/batch_authenticator.go +++ b/op-batcher/bindings/batch_authenticator.go @@ -31,13 +31,8 @@ var ( // BatchAuthenticatorMetaData contains all meta data concerning the BatchAuthenticator contract. var BatchAuthenticatorMetaData = &bind.MetaData{ -<<<<<<< Updated upstream - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"},{\"name\":\"_preApprovedBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"preApprovedBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registerSignerWithoutAttestationVerification\",\"inputs\":[{\"name\":\"pcr0Hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"enclaveAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", - Bin: "0x60e0806040523461012c57606081611575803803809161001f8285610143565b83398101031261012c5780516001600160a01b0381169182820361012c576004928161005a6040610053602080960161017a565b920161017a565b936100643361018e565b60a052608052604051631b01498560e31b815293849182905afa8015610138575f906100ee575b6001600160a01b031660c0526100a1915061018e565b6040516113a090816101d582396080518181816102de0152610b8f015260a0518181816101950152818161051f015281816107690152610cf8015260c0518181816109000152610bfe0152f35b50906020813d602011610130575b8161010960209383610143565b8101031261012c5751906001600160a01b038216820361012c576100a19161008b565b5f80fd5b3d91506100fc565b6040513d5f823e3d90fd5b601f909101601f19168101906001600160401b0382119082101761016657604052565b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820361012c57565b5f80546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6080806040526004361015610012575f80fd5b5f905f3560e01c90816302afd6e314610c22575080631b076a4c14610bb35780631f568b1814610b4457806354fd4d5014610ac5578063715018a614610a295780638da5cb5b146109d8578063a903a27714610847578063ba58e82a146106dd578063f2fde38b14610590578063f81f208314610543578063fa14fe6d146104d45763fc619e41146100a2575f80fd5b346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043560243567ffffffffffffffff81116104cf576100f76100fe913690600401610e1c565b3691610f35565b8051604010156104a25760608101805160f81c80158015610498575b6103db575b505061014b61014373ffffffffffffffffffffffffffffffffffffffff9284611099565b9190916110ce565b16801561037d576040517fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9081156103455773ffffffffffffffffffffffffffffffffffffffff916020918691610350575b506024604051809481937f0123d0c1000000000000000000000000000000000000000000000000000000008352876004840152165afa908115610345578491610306575b501590816102c5575b5061026757815260016020526040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905580f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f496e76616c6964207369676e65720000000000000000000000000000000000006044820152fd5b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614155f61022b565b90506020813d60201161033d575b8161032160209383610e4a565b8101031261033957518015158103610339575f610222565b8380fd5b3d9150610314565b6040513d86823e3d90fd5b6103709150823d8411610376575b6103688183610e4a565b810190610f6b565b5f6101de565b503d61035e565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152fd5b601b0160ff811161046b5782516040101561043e5773ffffffffffffffffffffffffffffffffffffffff9261014b927fff000000000000000000000000000000000000000000000000000000000000006101439360f81b16871a9053925061011f565b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b6024857f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b506001811461011a565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b825b80fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760ff60406020926004358152600184522054166040519015158152f35b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043573ffffffffffffffffffffffffffffffffffffffff81168091036106d9576105e961101b565b80156106555773ffffffffffffffffffffffffffffffffffffffff8254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b5080fd5b50346104d15760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1578060043567ffffffffffffffff81116108445761072e903690600401610e1c565b9060243567ffffffffffffffff81116108415761074f903690600401610e1c565b92909173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690813b1561083d57856107d9936108098296604051988997889687957f35ecb4c1000000000000000000000000000000000000000000000000000000008752606060048801526064870191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc858403016024860152610f97565b6001604483015203925af18015610832576108215750f35b8161082b91610e4a565b6104d15780f35b6040513d84823e3d90fd5b8580fd5b50505b50fd5b50346104d15760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15760043567ffffffffffffffff81116106d95781366023830112156104d1576108ac6108e7923690602481600401359101610f35565b604051809381927fa903a277000000000000000000000000000000000000000000000000000000008352602060048401526024830190610ef2565b038173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa9182156109cc5780918193610960575b61094e8361095c86604051938493604085526040850190610ef2565b908382036020850152610ef2565b0390f35b915091503d8083833e6109738183610e4a565b8101916040828403126104d157815167ffffffffffffffff81116106d9578361099d918401610fd5565b9160208101519167ffffffffffffffff83116104d1575061094e9361095c926109c69201610fd5565b92610932565b604051903d90823e3d90fd5b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d15773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157610a6061101b565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d1575061095c604051610b06604082610e4a565b600581527f312e302e300000000000000000000000000000000000000000000000000000006020820152604051918291602083526020830190610ef2565b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b50346104d157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104d157602060405173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b905034610df95760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610df95760243567ffffffffffffffff8111610df957610c73903690600401610e1c565b909160443567ffffffffffffffff8111610df957610c95903690600401610e1c565b936064359273ffffffffffffffffffffffffffffffffffffffff8416809403610df9577fd80a4c2800000000000000000000000000000000000000000000000000000000815260208160048173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000165afa8015610dee5773ffffffffffffffffffffffffffffffffffffffff915f91610dfd575b501691823b15610df9575f94610d9894610dc88793604051998a98899788967f02afd6e30000000000000000000000000000000000000000000000000000000088526004356004890152608060248901526084880191610f97565b917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc868403016044870152610f97565b90606483015203925af18015610dee57610de0575080f35b610dec91505f90610e4a565b005b6040513d5f823e3d90fd5b5f80fd5b610e16915060203d602011610376576103688183610e4a565b5f610d3d565b9181601f84011215610df95782359167ffffffffffffffff8311610df95760208381860195010111610df957565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610e8b57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b67ffffffffffffffff8111610e8b57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602080948051918291828752018686015e5f8582860101520116010190565b929192610f4182610eb8565b91610f4f6040519384610e4a565b829481845281830111610df9578281602093845f960137010152565b90816020910312610df9575173ffffffffffffffffffffffffffffffffffffffff81168103610df95790565b601f82602094937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe093818652868601375f8582860101520116010190565b81601f82011215610df957805190610fec82610eb8565b92610ffa6040519485610e4a565b82845260208383010111610df957815f9260208093018386015e8301015290565b73ffffffffffffffffffffffffffffffffffffffff5f5416330361103b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9060418151145f146110c5576110c191602082015190606060408401519301515f1a906112f1565b9091565b50505f90600290565b60058110156112c457806110df5750565b600181036111455760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152fd5b600281036111ab5760646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152fd5b600381036112375760846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b60041461124057565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084116113955760ff1690601b8214158061138a575b61137f576020935f93608093604051938452868401526040830152606082015282805260015afa15610dee575f5173ffffffffffffffffffffffffffffffffffffffff81161561137757905f90565b505f90600190565b505050505f90600490565b50601c821415611328565b505050505f9060039056", -======= ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"},{\"name\":\"_teeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonTeeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"activeIsTee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"switchBatcher\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"teeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", Bin: "0x610100604052348015610010575f5ffd5b506040516120ac3803806120ac833981810160405281019061003291906103fb565b61004e61004361029a60201b60201c565b6102a160201b60201c565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036100bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100b3906104df565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361012a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101219061056d565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505060c05173ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610211573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061023591906105c6565b73ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff1681525050600160025f6101000a81548160ff021916908315150217905550610291816102a160201b60201c565b505050506105f1565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61038f82610366565b9050919050565b5f6103a082610385565b9050919050565b6103b081610396565b81146103ba575f5ffd5b50565b5f815190506103cb816103a7565b92915050565b6103da81610385565b81146103e4575f5ffd5b50565b5f815190506103f5816103d1565b92915050565b5f5f5f5f6080858703121561041357610412610362565b5b5f610420878288016103bd565b9450506020610431878288016103e7565b9350506040610442878288016103e7565b9250506060610453878288016103e7565b91505092959194509250565b5f82825260208201905092915050565b7f426174636841757468656e74696361746f723a207a65726f20746565206261745f8201527f6368657200000000000000000000000000000000000000000000000000000000602082015250565b5f6104c960248361045f565b91506104d48261046f565b604082019050919050565b5f6020820190508181035f8301526104f6816104bd565b9050919050565b7f426174636841757468656e74696361746f723a207a65726f206e6f6e2d7465655f8201527f2062617463686572000000000000000000000000000000000000000000000000602082015250565b5f61055760288361045f565b9150610562826104fd565b604082019050919050565b5f6020820190508181035f8301526105848161054b565b9050919050565b5f61059582610385565b9050919050565b6105a58161058b565b81146105af575f5ffd5b50565b5f815190506105c08161059c565b92915050565b5f602082840312156105db576105da610362565b5b5f6105e8848285016105b2565b91505092915050565b60805160a05160c05160e051611a6c6106405f395f8181610289015261033501525f81816103fd01528181610587015261070101525f6103d901525f81816104c4015261080d0152611a6c5ff3fe608060405234801561000f575f5ffd5b50600436106100e8575f3560e01c8063ba58e82a1161008a578063f2fde38b11610064578063f2fde38b14610201578063f81f20831461021d578063fa14fe6d1461024d578063fc619e411461026b576100e8565b8063ba58e82a146101bd578063bc347f47146101d9578063d909ba7c146101e3576100e8565b80637877a9ed116100c65780637877a9ed146101325780638da5cb5b14610150578063a903a2771461016e578063b1bd42851461019f576100e8565b80631b076a4c146100ec57806354fd4d501461010a578063715018a614610128575b5f5ffd5b6100f4610287565b6040516101019190610dc9565b60405180910390f35b6101126102ab565b60405161011f9190610e52565b60405180910390f35b6101306102e4565b005b61013a6102f7565b6040516101479190610e8c565b60405180910390f35b610158610309565b6040516101659190610ec5565b60405180910390f35b6101886004803603810190610183919061101b565b610330565b6040516101969291906110b4565b60405180910390f35b6101a76103d7565b6040516101b49190610ec5565b60405180910390f35b6101d760048036038101906101d29190611146565b6103fb565b005b6101e1610490565b005b6101eb6104c2565b6040516101f89190610ec5565b60405180910390f35b61021b600480360381019061021691906111ee565b6104e6565b005b6102376004803603810190610232919061124c565b610568565b6040516102449190610e8c565b60405180910390f35b610255610585565b6040516102629190611297565b60405180910390f35b610285600480360381019061028091906112b0565b6105a9565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b6040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6102ec6108cc565b6102f55f61094a565b565b60025f9054906101000a900460ff1681565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a903a277846040518263ffffffff1660e01b815260040161038c919061130d565b5f60405180830381865afa1580156103a6573d5f5f3e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906103ce919061139b565b91509150915091565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166335ecb4c18585858560016040518663ffffffff1660e01b815260040161045d9594939291906114b0565b5f604051808303815f87803b158015610474575f5ffd5b505af1158015610486573d5f5f3e3d5ffd5b5050505050505050565b6104986108cc565b60025f9054906101000a900460ff161560025f6101000a81548160ff021916908315150217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b6104ee6108cc565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361055c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055390611567565b60405180910390fd5b6105658161094a565b50565b6001602052805f5260405f205f915054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f82828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505090505f8160408151811061060557610604611585565b5b602001015160f81c60f81b60f81c90505f8160ff161480610629575060018160ff16145b1561068457601b8161063b91906115eb565b90508060f81b8260408151811061065557610654611585565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505b5f61068f8684610a0b565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f690611669565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610768573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078c91906116c2565b73ffffffffffffffffffffffffffffffffffffffff16630123d0c1826040518263ffffffff1660e01b81526004016107c49190610ec5565b602060405180830381865afa1580156107df573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108039190611717565b15801561085c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b1561089c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108939061178c565b60405180910390fd5b6001805f8881526020019081526020015f205f6101000a81548160ff021916908315150217905550505050505050565b6108d4610a30565b73ffffffffffffffffffffffffffffffffffffffff166108f2610309565b73ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f906117f4565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f5f610a188585610a37565b91509150610a2581610a83565b819250505092915050565b5f33905090565b5f5f6041835103610a74575f5f5f602086015192506040860151915060608601515f1a9050610a6887828585610c4e565b94509450505050610a7c565b5f6002915091505b9250929050565b5f6004811115610a9657610a9561143d565b5b816004811115610aa957610aa861143d565b5b0315610c4b5760016004811115610ac357610ac261143d565b5b816004811115610ad657610ad561143d565b5b03610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d9061185c565b60405180910390fd5b60026004811115610b2a57610b2961143d565b5b816004811115610b3d57610b3c61143d565b5b03610b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b74906118c4565b60405180910390fd5b60036004811115610b9157610b9061143d565b5b816004811115610ba457610ba361143d565b5b03610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90611952565b60405180910390fd5b600480811115610bf757610bf661143d565b5b816004811115610c0a57610c0961143d565b5b03610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906119e0565b60405180910390fd5b5b50565b5f5f7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610c86575f600391509150610d46565b601b8560ff1614158015610c9e5750601c8560ff1614155b15610caf575f600491509150610d46565b5f6001878787876040515f8152602001604052604051610cd29493929190611a1c565b6020604051602081039080840390855afa158015610cf2573d5f5f3e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d3e575f60019250925050610d46565b805f92509250505b94509492505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610d91610d8c610d8784610d4f565b610d6e565b610d4f565b9050919050565b5f610da282610d77565b9050919050565b5f610db382610d98565b9050919050565b610dc381610da9565b82525050565b5f602082019050610ddc5f830184610dba565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610e2482610de2565b610e2e8185610dec565b9350610e3e818560208601610dfc565b610e4781610e0a565b840191505092915050565b5f6020820190508181035f830152610e6a8184610e1a565b905092915050565b5f8115159050919050565b610e8681610e72565b82525050565b5f602082019050610e9f5f830184610e7d565b92915050565b5f610eaf82610d4f565b9050919050565b610ebf81610ea5565b82525050565b5f602082019050610ed85f830184610eb6565b92915050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f2d82610e0a565b810181811067ffffffffffffffff82111715610f4c57610f4b610ef7565b5b80604052505050565b5f610f5e610ede565b9050610f6a8282610f24565b919050565b5f67ffffffffffffffff821115610f8957610f88610ef7565b5b610f9282610e0a565b9050602081019050919050565b828183375f83830152505050565b5f610fbf610fba84610f6f565b610f55565b905082815260208101848484011115610fdb57610fda610ef3565b5b610fe6848285610f9f565b509392505050565b5f82601f83011261100257611001610eef565b5b8135611012848260208601610fad565b91505092915050565b5f602082840312156110305761102f610ee7565b5b5f82013567ffffffffffffffff81111561104d5761104c610eeb565b5b61105984828501610fee565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f61108682611062565b611090818561106c565b93506110a0818560208601610dfc565b6110a981610e0a565b840191505092915050565b5f6040820190508181035f8301526110cc818561107c565b905081810360208301526110e0818461107c565b90509392505050565b5f5ffd5b5f5ffd5b5f5f83601f84011261110657611105610eef565b5b8235905067ffffffffffffffff811115611123576111226110e9565b5b60208301915083600182028301111561113f5761113e6110ed565b5b9250929050565b5f5f5f5f6040858703121561115e5761115d610ee7565b5b5f85013567ffffffffffffffff81111561117b5761117a610eeb565b5b611187878288016110f1565b9450945050602085013567ffffffffffffffff8111156111aa576111a9610eeb565b5b6111b6878288016110f1565b925092505092959194509250565b6111cd81610ea5565b81146111d7575f5ffd5b50565b5f813590506111e8816111c4565b92915050565b5f6020828403121561120357611202610ee7565b5b5f611210848285016111da565b91505092915050565b5f819050919050565b61122b81611219565b8114611235575f5ffd5b50565b5f8135905061124681611222565b92915050565b5f6020828403121561126157611260610ee7565b5b5f61126e84828501611238565b91505092915050565b5f61128182610d98565b9050919050565b61129181611277565b82525050565b5f6020820190506112aa5f830184611288565b92915050565b5f5f5f604084860312156112c7576112c6610ee7565b5b5f6112d486828701611238565b935050602084013567ffffffffffffffff8111156112f5576112f4610eeb565b5b611301868287016110f1565b92509250509250925092565b5f6020820190508181035f830152611325818461107c565b905092915050565b5f61133f61133a84610f6f565b610f55565b90508281526020810184848401111561135b5761135a610ef3565b5b611366848285610dfc565b509392505050565b5f82601f83011261138257611381610eef565b5b815161139284826020860161132d565b91505092915050565b5f5f604083850312156113b1576113b0610ee7565b5b5f83015167ffffffffffffffff8111156113ce576113cd610eeb565b5b6113da8582860161136e565b925050602083015167ffffffffffffffff8111156113fb576113fa610eeb565b5b6114078582860161136e565b9150509250929050565b5f61141c838561106c565b9350611429838584610f9f565b61143283610e0a565b840190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061147b5761147a61143d565b5b50565b5f81905061148b8261146a565b919050565b5f61149a8261147e565b9050919050565b6114aa81611490565b82525050565b5f6060820190508181035f8301526114c9818789611411565b905081810360208301526114de818587611411565b90506114ed60408301846114a1565b9695505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611551602683610dec565b915061155c826114f7565b604082019050919050565b5f6020820190508181035f83015261157e81611545565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff82169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6115f5826115b2565b9150611600836115b2565b9250828201905060ff811115611619576116186115be565b5b92915050565b7f496e76616c6964207369676e61747572650000000000000000000000000000005f82015250565b5f611653601183610dec565b915061165e8261161f565b602082019050919050565b5f6020820190508181035f83015261168081611647565b9050919050565b5f61169182610ea5565b9050919050565b6116a181611687565b81146116ab575f5ffd5b50565b5f815190506116bc81611698565b92915050565b5f602082840312156116d7576116d6610ee7565b5b5f6116e4848285016116ae565b91505092915050565b6116f681610e72565b8114611700575f5ffd5b50565b5f81519050611711816116ed565b92915050565b5f6020828403121561172c5761172b610ee7565b5b5f61173984828501611703565b91505092915050565b7f496e76616c6964207369676e65720000000000000000000000000000000000005f82015250565b5f611776600e83610dec565b915061178182611742565b602082019050919050565b5f6020820190508181035f8301526117a38161176a565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6117de602083610dec565b91506117e9826117aa565b602082019050919050565b5f6020820190508181035f83015261180b816117d2565b9050919050565b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f611846601883610dec565b915061185182611812565b602082019050919050565b5f6020820190508181035f8301526118738161183a565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f6118ae601f83610dec565b91506118b98261187a565b602082019050919050565b5f6020820190508181035f8301526118db816118a2565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f61193c602283610dec565b9150611947826118e2565b604082019050919050565b5f6020820190508181035f83015261196981611930565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6119ca602283610dec565b91506119d582611970565b604082019050919050565b5f6020820190508181035f8301526119f7816119be565b9050919050565b611a0781611219565b82525050565b611a16816115b2565b82525050565b5f608082019050611a2f5f8301876119fe565b611a3c6020830186611a0d565b611a4960408301856119fe565b611a5660608301846119fe565b9594505050505056fea164736f6c634300081e000a", ->>>>>>> Stashed changes } // BatchAuthenticatorABI is the input ABI used to generate the binding from. @@ -49,7 +44,7 @@ var BatchAuthenticatorABI = BatchAuthenticatorMetaData.ABI var BatchAuthenticatorBin = BatchAuthenticatorMetaData.Bin // DeployBatchAuthenticator deploys a new Ethereum contract, binding an instance of BatchAuthenticator to it. -func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBackend, _espressoTEEVerifier common.Address, _preApprovedBatcher common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchAuthenticator, error) { +func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBackend, _espressoTEEVerifier common.Address, _teeBatcher common.Address, _nonTeeBatcher common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchAuthenticator, error) { parsed, err := BatchAuthenticatorMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -58,7 +53,7 @@ func DeployBatchAuthenticator(auth *bind.TransactOpts, backend bind.ContractBack return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchAuthenticatorBin), backend, _espressoTEEVerifier, _preApprovedBatcher, _owner) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchAuthenticatorBin), backend, _espressoTEEVerifier, _teeBatcher, _nonTeeBatcher, _owner) if err != nil { return common.Address{}, nil, nil, err } @@ -207,6 +202,37 @@ func (_BatchAuthenticator *BatchAuthenticatorTransactorRaw) Transact(opts *bind. return _BatchAuthenticator.Contract.contract.Transact(opts, method, params...) } +// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. +// +// Solidity: function activeIsTee() view returns(bool) +func (_BatchAuthenticator *BatchAuthenticatorCaller) ActiveIsTee(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _BatchAuthenticator.contract.Call(opts, &out, "activeIsTee") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. +// +// Solidity: function activeIsTee() view returns(bool) +func (_BatchAuthenticator *BatchAuthenticatorSession) ActiveIsTee() (bool, error) { + return _BatchAuthenticator.Contract.ActiveIsTee(&_BatchAuthenticator.CallOpts) +} + +// ActiveIsTee is a free data retrieval call binding the contract method 0x7877a9ed. +// +// Solidity: function activeIsTee() view returns(bool) +func (_BatchAuthenticator *BatchAuthenticatorCallerSession) ActiveIsTee() (bool, error) { + return _BatchAuthenticator.Contract.ActiveIsTee(&_BatchAuthenticator.CallOpts) +} + // DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. // // Solidity: function decodeAttestationTbs(bytes attestation) view returns(bytes, bytes) @@ -301,6 +327,37 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) NitroValidator() (co return _BatchAuthenticator.Contract.NitroValidator(&_BatchAuthenticator.CallOpts) } +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCaller) NonTeeBatcher(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BatchAuthenticator.contract.Call(opts, &out, "nonTeeBatcher") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorSession) NonTeeBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.NonTeeBatcher(&_BatchAuthenticator.CallOpts) +} + +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCallerSession) NonTeeBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.NonTeeBatcher(&_BatchAuthenticator.CallOpts) +} + // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -332,12 +389,12 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) Owner() (common.Addr return _BatchAuthenticator.Contract.Owner(&_BatchAuthenticator.CallOpts) } -// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. +// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. // -// Solidity: function preApprovedBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCaller) PreApprovedBatcher(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function teeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCaller) TeeBatcher(opts *bind.CallOpts) (common.Address, error) { var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "preApprovedBatcher") + err := _BatchAuthenticator.contract.Call(opts, &out, "teeBatcher") if err != nil { return *new(common.Address), err @@ -349,18 +406,18 @@ func (_BatchAuthenticator *BatchAuthenticatorCaller) PreApprovedBatcher(opts *bi } -// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. +// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. // -// Solidity: function preApprovedBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorSession) PreApprovedBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.PreApprovedBatcher(&_BatchAuthenticator.CallOpts) +// Solidity: function teeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorSession) TeeBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.TeeBatcher(&_BatchAuthenticator.CallOpts) } -// PreApprovedBatcher is a free data retrieval call binding the contract method 0x1f568b18. +// TeeBatcher is a free data retrieval call binding the contract method 0xd909ba7c. // -// Solidity: function preApprovedBatcher() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) PreApprovedBatcher() (common.Address, error) { - return _BatchAuthenticator.Contract.PreApprovedBatcher(&_BatchAuthenticator.CallOpts) +// Solidity: function teeBatcher() view returns(address) +func (_BatchAuthenticator *BatchAuthenticatorCallerSession) TeeBatcher() (common.Address, error) { + return _BatchAuthenticator.Contract.TeeBatcher(&_BatchAuthenticator.CallOpts) } // ValidBatchInfo is a free data retrieval call binding the contract method 0xf81f2083. @@ -488,6 +545,27 @@ func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) RenounceOwnershi return _BatchAuthenticator.Contract.RenounceOwnership(&_BatchAuthenticator.TransactOpts) } +// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. +// +// Solidity: function switchBatcher() returns() +func (_BatchAuthenticator *BatchAuthenticatorTransactor) SwitchBatcher(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BatchAuthenticator.contract.Transact(opts, "switchBatcher") +} + +// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. +// +// Solidity: function switchBatcher() returns() +func (_BatchAuthenticator *BatchAuthenticatorSession) SwitchBatcher() (*types.Transaction, error) { + return _BatchAuthenticator.Contract.SwitchBatcher(&_BatchAuthenticator.TransactOpts) +} + +// SwitchBatcher is a paid mutator transaction binding the contract method 0xbc347f47. +// +// Solidity: function switchBatcher() returns() +func (_BatchAuthenticator *BatchAuthenticatorTransactorSession) SwitchBatcher() (*types.Transaction, error) { + return _BatchAuthenticator.Contract.SwitchBatcher(&_BatchAuthenticator.TransactOpts) +} + // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() diff --git a/op-batcher/bindings/batch_inbox.go b/op-batcher/bindings/batch_inbox.go index a9a69cf04f5..944f9baf965 100644 --- a/op-batcher/bindings/batch_inbox.go +++ b/op-batcher/bindings/batch_inbox.go @@ -31,13 +31,8 @@ var ( // BatchInboxMetaData contains all meta data concerning the BatchInbox contract. var BatchInboxMetaData = &bind.MetaData{ -<<<<<<< Updated upstream - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"}]", - Bin: "0x60a0604052348015600e575f5ffd5b506040516103e33803806103e3833981016040819052602b91603b565b6001600160a01b03166080526066565b5f60208284031215604a575f5ffd5b81516001600160a01b0381168114605f575f5ffd5b9392505050565b60805161035f6100845f395f8181609d01526101d0015261035f5ff3fe608060405234801561000f575f5ffd5b505f491561018857604080515f80825260208201909252905b804915610067578181496040516020016100439291906102b4565b6040516020818303038152906040529150808061005f906102ce565b915050610028565b815160208301206040517ff81f2083000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa1580156100f7573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061011b919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f496e76616c696420626c6f62206261746368000000000000000000000000000060448201526064015b60405180910390fd5b005b5f5f36604051610199929190610350565b6040519081900381207ff81f20830000000000000000000000000000000000000000000000000000000082526004820181905291507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063f81f208390602401602060405180830381865afa15801561022a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061024e919061032a565b610186576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f496e76616c69642063616c6c6461746120626174636800000000000000000000604482015260640161017d565b5f83518060208601845e9190910191825250602001919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610323577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5060010190565b5f6020828403121561033a575f5ffd5b81518015158114610349575f5ffd5b9392505050565b818382375f910190815291905056", -======= ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_batchAuthenticator\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"fallback\",\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"batchAuthenticator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBatchAuthenticator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", Bin: "0x60c060405234801561000f575f5ffd5b50604051610f9b380380610f9b8339818101604052810190610031919061029d565b61004d61004261013c60201b60201c565b61014360201b60201c565b5f8273ffffffffffffffffffffffffffffffffffffffff1663b1bd42856040518163ffffffff1660e01b8152600401602060405180830381865afa158015610097573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100bb91906102db565b90508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250506101348261014360201b60201c565b505050610306565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61023182610208565b9050919050565b5f61024282610227565b9050919050565b61025281610238565b811461025c575f5ffd5b50565b5f8151905061026d81610249565b92915050565b61027c81610227565b8114610286575f5ffd5b50565b5f8151905061029781610273565b92915050565b5f5f604083850312156102b3576102b2610204565b5b5f6102c08582860161025f565b92505060206102d185828601610289565b9150509250929050565b5f602082840312156102f0576102ef610204565b5b5f6102fd84828501610289565b91505092915050565b60805160a051610c596103425f395f8181605c0152818161019a0152818161029401526104e101525f818161037201526104bd0152610c595ff3fe608060405234801561000f575f5ffd5b5060043610610059575f3560e01c8063715018a6146104015780638da5cb5b1461040b578063b1bd428514610429578063e758457314610447578063f2fde38b146104655761005a565b5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16637877a9ed6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906100e79190610704565b15610370575f5f1b5f4914610277575f5f67ffffffffffffffff8111156101115761011061072f565b5b6040519080825280601f01601f1916602001820160405280156101435781602001600182028036833780820191505090505b5090505f5f90505b5f5f1b81491461018d578181496040516020016101699291906107d7565b6040516020818303038152906040529150808061018590610834565b91505061014b565b5f828051906020012090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016101f1919061088a565b602060405180830381865afa15801561020c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102309190610704565b61026f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610266906108fd565b60405180910390fd5b50505061036b565b5f5f3660405161028892919061094d565b604051809103902090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f81f2083826040518263ffffffff1660e01b81526004016102eb919061088a565b602060405180830381865afa158015610306573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061032a9190610704565b610369576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610360906109af565b60405180910390fd5b505b6103ff565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146103fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f590610a17565b60405180910390fd5b5b005b610409610481565b005b610413610494565b6040516104209190610a74565b60405180910390f35b6104316104bb565b60405161043e9190610a74565b60405180910390f35b61044f6104df565b60405161045c9190610ae8565b60405180910390f35b61047f600480360381019061047a9190610b2b565b610503565b005b610489610585565b6104925f610603565b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b61050b610585565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057090610bc6565b60405180910390fd5b61058281610603565b50565b61058d6106c4565b73ffffffffffffffffffffffffffffffffffffffff166105ab610494565b73ffffffffffffffffffffffffffffffffffffffff1614610601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f890610c2e565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f5ffd5b5f8115159050919050565b6106e3816106cf565b81146106ed575f5ffd5b50565b5f815190506106fe816106da565b92915050565b5f60208284031215610719576107186106cb565b5b5f610726848285016106f0565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f81519050919050565b5f81905092915050565b8281835e5f83830152505050565b5f6107888261075c565b6107928185610766565b93506107a2818560208601610770565b80840191505092915050565b5f819050919050565b5f819050919050565b6107d16107cc826107ae565b6107b7565b82525050565b5f6107e2828561077e565b91506107ee82846107c0565b6020820191508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f819050919050565b5f61083e8261082b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036108705761086f6107fe565b5b600182019050919050565b610884816107ae565b82525050565b5f60208201905061089d5f83018461087b565b92915050565b5f82825260208201905092915050565b7f496e76616c696420626c6f6220626174636800000000000000000000000000005f82015250565b5f6108e76012836108a3565b91506108f2826108b3565b602082019050919050565b5f6020820190508181035f830152610914816108db565b9050919050565b828183375f83830152505050565b5f6109348385610766565b935061094183858461091b565b82840190509392505050565b5f610959828486610929565b91508190509392505050565b7f496e76616c69642063616c6c64617461206261746368000000000000000000005f82015250565b5f6109996016836108a3565b91506109a482610965565b602082019050919050565b5f6020820190508181035f8301526109c68161098d565b9050919050565b7f4261746368496e626f783a20756e617574686f72697a656420626174636865725f82015250565b5f610a016020836108a3565b9150610a0c826109cd565b602082019050919050565b5f6020820190508181035f830152610a2e816109f5565b9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610a5e82610a35565b9050919050565b610a6e81610a54565b82525050565b5f602082019050610a875f830184610a65565b92915050565b5f819050919050565b5f610ab0610aab610aa684610a35565b610a8d565b610a35565b9050919050565b5f610ac182610a96565b9050919050565b5f610ad282610ab7565b9050919050565b610ae281610ac8565b82525050565b5f602082019050610afb5f830184610ad9565b92915050565b610b0a81610a54565b8114610b14575f5ffd5b50565b5f81359050610b2581610b01565b92915050565b5f60208284031215610b4057610b3f6106cb565b5b5f610b4d84828501610b17565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f610bb06026836108a3565b9150610bbb82610b56565b604082019050919050565b5f6020820190508181035f830152610bdd81610ba4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f610c186020836108a3565b9150610c2382610be4565b602082019050919050565b5f6020820190508181035f830152610c4581610c0c565b905091905056fea164736f6c634300081e000a", ->>>>>>> Stashed changes } // BatchInboxABI is the input ABI used to generate the binding from. @@ -49,7 +44,7 @@ var BatchInboxABI = BatchInboxMetaData.ABI var BatchInboxBin = BatchInboxMetaData.Bin // DeployBatchInbox deploys a new Ethereum contract, binding an instance of BatchInbox to it. -func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _batchAuthenticator common.Address) (common.Address, *types.Transaction, *BatchInbox, error) { +func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _batchAuthenticator common.Address, _owner common.Address) (common.Address, *types.Transaction, *BatchInbox, error) { parsed, err := BatchInboxMetaData.GetAbi() if err != nil { return common.Address{}, nil, nil, err @@ -58,7 +53,7 @@ func DeployBatchInbox(auth *bind.TransactOpts, backend bind.ContractBackend, _ba return common.Address{}, nil, nil, errors.New("GetABI returned nil") } - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchInboxBin), backend, _batchAuthenticator) + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(BatchInboxBin), backend, _batchAuthenticator, _owner) if err != nil { return common.Address{}, nil, nil, err } @@ -207,6 +202,141 @@ func (_BatchInbox *BatchInboxTransactorRaw) Transact(opts *bind.TransactOpts, me return _BatchInbox.Contract.contract.Transact(opts, method, params...) } +// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. +// +// Solidity: function batchAuthenticator() view returns(address) +func (_BatchInbox *BatchInboxCaller) BatchAuthenticator(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BatchInbox.contract.Call(opts, &out, "batchAuthenticator") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. +// +// Solidity: function batchAuthenticator() view returns(address) +func (_BatchInbox *BatchInboxSession) BatchAuthenticator() (common.Address, error) { + return _BatchInbox.Contract.BatchAuthenticator(&_BatchInbox.CallOpts) +} + +// BatchAuthenticator is a free data retrieval call binding the contract method 0xe7584573. +// +// Solidity: function batchAuthenticator() view returns(address) +func (_BatchInbox *BatchInboxCallerSession) BatchAuthenticator() (common.Address, error) { + return _BatchInbox.Contract.BatchAuthenticator(&_BatchInbox.CallOpts) +} + +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchInbox *BatchInboxCaller) NonTeeBatcher(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BatchInbox.contract.Call(opts, &out, "nonTeeBatcher") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchInbox *BatchInboxSession) NonTeeBatcher() (common.Address, error) { + return _BatchInbox.Contract.NonTeeBatcher(&_BatchInbox.CallOpts) +} + +// NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. +// +// Solidity: function nonTeeBatcher() view returns(address) +func (_BatchInbox *BatchInboxCallerSession) NonTeeBatcher() (common.Address, error) { + return _BatchInbox.Contract.NonTeeBatcher(&_BatchInbox.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_BatchInbox *BatchInboxCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _BatchInbox.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_BatchInbox *BatchInboxSession) Owner() (common.Address, error) { + return _BatchInbox.Contract.Owner(&_BatchInbox.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_BatchInbox *BatchInboxCallerSession) Owner() (common.Address, error) { + return _BatchInbox.Contract.Owner(&_BatchInbox.CallOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BatchInbox *BatchInboxTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _BatchInbox.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BatchInbox *BatchInboxSession) RenounceOwnership() (*types.Transaction, error) { + return _BatchInbox.Contract.RenounceOwnership(&_BatchInbox.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_BatchInbox *BatchInboxTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _BatchInbox.Contract.RenounceOwnership(&_BatchInbox.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BatchInbox *BatchInboxTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _BatchInbox.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BatchInbox *BatchInboxSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _BatchInbox.Contract.TransferOwnership(&_BatchInbox.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_BatchInbox *BatchInboxTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _BatchInbox.Contract.TransferOwnership(&_BatchInbox.TransactOpts, newOwner) +} + // Fallback is a paid mutator transaction binding the contract fallback function. // // Solidity: fallback() returns() @@ -227,3 +357,156 @@ func (_BatchInbox *BatchInboxSession) Fallback(calldata []byte) (*types.Transact func (_BatchInbox *BatchInboxTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { return _BatchInbox.Contract.Fallback(&_BatchInbox.TransactOpts, calldata) } + +// BatchInboxOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the BatchInbox contract. +type BatchInboxOwnershipTransferredIterator struct { + Event *BatchInboxOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BatchInboxOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BatchInboxOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BatchInboxOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BatchInboxOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BatchInboxOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BatchInboxOwnershipTransferred represents a OwnershipTransferred event raised by the BatchInbox contract. +type BatchInboxOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_BatchInbox *BatchInboxFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*BatchInboxOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _BatchInbox.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &BatchInboxOwnershipTransferredIterator{contract: _BatchInbox.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_BatchInbox *BatchInboxFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *BatchInboxOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _BatchInbox.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BatchInboxOwnershipTransferred) + if err := _BatchInbox.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_BatchInbox *BatchInboxFilterer) ParseOwnershipTransferred(log types.Log) (*BatchInboxOwnershipTransferred, error) { + event := new(BatchInboxOwnershipTransferred) + if err := _BatchInbox.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol index 2e136ff1b0a..541f0765fea 100644 --- a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol +++ b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol @@ -23,25 +23,6 @@ contract MockNitroTEEVerifier is IEspressoNitroTEEVerifier { function registerSigner(bytes calldata, bytes calldata) external pure override { } - function registerSignerWithoutAttestationVerification( - bytes32, - bytes calldata, - bytes calldata, - address - ) - external - pure - override - { } - - function verifyCACert(bytes calldata, bytes32) external pure override { } - - function verifyClientCert(bytes calldata, bytes32) external pure override { } - - function certVerified(bytes32) external pure override returns (bool) { - return false; - } - function setEnclaveHash(bytes32, bool) external pure override { } function deleteRegisteredSigners(address[] memory) external pure override { } From 2b791156557a2e971e20eb54f7a1d0135a64605e Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 13:40:22 -0800 Subject: [PATCH 07/33] bring back deploy aws nitro --- .../deploy/DeployAWSNitroVerifier.s.sol | 78 ++++++++++++ .../src/L1/BatchAuthenticator.sol | 59 +++++---- .../test/L1/BatchAuthenticator.t.sol | 113 ++++++++++++++---- 3 files changed, 199 insertions(+), 51 deletions(-) create mode 100644 packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol diff --git a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol new file mode 100644 index 00000000000..619a35d10e1 --- /dev/null +++ b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.22; + +import { CertManager } from "@nitro-validator/CertManager.sol"; +import { IEspressoNitroTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; +import { EspressoNitroTEEVerifier } from "@espresso-tee-contracts/EspressoNitroTEEVerifier.sol"; +import { BaseDeployIO } from "scripts/deploy/BaseDeployIO.sol"; +import { Script } from "forge-std/Script.sol"; +import { Solarray } from "scripts/libraries/Solarray.sol"; +import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; + +contract DeployAWSNitroVerifierInput is BaseDeployIO { + bytes32 internal _enclaveHash; + + function set(bytes4 _sel, bytes32 _val) public { + if (_sel == this.enclaveHash.selector) _enclaveHash = _val; + else revert("DeployAWSNitroVerifierInput: unknown selector"); + } + + function enclaveHash() public view returns (bytes32) { + require(_enclaveHash != 0, "DeployAWSNitroVerifierInput: enclaveHash not set"); + return _enclaveHash; + } +} + +contract DeployAWSNitroVerifierOutput is BaseDeployIO { + address internal _nitroTEEVerifierAddress; + + function set(bytes4 _sel, address _addr) public { + require(_addr != address(0), "DeployAWSNitroVerifierOutput: cannot set zero address"); + if (_sel == this.nitroTEEVerifierAddress.selector) { + _nitroTEEVerifierAddress = _addr; + } else { + revert("DeployAWSNitroVerifierOutput: unknown selector"); + } + } + + function nitroTEEVerifierAddress() public view returns (address) { + require(_nitroTEEVerifierAddress != address(0), "nitro TEE verifier address not set"); + return _nitroTEEVerifierAddress; + } +} + +contract DeployAWSNitroVerifier is Script { + function run(DeployAWSNitroVerifierInput input, DeployAWSNitroVerifierOutput output) public { + CertManager manager = deployCertManager(); + deployNitroTEEVerifier(input, output, manager); + checkOutput(output); + } + + function deployNitroTEEVerifier( + DeployAWSNitroVerifierInput input, + DeployAWSNitroVerifierOutput output, + CertManager certManager + ) + public + returns (IEspressoNitroTEEVerifier) + { + bytes32 enclaveHash = input.enclaveHash(); + vm.broadcast(msg.sender); + IEspressoNitroTEEVerifier impl = new EspressoNitroTEEVerifier(enclaveHash, certManager); + vm.label(address(impl), "NitroTEEVerifierImpl"); + output.set(output.nitroTEEVerifierAddress.selector, address(impl)); + return impl; + } + + function deployCertManager() public returns (CertManager) { + vm.broadcast(msg.sender); + CertManager impl = new CertManager(); + vm.label(address(impl), "CertManagerImpl"); + return impl; + } + + function checkOutput(DeployAWSNitroVerifierOutput output) public view { + address[] memory addresses = Solarray.addresses(address(output.nitroTEEVerifierAddress())); + DeployUtils.assertValidContractAddresses(addresses); + } +} diff --git a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol index 9aebb6ad1f6..329c3b81405 100644 --- a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol +++ b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol @@ -1,17 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; -import { ISemver } from "interfaces/universal/ISemver.sol"; -import { IEspressoTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; - -interface INitroValidator { - function decodeAttestationTbs(bytes memory attestation) - external - pure - returns (bytes memory attestationTbs, bytes memory signature); -} +import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {ISemver} from "interfaces/universal/ISemver.sol"; +import { + IEspressoTEEVerifier +} from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; contract BatchAuthenticator is ISemver, Ownable { /// @notice Semantic version. @@ -28,7 +23,6 @@ contract BatchAuthenticator is ISemver, Ownable { address public immutable nonTeeBatcher; IEspressoTEEVerifier public immutable espressoTEEVerifier; - INitroValidator public immutable nitroValidator; /// @notice Flag indicating which batcher is currently active. /// @dev When true the TEE batcher is active; when false the non-TEE batcher is active. @@ -39,31 +33,33 @@ contract BatchAuthenticator is ISemver, Ownable { address _teeBatcher, address _nonTeeBatcher, address _owner - ) - Ownable() - { - require(_teeBatcher != address(0), "BatchAuthenticator: zero tee batcher"); - require(_nonTeeBatcher != address(0), "BatchAuthenticator: zero non-tee batcher"); + ) Ownable() { + require( + _teeBatcher != address(0), + "BatchAuthenticator: zero tee batcher" + ); + require( + _nonTeeBatcher != address(0), + "BatchAuthenticator: zero non-tee batcher" + ); espressoTEEVerifier = _espressoTEEVerifier; teeBatcher = _teeBatcher; nonTeeBatcher = _nonTeeBatcher; - nitroValidator = INitroValidator(address(espressoTEEVerifier.espressoNitroTEEVerifier())); // By default, start with the TEE batcher active. activeIsTee = true; _transferOwnership(_owner); } - function decodeAttestationTbs(bytes memory attestation) external view returns (bytes memory, bytes memory) { - return nitroValidator.decodeAttestationTbs(attestation); - } - /// @notice Toggles the active batcher between the TEE and non-TEE batcher. function switchBatcher() external onlyOwner { activeIsTee = !activeIsTee; } - function authenticateBatchInfo(bytes32 commitment, bytes calldata _signature) external { + function authenticateBatchInfo( + bytes32 commitment, + bytes calldata _signature + ) external { // https://github.com/ethereum/go-ethereum/issues/19751#issuecomment-504900739 bytes memory signature = _signature; uint8 v = uint8(signature[64]); @@ -77,14 +73,25 @@ contract BatchAuthenticator is ISemver, Ownable { revert("Invalid signature"); } - if (!espressoTEEVerifier.espressoNitroTEEVerifier().registeredSigners(signer) && signer != teeBatcher) { + if ( + !espressoTEEVerifier.espressoNitroTEEVerifier().registeredSigners( + signer + ) && signer != teeBatcher + ) { revert("Invalid signer"); } validBatchInfo[commitment] = true; } - function registerSigner(bytes calldata attestationTbs, bytes calldata signature) external { - espressoTEEVerifier.registerSigner(attestationTbs, signature, IEspressoTEEVerifier.TeeType.NITRO); + function registerSigner( + bytes calldata attestationTbs, + bytes calldata signature + ) external { + espressoTEEVerifier.registerSigner( + attestationTbs, + signature, + IEspressoTEEVerifier.TeeType.NITRO + ); } } diff --git a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol index 541f0765fea..1cbcb49907c 100644 --- a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol +++ b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol @@ -2,30 +2,43 @@ pragma solidity ^0.8.0; // Testing -import { Test } from "forge-std/Test.sol"; +import {Test} from "forge-std/Test.sol"; // Contracts -import { BatchAuthenticator } from "src/L1/BatchAuthenticator.sol"; -import { IEspressoTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; -import { IEspressoNitroTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; -import { IEspressoSGXTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoSGXTEEVerifier.sol"; +import {BatchAuthenticator} from "src/L1/BatchAuthenticator.sol"; +import { + IEspressoTEEVerifier +} from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; +import { + IEspressoNitroTEEVerifier +} from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; +import { + IEspressoSGXTEEVerifier +} from "@espresso-tee-contracts/interface/IEspressoSGXTEEVerifier.sol"; contract MockNitroTEEVerifier is IEspressoNitroTEEVerifier { mapping(address => bool) private _registeredSigners; - function registeredSigners(address signer) external view override returns (bool) { + function registeredSigners( + address signer + ) external view override returns (bool) { return _registeredSigners[signer]; } - function registeredEnclaveHash(bytes32) external pure override returns (bool) { + function registeredEnclaveHash( + bytes32 + ) external pure override returns (bool) { return false; } - function registerSigner(bytes calldata, bytes calldata) external pure override { } + function registerSigner( + bytes calldata, + bytes calldata + ) external pure override {} - function setEnclaveHash(bytes32, bool) external pure override { } + function setEnclaveHash(bytes32, bool) external pure override {} - function deleteRegisteredSigners(address[] memory) external pure override { } + function deleteRegisteredSigners(address[] memory) external pure override {} // Test helper function setRegisteredSigner(address signer, bool value) external { @@ -42,33 +55,61 @@ contract MockEspressoTEEVerifier is IEspressoTEEVerifier { sgx = IEspressoSGXTEEVerifier(address(0)); } - function espressoNitroTEEVerifier() external view override returns (IEspressoNitroTEEVerifier) { + function espressoNitroTEEVerifier() + external + view + override + returns (IEspressoNitroTEEVerifier) + { return nitro; } - function espressoSGXTEEVerifier() external view override returns (IEspressoSGXTEEVerifier) { + function espressoSGXTEEVerifier() + external + view + override + returns (IEspressoSGXTEEVerifier) + { return sgx; } - function verify(bytes memory, bytes32, TeeType) external pure override returns (bool) { + function verify( + bytes memory, + bytes32, + TeeType + ) external pure override returns (bool) { return true; } - function registerSigner(bytes calldata, bytes calldata, TeeType) external pure override { } + function registerSigner( + bytes calldata, + bytes calldata, + TeeType + ) external pure override {} - function registeredSigners(address, TeeType) external pure override returns (bool) { + function registeredSigners( + address, + TeeType + ) external pure override returns (bool) { return false; } - function registeredEnclaveHashes(bytes32, TeeType) external pure override returns (bool) { + function registeredEnclaveHashes( + bytes32, + TeeType + ) external pure override returns (bool) { return false; } - function setEspressoSGXTEEVerifier(IEspressoSGXTEEVerifier _sgx) external override { + function setEspressoSGXTEEVerifier( + IEspressoSGXTEEVerifier _sgx + ) external override { sgx = _sgx; } - function setEspressoNitroTEEVerifier(IEspressoNitroTEEVerifier _nitro) external override { + function setEspressoNitroTEEVerifier( + IEspressoNitroTEEVerifier _nitro + ) external override { nitro = _nitro; } } @@ -91,8 +132,12 @@ contract BatchAuthenticator_SwitchBatcher_Test is Test { teeVerifier = new MockEspressoTEEVerifier(nitroVerifier); vm.prank(deployer); - authenticator = - new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, nonTeeBatcher, deployer); + authenticator = new BatchAuthenticator( + IEspressoTEEVerifier(address(teeVerifier)), + teeBatcher, + nonTeeBatcher, + deployer + ); } /// @notice Test that only the owner can switch the active batcher @@ -101,7 +146,11 @@ contract BatchAuthenticator_SwitchBatcher_Test is Test { vm.startPrank(deployer); bool initialIsTee = authenticator.activeIsTee(); authenticator.switchBatcher(); - assertEq(authenticator.activeIsTee(), !initialIsTee, "owner should be able to switch batcher"); + assertEq( + authenticator.activeIsTee(), + !initialIsTee, + "owner should be able to switch batcher" + ); vm.stopPrank(); // Non-owner cannot switch batcher. @@ -127,17 +176,31 @@ contract BatchAuthenticator_Constructor_Test is Test { function test_constructor_revertsWhenTeeBatcherIsZero() external { vm.expectRevert("BatchAuthenticator: zero tee batcher"); - new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), address(0), nonTeeBatcher, owner); + new BatchAuthenticator( + IEspressoTEEVerifier(address(teeVerifier)), + address(0), + nonTeeBatcher, + owner + ); } function test_constructor_revertsWhenNonTeeBatcherIsZero() external { vm.expectRevert("BatchAuthenticator: zero non-tee batcher"); - new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, address(0), owner); + new BatchAuthenticator( + IEspressoTEEVerifier(address(teeVerifier)), + teeBatcher, + address(0), + owner + ); } function test_constructor_succeedsWithValidAddresses() external { - BatchAuthenticator authenticator = - new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, nonTeeBatcher, owner); + BatchAuthenticator authenticator = new BatchAuthenticator( + IEspressoTEEVerifier(address(teeVerifier)), + teeBatcher, + nonTeeBatcher, + owner + ); assertEq(authenticator.teeBatcher(), teeBatcher); assertEq(authenticator.nonTeeBatcher(), nonTeeBatcher); } From 19803fd488077ca9923f2b0c502c7001f5a0c841 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 16:45:36 -0800 Subject: [PATCH 08/33] add support for mock contract --- espresso/cli.go | 24 ++-- op-batcher/batcher/espresso.go | 2 +- op-batcher/batcher/service.go | 12 +- op-batcher/bindings/batch_authenticator.go | 67 +---------- op-deployer/pkg/deployer/opcm/espresso.go | 3 +- op-deployer/pkg/deployer/pipeline/espresso.go | 25 +++- .../deploy/DeployAWSNitroVerifier.s.sol | 60 +++++++--- .../src/L1/BatchAuthenticator.sol | 46 ++----- .../test/L1/BatchAuthenticator.t.sol | 113 ++++-------------- 9 files changed, 129 insertions(+), 223 deletions(-) diff --git a/espresso/cli.go b/espresso/cli.go index 672d17b83c0..6d3e7d9a14b 100644 --- a/espresso/cli.go +++ b/espresso/cli.go @@ -107,17 +107,17 @@ func CLIFlags(envPrefix string, category string) []cli.Flag { } type CLIConfig struct { - Enabled bool - PollInterval time.Duration - UseFetchAPI bool - QueryServiceURLs []string - LightClientAddr common.Address - L1URL string - RollupL1URL string - TestingBatcherPrivateKey *ecdsa.PrivateKey - Namespace uint64 - OriginHeight uint64 - AttestationServiceURL string + Enabled bool + PollInterval time.Duration + UseFetchAPI bool + QueryServiceURLs []string + LightClientAddr common.Address + L1URL string + RollupL1URL string + TestingBatcherPrivateKey *ecdsa.PrivateKey + Namespace uint64 + OriginHeight uint64 + EspressoAttestationService string } func (c CLIConfig) Check() error { @@ -138,7 +138,7 @@ func (c CLIConfig) Check() error { if c.Namespace == 0 { return fmt.Errorf("namespace is required when Espresso is enabled") } - if c.AttestationServiceURL == "" { + if c.EspressoAttestationService == "" { return fmt.Errorf("attestation service URL is required when Espresso is enabled") } } diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 9bf598d4122..0d24946a576 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1013,7 +1013,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { } func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*EspressoOnchainProof, error) { - request, err := http.NewRequestWithContext(ctx, "POST", l.Config.EspressoAttestationServiceURL+"/generate_proof", bytes.NewBuffer(attestationBytes)) + request, err := http.NewRequestWithContext(ctx, "POST", l.Config.EspressoAttestationService+"/generate_proof", bytes.NewBuffer(attestationBytes)) if err != nil { return nil, err } diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index f1c1712ad35..4c673905f0a 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -39,11 +39,11 @@ import ( var ErrAlreadyStopped = errors.New("already stopped") type BatcherConfig struct { - NetworkTimeout time.Duration - PollInterval time.Duration - EspressoPollInterval time.Duration - EspressoAttestationServiceURL string - MaxPendingTransactions uint64 + NetworkTimeout time.Duration + PollInterval time.Duration + EspressoPollInterval time.Duration + EspressoAttestationService string + MaxPendingTransactions uint64 // UseAltDA is true if the rollup config has a DA challenge address so the batcher // will post inputs to the DA server and post commitments to blobs or calldata. @@ -565,7 +565,7 @@ func (bs *BatcherService) initEspresso(cfg *CLIConfig) error { bs.UseEspresso = true bs.EspressoPollInterval = cfg.Espresso.PollInterval - bs.EspressoAttestationServiceURL = cfg.Espresso.AttestationServiceURL + bs.EspressoAttestationService = cfg.Espresso.EspressoAttestationService urlZero := cfg.Espresso.QueryServiceURLs[0] espressoClient := espressoClient.NewClient(urlZero) diff --git a/op-batcher/bindings/batch_authenticator.go b/op-batcher/bindings/batch_authenticator.go index 27dc380cd36..c7d7b9f35f6 100644 --- a/op-batcher/bindings/batch_authenticator.go +++ b/op-batcher/bindings/batch_authenticator.go @@ -31,8 +31,8 @@ var ( // BatchAuthenticatorMetaData contains all meta data concerning the BatchAuthenticator contract. var BatchAuthenticatorMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"},{\"name\":\"_teeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonTeeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"activeIsTee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"decodeAttestationTbs\",\"inputs\":[{\"name\":\"attestation\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nitroValidator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINitroValidator\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"switchBatcher\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"teeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", - Bin: "0x610100604052348015610010575f5ffd5b506040516120ac3803806120ac833981810160405281019061003291906103fb565b61004e61004361029a60201b60201c565b6102a160201b60201c565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036100bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100b3906104df565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361012a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101219061056d565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff168152505060c05173ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610211573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061023591906105c6565b73ffffffffffffffffffffffffffffffffffffffff1660e08173ffffffffffffffffffffffffffffffffffffffff1681525050600160025f6101000a81548160ff021916908315150217905550610291816102a160201b60201c565b505050506105f1565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61038f82610366565b9050919050565b5f6103a082610385565b9050919050565b6103b081610396565b81146103ba575f5ffd5b50565b5f815190506103cb816103a7565b92915050565b6103da81610385565b81146103e4575f5ffd5b50565b5f815190506103f5816103d1565b92915050565b5f5f5f5f6080858703121561041357610412610362565b5b5f610420878288016103bd565b9450506020610431878288016103e7565b9350506040610442878288016103e7565b9250506060610453878288016103e7565b91505092959194509250565b5f82825260208201905092915050565b7f426174636841757468656e74696361746f723a207a65726f20746565206261745f8201527f6368657200000000000000000000000000000000000000000000000000000000602082015250565b5f6104c960248361045f565b91506104d48261046f565b604082019050919050565b5f6020820190508181035f8301526104f6816104bd565b9050919050565b7f426174636841757468656e74696361746f723a207a65726f206e6f6e2d7465655f8201527f2062617463686572000000000000000000000000000000000000000000000000602082015250565b5f61055760288361045f565b9150610562826104fd565b604082019050919050565b5f6020820190508181035f8301526105848161054b565b9050919050565b5f61059582610385565b9050919050565b6105a58161058b565b81146105af575f5ffd5b50565b5f815190506105c08161059c565b92915050565b5f602082840312156105db576105da610362565b5b5f6105e8848285016105b2565b91505092915050565b60805160a05160c05160e051611a6c6106405f395f8181610289015261033501525f81816103fd01528181610587015261070101525f6103d901525f81816104c4015261080d0152611a6c5ff3fe608060405234801561000f575f5ffd5b50600436106100e8575f3560e01c8063ba58e82a1161008a578063f2fde38b11610064578063f2fde38b14610201578063f81f20831461021d578063fa14fe6d1461024d578063fc619e411461026b576100e8565b8063ba58e82a146101bd578063bc347f47146101d9578063d909ba7c146101e3576100e8565b80637877a9ed116100c65780637877a9ed146101325780638da5cb5b14610150578063a903a2771461016e578063b1bd42851461019f576100e8565b80631b076a4c146100ec57806354fd4d501461010a578063715018a614610128575b5f5ffd5b6100f4610287565b6040516101019190610dc9565b60405180910390f35b6101126102ab565b60405161011f9190610e52565b60405180910390f35b6101306102e4565b005b61013a6102f7565b6040516101479190610e8c565b60405180910390f35b610158610309565b6040516101659190610ec5565b60405180910390f35b6101886004803603810190610183919061101b565b610330565b6040516101969291906110b4565b60405180910390f35b6101a76103d7565b6040516101b49190610ec5565b60405180910390f35b6101d760048036038101906101d29190611146565b6103fb565b005b6101e1610490565b005b6101eb6104c2565b6040516101f89190610ec5565b60405180910390f35b61021b600480360381019061021691906111ee565b6104e6565b005b6102376004803603810190610232919061124c565b610568565b6040516102449190610e8c565b60405180910390f35b610255610585565b6040516102629190611297565b60405180910390f35b610285600480360381019061028091906112b0565b6105a9565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b6040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6102ec6108cc565b6102f55f61094a565b565b60025f9054906101000a900460ff1681565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060807f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a903a277846040518263ffffffff1660e01b815260040161038c919061130d565b5f60405180830381865afa1580156103a6573d5f5f3e3d5ffd5b505050506040513d5f823e3d601f19601f820116820180604052508101906103ce919061139b565b91509150915091565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166335ecb4c18585858560016040518663ffffffff1660e01b815260040161045d9594939291906114b0565b5f604051808303815f87803b158015610474575f5ffd5b505af1158015610486573d5f5f3e3d5ffd5b5050505050505050565b6104986108cc565b60025f9054906101000a900460ff161560025f6101000a81548160ff021916908315150217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b6104ee6108cc565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361055c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055390611567565b60405180910390fd5b6105658161094a565b50565b6001602052805f5260405f205f915054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f82828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505090505f8160408151811061060557610604611585565b5b602001015160f81c60f81b60f81c90505f8160ff161480610629575060018160ff16145b1561068457601b8161063b91906115eb565b90508060f81b8260408151811061065557610654611585565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505b5f61068f8684610a0b565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036106ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f690611669565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610768573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078c91906116c2565b73ffffffffffffffffffffffffffffffffffffffff16630123d0c1826040518263ffffffff1660e01b81526004016107c49190610ec5565b602060405180830381865afa1580156107df573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108039190611717565b15801561085c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b1561089c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108939061178c565b60405180910390fd5b6001805f8881526020019081526020015f205f6101000a81548160ff021916908315150217905550505050505050565b6108d4610a30565b73ffffffffffffffffffffffffffffffffffffffff166108f2610309565b73ffffffffffffffffffffffffffffffffffffffff1614610948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093f906117f4565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f5f610a188585610a37565b91509150610a2581610a83565b819250505092915050565b5f33905090565b5f5f6041835103610a74575f5f5f602086015192506040860151915060608601515f1a9050610a6887828585610c4e565b94509450505050610a7c565b5f6002915091505b9250929050565b5f6004811115610a9657610a9561143d565b5b816004811115610aa957610aa861143d565b5b0315610c4b5760016004811115610ac357610ac261143d565b5b816004811115610ad657610ad561143d565b5b03610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d9061185c565b60405180910390fd5b60026004811115610b2a57610b2961143d565b5b816004811115610b3d57610b3c61143d565b5b03610b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b74906118c4565b60405180910390fd5b60036004811115610b9157610b9061143d565b5b816004811115610ba457610ba361143d565b5b03610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90611952565b60405180910390fd5b600480811115610bf757610bf661143d565b5b816004811115610c0a57610c0961143d565b5b03610c4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c41906119e0565b60405180910390fd5b5b50565b5f5f7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610c86575f600391509150610d46565b601b8560ff1614158015610c9e5750601c8560ff1614155b15610caf575f600491509150610d46565b5f6001878787876040515f8152602001604052604051610cd29493929190611a1c565b6020604051602081039080840390855afa158015610cf2573d5f5f3e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610d3e575f60019250925050610d46565b805f92509250505b94509492505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f819050919050565b5f610d91610d8c610d8784610d4f565b610d6e565b610d4f565b9050919050565b5f610da282610d77565b9050919050565b5f610db382610d98565b9050919050565b610dc381610da9565b82525050565b5f602082019050610ddc5f830184610dba565b92915050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610e2482610de2565b610e2e8185610dec565b9350610e3e818560208601610dfc565b610e4781610e0a565b840191505092915050565b5f6020820190508181035f830152610e6a8184610e1a565b905092915050565b5f8115159050919050565b610e8681610e72565b82525050565b5f602082019050610e9f5f830184610e7d565b92915050565b5f610eaf82610d4f565b9050919050565b610ebf81610ea5565b82525050565b5f602082019050610ed85f830184610eb6565b92915050565b5f604051905090565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610f2d82610e0a565b810181811067ffffffffffffffff82111715610f4c57610f4b610ef7565b5b80604052505050565b5f610f5e610ede565b9050610f6a8282610f24565b919050565b5f67ffffffffffffffff821115610f8957610f88610ef7565b5b610f9282610e0a565b9050602081019050919050565b828183375f83830152505050565b5f610fbf610fba84610f6f565b610f55565b905082815260208101848484011115610fdb57610fda610ef3565b5b610fe6848285610f9f565b509392505050565b5f82601f83011261100257611001610eef565b5b8135611012848260208601610fad565b91505092915050565b5f602082840312156110305761102f610ee7565b5b5f82013567ffffffffffffffff81111561104d5761104c610eeb565b5b61105984828501610fee565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f61108682611062565b611090818561106c565b93506110a0818560208601610dfc565b6110a981610e0a565b840191505092915050565b5f6040820190508181035f8301526110cc818561107c565b905081810360208301526110e0818461107c565b90509392505050565b5f5ffd5b5f5ffd5b5f5f83601f84011261110657611105610eef565b5b8235905067ffffffffffffffff811115611123576111226110e9565b5b60208301915083600182028301111561113f5761113e6110ed565b5b9250929050565b5f5f5f5f6040858703121561115e5761115d610ee7565b5b5f85013567ffffffffffffffff81111561117b5761117a610eeb565b5b611187878288016110f1565b9450945050602085013567ffffffffffffffff8111156111aa576111a9610eeb565b5b6111b6878288016110f1565b925092505092959194509250565b6111cd81610ea5565b81146111d7575f5ffd5b50565b5f813590506111e8816111c4565b92915050565b5f6020828403121561120357611202610ee7565b5b5f611210848285016111da565b91505092915050565b5f819050919050565b61122b81611219565b8114611235575f5ffd5b50565b5f8135905061124681611222565b92915050565b5f6020828403121561126157611260610ee7565b5b5f61126e84828501611238565b91505092915050565b5f61128182610d98565b9050919050565b61129181611277565b82525050565b5f6020820190506112aa5f830184611288565b92915050565b5f5f5f604084860312156112c7576112c6610ee7565b5b5f6112d486828701611238565b935050602084013567ffffffffffffffff8111156112f5576112f4610eeb565b5b611301868287016110f1565b92509250509250925092565b5f6020820190508181035f830152611325818461107c565b905092915050565b5f61133f61133a84610f6f565b610f55565b90508281526020810184848401111561135b5761135a610ef3565b5b611366848285610dfc565b509392505050565b5f82601f83011261138257611381610eef565b5b815161139284826020860161132d565b91505092915050565b5f5f604083850312156113b1576113b0610ee7565b5b5f83015167ffffffffffffffff8111156113ce576113cd610eeb565b5b6113da8582860161136e565b925050602083015167ffffffffffffffff8111156113fb576113fa610eeb565b5b6114078582860161136e565b9150509250929050565b5f61141c838561106c565b9350611429838584610f9f565b61143283610e0a565b840190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061147b5761147a61143d565b5b50565b5f81905061148b8261146a565b919050565b5f61149a8261147e565b9050919050565b6114aa81611490565b82525050565b5f6060820190508181035f8301526114c9818789611411565b905081810360208301526114de818587611411565b90506114ed60408301846114a1565b9695505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f611551602683610dec565b915061155c826114f7565b604082019050919050565b5f6020820190508181035f83015261157e81611545565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff82169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6115f5826115b2565b9150611600836115b2565b9250828201905060ff811115611619576116186115be565b5b92915050565b7f496e76616c6964207369676e61747572650000000000000000000000000000005f82015250565b5f611653601183610dec565b915061165e8261161f565b602082019050919050565b5f6020820190508181035f83015261168081611647565b9050919050565b5f61169182610ea5565b9050919050565b6116a181611687565b81146116ab575f5ffd5b50565b5f815190506116bc81611698565b92915050565b5f602082840312156116d7576116d6610ee7565b5b5f6116e4848285016116ae565b91505092915050565b6116f681610e72565b8114611700575f5ffd5b50565b5f81519050611711816116ed565b92915050565b5f6020828403121561172c5761172b610ee7565b5b5f61173984828501611703565b91505092915050565b7f496e76616c6964207369676e65720000000000000000000000000000000000005f82015250565b5f611776600e83610dec565b915061178182611742565b602082019050919050565b5f6020820190508181035f8301526117a38161176a565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f6117de602083610dec565b91506117e9826117aa565b602082019050919050565b5f6020820190508181035f83015261180b816117d2565b9050919050565b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f611846601883610dec565b915061185182611812565b602082019050919050565b5f6020820190508181035f8301526118738161183a565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f6118ae601f83610dec565b91506118b98261187a565b602082019050919050565b5f6020820190508181035f8301526118db816118a2565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f61193c602283610dec565b9150611947826118e2565b604082019050919050565b5f6020820190508181035f83015261196981611930565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6119ca602283610dec565b91506119d582611970565b604082019050919050565b5f6020820190508181035f8301526119f7816119be565b9050919050565b611a0781611219565b82525050565b611a16816115b2565b82525050565b5f608082019050611a2f5f8301876119fe565b611a3c6020830186611a0d565b611a4960408301856119fe565b611a5660608301846119fe565b9594505050505056fea164736f6c634300081e000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_espressoTEEVerifier\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"},{\"name\":\"_teeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_nonTeeBatcher\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"activeIsTee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"authenticateBatchInfo\",\"inputs\":[{\"name\":\"commitment\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"espressoTEEVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIEspressoTEEVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"nonTeeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registerSigner\",\"inputs\":[{\"name\":\"attestationTbs\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"switchBatcher\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"teeBatcher\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"validBatchInfo\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false}]", + Bin: "0x60e060405234801561000f575f5ffd5b50604051611b25380380611b2583398181016040528101906100319190610358565b61004d6100426101f760201b60201c565b6101fe60201b60201c565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036100bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100b29061043c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610129576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610120906104ca565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff16815250508273ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508173ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff1681525050600160025f6101000a81548160ff0219169083151502179055506101ee816101fe60201b60201c565b505050506104e8565b5f33905090565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6102ec826102c3565b9050919050565b5f6102fd826102e2565b9050919050565b61030d816102f3565b8114610317575f5ffd5b50565b5f8151905061032881610304565b92915050565b610337816102e2565b8114610341575f5ffd5b50565b5f815190506103528161032e565b92915050565b5f5f5f5f608085870312156103705761036f6102bf565b5b5f61037d8782880161031a565b945050602061038e87828801610344565b935050604061039f87828801610344565b92505060606103b087828801610344565b91505092959194509250565b5f82825260208201905092915050565b7f426174636841757468656e74696361746f723a207a65726f20746565206261745f8201527f6368657200000000000000000000000000000000000000000000000000000000602082015250565b5f6104266024836103bc565b9150610431826103cc565b604082019050919050565b5f6020820190508181035f8301526104538161041a565b9050919050565b7f426174636841757468656e74696361746f723a207a65726f206e6f6e2d7465655f8201527f2062617463686572000000000000000000000000000000000000000000000000602082015250565b5f6104b46028836103bc565b91506104bf8261045a565b604082019050919050565b5f6020820190508181035f8301526104e1816104a8565b9050919050565b60805160a05160c0516115fe6105275f395f81816102ad0152818161043701526105b101525f61028901525f818161037401526106bd01526115fe5ff3fe608060405234801561000f575f5ffd5b50600436106100b2575f3560e01c8063bc347f471161006f578063bc347f4714610154578063d909ba7c1461015e578063f2fde38b1461017c578063f81f208314610198578063fa14fe6d146101c8578063fc619e41146101e6576100b2565b806354fd4d50146100b6578063715018a6146100d45780637877a9ed146100de5780638da5cb5b146100fc578063b1bd42851461011a578063ba58e82a14610138575b5f5ffd5b6100be610202565b6040516100cb9190610c6f565b60405180910390f35b6100dc61023b565b005b6100e661024e565b6040516100f39190610ca9565b60405180910390f35b610104610260565b6040516101119190610d01565b60405180910390f35b610122610287565b60405161012f9190610d01565b60405180910390f35b610152600480360381019061014d9190610d83565b6102ab565b005b61015c610340565b005b610166610372565b6040516101739190610d01565b60405180910390f35b61019660048036038101906101919190610e2b565b610396565b005b6101b260048036038101906101ad9190610e89565b610418565b6040516101bf9190610ca9565b60405180910390f35b6101d0610435565b6040516101dd9190610f0f565b60405180910390f35b61020060048036038101906101fb9190610f28565b610459565b005b6040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b61024361077c565b61024c5f6107fa565b565b60025f9054906101000a900460ff1681565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166335ecb4c18585858560016040518663ffffffff1660e01b815260040161030d959493929190611042565b5f604051808303815f87803b158015610324575f5ffd5b505af1158015610336573d5f5f3e3d5ffd5b5050505050505050565b61034861077c565b60025f9054906101000a900460ff161560025f6101000a81548160ff021916908315150217905550565b7f000000000000000000000000000000000000000000000000000000000000000081565b61039e61077c565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361040c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610403906110f9565b60405180910390fd5b610415816107fa565b50565b6001602052805f5260405f205f915054906101000a900460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b5f82828080601f0160208091040260200160405190810160405280939291908181526020018383808284375f81840152601f19601f8201169050808301925050505050505090505f816040815181106104b5576104b4611117565b5b602001015160f81c60f81b60f81c90505f8160ff1614806104d9575060018160ff16145b1561053457601b816104eb919061117d565b90508060f81b8260408151811061050557610504611117565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505b5f61053f86846108bb565b90505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036105af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a6906111fb565b60405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d80a4c286040518163ffffffff1660e01b8152600401602060405180830381865afa158015610618573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061063c9190611254565b73ffffffffffffffffffffffffffffffffffffffff16630123d0c1826040518263ffffffff1660e01b81526004016106749190610d01565b602060405180830381865afa15801561068f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b391906112a9565b15801561070c57507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b1561074c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107439061131e565b60405180910390fd5b6001805f8881526020019081526020015f205f6101000a81548160ff021916908315150217905550505050505050565b6107846108e0565b73ffffffffffffffffffffffffffffffffffffffff166107a2610260565b73ffffffffffffffffffffffffffffffffffffffff16146107f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ef90611386565b60405180910390fd5b565b5f5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f5f5f6108c885856108e7565b915091506108d581610933565b819250505092915050565b5f33905090565b5f5f6041835103610924575f5f5f602086015192506040860151915060608601515f1a905061091887828585610afe565b9450945050505061092c565b5f6002915091505b9250929050565b5f600481111561094657610945610fcf565b5b81600481111561095957610958610fcf565b5b0315610afb576001600481111561097357610972610fcf565b5b81600481111561098657610985610fcf565b5b036109c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109bd906113ee565b60405180910390fd5b600260048111156109da576109d9610fcf565b5b8160048111156109ed576109ec610fcf565b5b03610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2490611456565b60405180910390fd5b60036004811115610a4157610a40610fcf565b5b816004811115610a5457610a53610fcf565b5b03610a94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8b906114e4565b60405180910390fd5b600480811115610aa757610aa6610fcf565b5b816004811115610aba57610ab9610fcf565b5b03610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af190611572565b60405180910390fd5b5b50565b5f5f7f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0835f1c1115610b36575f600391509150610bf6565b601b8560ff1614158015610b4e5750601c8560ff1614155b15610b5f575f600491509150610bf6565b5f6001878787876040515f8152602001604052604051610b8294939291906115ae565b6020604051602081039080840390855afa158015610ba2573d5f5f3e3d5ffd5b5050506020604051035190505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610bee575f60019250925050610bf6565b805f92509250505b94509492505050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610c4182610bff565b610c4b8185610c09565b9350610c5b818560208601610c19565b610c6481610c27565b840191505092915050565b5f6020820190508181035f830152610c878184610c37565b905092915050565b5f8115159050919050565b610ca381610c8f565b82525050565b5f602082019050610cbc5f830184610c9a565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610ceb82610cc2565b9050919050565b610cfb81610ce1565b82525050565b5f602082019050610d145f830184610cf2565b92915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f840112610d4357610d42610d22565b5b8235905067ffffffffffffffff811115610d6057610d5f610d26565b5b602083019150836001820283011115610d7c57610d7b610d2a565b5b9250929050565b5f5f5f5f60408587031215610d9b57610d9a610d1a565b5b5f85013567ffffffffffffffff811115610db857610db7610d1e565b5b610dc487828801610d2e565b9450945050602085013567ffffffffffffffff811115610de757610de6610d1e565b5b610df387828801610d2e565b925092505092959194509250565b610e0a81610ce1565b8114610e14575f5ffd5b50565b5f81359050610e2581610e01565b92915050565b5f60208284031215610e4057610e3f610d1a565b5b5f610e4d84828501610e17565b91505092915050565b5f819050919050565b610e6881610e56565b8114610e72575f5ffd5b50565b5f81359050610e8381610e5f565b92915050565b5f60208284031215610e9e57610e9d610d1a565b5b5f610eab84828501610e75565b91505092915050565b5f819050919050565b5f610ed7610ed2610ecd84610cc2565b610eb4565b610cc2565b9050919050565b5f610ee882610ebd565b9050919050565b5f610ef982610ede565b9050919050565b610f0981610eef565b82525050565b5f602082019050610f225f830184610f00565b92915050565b5f5f5f60408486031215610f3f57610f3e610d1a565b5b5f610f4c86828701610e75565b935050602084013567ffffffffffffffff811115610f6d57610f6c610d1e565b5b610f7986828701610d2e565b92509250509250925092565b5f82825260208201905092915050565b828183375f83830152505050565b5f610fae8385610f85565b9350610fbb838584610f95565b610fc483610c27565b840190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6002811061100d5761100c610fcf565b5b50565b5f81905061101d82610ffc565b919050565b5f61102c82611010565b9050919050565b61103c81611022565b82525050565b5f6060820190508181035f83015261105b818789610fa3565b90508181036020830152611070818587610fa3565b905061107f6040830184611033565b9695505050505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f20615f8201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b5f6110e3602683610c09565b91506110ee82611089565b604082019050919050565b5f6020820190508181035f830152611110816110d7565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60ff82169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61118782611144565b915061119283611144565b9250828201905060ff8111156111ab576111aa611150565b5b92915050565b7f496e76616c6964207369676e61747572650000000000000000000000000000005f82015250565b5f6111e5601183610c09565b91506111f0826111b1565b602082019050919050565b5f6020820190508181035f830152611212816111d9565b9050919050565b5f61122382610ce1565b9050919050565b61123381611219565b811461123d575f5ffd5b50565b5f8151905061124e8161122a565b92915050565b5f6020828403121561126957611268610d1a565b5b5f61127684828501611240565b91505092915050565b61128881610c8f565b8114611292575f5ffd5b50565b5f815190506112a38161127f565b92915050565b5f602082840312156112be576112bd610d1a565b5b5f6112cb84828501611295565b91505092915050565b7f496e76616c6964207369676e65720000000000000000000000000000000000005f82015250565b5f611308600e83610c09565b9150611313826112d4565b602082019050919050565b5f6020820190508181035f830152611335816112fc565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f611370602083610c09565b915061137b8261133c565b602082019050919050565b5f6020820190508181035f83015261139d81611364565b9050919050565b7f45434453413a20696e76616c6964207369676e617475726500000000000000005f82015250565b5f6113d8601883610c09565b91506113e3826113a4565b602082019050919050565b5f6020820190508181035f830152611405816113cc565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e677468005f82015250565b5f611440601f83610c09565b915061144b8261140c565b602082019050919050565b5f6020820190508181035f83015261146d81611434565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f6114ce602283610c09565b91506114d982611474565b604082019050919050565b5f6020820190508181035f8301526114fb816114c2565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202776272076616c5f8201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b5f61155c602283610c09565b915061156782611502565b604082019050919050565b5f6020820190508181035f83015261158981611550565b9050919050565b61159981610e56565b82525050565b6115a881611144565b82525050565b5f6080820190506115c15f830187611590565b6115ce602083018661159f565b6115db6040830185611590565b6115e86060830184611590565b9594505050505056fea164736f6c634300081e000a", } // BatchAuthenticatorABI is the input ABI used to generate the binding from. @@ -233,38 +233,6 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) ActiveIsTee() (bool, return _BatchAuthenticator.Contract.ActiveIsTee(&_BatchAuthenticator.CallOpts) } -// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. -// -// Solidity: function decodeAttestationTbs(bytes attestation) view returns(bytes, bytes) -func (_BatchAuthenticator *BatchAuthenticatorCaller) DecodeAttestationTbs(opts *bind.CallOpts, attestation []byte) ([]byte, []byte, error) { - var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "decodeAttestationTbs", attestation) - - if err != nil { - return *new([]byte), *new([]byte), err - } - - out0 := *abi.ConvertType(out[0], new([]byte)).(*[]byte) - out1 := *abi.ConvertType(out[1], new([]byte)).(*[]byte) - - return out0, out1, err - -} - -// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. -// -// Solidity: function decodeAttestationTbs(bytes attestation) view returns(bytes, bytes) -func (_BatchAuthenticator *BatchAuthenticatorSession) DecodeAttestationTbs(attestation []byte) ([]byte, []byte, error) { - return _BatchAuthenticator.Contract.DecodeAttestationTbs(&_BatchAuthenticator.CallOpts, attestation) -} - -// DecodeAttestationTbs is a free data retrieval call binding the contract method 0xa903a277. -// -// Solidity: function decodeAttestationTbs(bytes attestation) view returns(bytes, bytes) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) DecodeAttestationTbs(attestation []byte) ([]byte, []byte, error) { - return _BatchAuthenticator.Contract.DecodeAttestationTbs(&_BatchAuthenticator.CallOpts, attestation) -} - // EspressoTEEVerifier is a free data retrieval call binding the contract method 0xfa14fe6d. // // Solidity: function espressoTEEVerifier() view returns(address) @@ -296,37 +264,6 @@ func (_BatchAuthenticator *BatchAuthenticatorCallerSession) EspressoTEEVerifier( return _BatchAuthenticator.Contract.EspressoTEEVerifier(&_BatchAuthenticator.CallOpts) } -// NitroValidator is a free data retrieval call binding the contract method 0x1b076a4c. -// -// Solidity: function nitroValidator() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCaller) NitroValidator(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _BatchAuthenticator.contract.Call(opts, &out, "nitroValidator") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// NitroValidator is a free data retrieval call binding the contract method 0x1b076a4c. -// -// Solidity: function nitroValidator() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorSession) NitroValidator() (common.Address, error) { - return _BatchAuthenticator.Contract.NitroValidator(&_BatchAuthenticator.CallOpts) -} - -// NitroValidator is a free data retrieval call binding the contract method 0x1b076a4c. -// -// Solidity: function nitroValidator() view returns(address) -func (_BatchAuthenticator *BatchAuthenticatorCallerSession) NitroValidator() (common.Address, error) { - return _BatchAuthenticator.Contract.NitroValidator(&_BatchAuthenticator.CallOpts) -} - // NonTeeBatcher is a free data retrieval call binding the contract method 0xb1bd4285. // // Solidity: function nonTeeBatcher() view returns(address) diff --git a/op-deployer/pkg/deployer/opcm/espresso.go b/op-deployer/pkg/deployer/opcm/espresso.go index d5c2dfef523..e0d0fe54b25 100644 --- a/op-deployer/pkg/deployer/opcm/espresso.go +++ b/op-deployer/pkg/deployer/opcm/espresso.go @@ -8,7 +8,8 @@ import ( ) type DeployAWSNitroVerifierInput struct { - EnclaveHash [32]byte + EnclaveHash [32]byte + NitroEnclaveVerifier common.Address } type DeployAWSNitroVerifierOutput struct { diff --git a/op-deployer/pkg/deployer/pipeline/espresso.go b/op-deployer/pkg/deployer/pipeline/espresso.go index 6b96c13d586..40499977e82 100644 --- a/op-deployer/pkg/deployer/pipeline/espresso.go +++ b/op-deployer/pkg/deployer/pipeline/espresso.go @@ -28,9 +28,32 @@ func DeployEspresso(env *Env, intent *state.Intent, st *state.State, chainID com } lgr.Info("deploying espresso contracts") + // read the nitro enclaver verifier address from environment variable, fallback to empty address + var nitroEnclaveVerifierAddress common.Address + if envVar := os.Getenv("NITRO_ENCLAVE_VERIFIER_ADDRESS"); envVar != "" { + nitroEnclaveVerifierAddress = common.HexToAddress(envVar) + lgr.Info("Using nitro enclave verifier address from NITRO_ENCLAVE_VERIFIER_ADDRESS env var", "address", nitroEnclaveVerifierAddress.Hex()) + } else { + lgr.Info("NITRO_ENCLAVE_VERIFIER_ADDRESS env var not set, using empty address") + fmt.Printf("Nitro enclave verifier address not set") + // this means we should deploy a mock verifier ( should only be used in dev / test environments + nitroEnclaveVerifierAddress = common.Address{} + } + + // get enclave hash from environment variable, fallback to zeroed hash + var enclaveHash [32]byte + if envVar := os.Getenv("ENCLAVE_HASH"); envVar != "" { + copy(enclaveHash[:], common.FromHex(envVar)) + lgr.Info("Using enclave hash from ENCLAVE_HASH env var", "hash", common.Bytes2Hex(enclaveHash[:])) + } else { + lgr.Info("ENCLAVE_HASH env var not set, using zeroed hash") + fmt.Printf("Enclave hash not set, using zeroed hash\n") + } + var nvo opcm.DeployAWSNitroVerifierOutput nvo, err = opcm.DeployAWSNitroVerifier(env.L1ScriptHost, opcm.DeployAWSNitroVerifierInput{ - EnclaveHash: [32]byte{}, + EnclaveHash: enclaveHash, + NitroEnclaveVerifier: nitroEnclaveVerifierAddress, }) if err != nil { return fmt.Errorf("failed to deploy nitro verifier contracts: %w", err) diff --git a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol index 619a35d10e1..7a3e2085300 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol @@ -1,16 +1,35 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.22; +pragma solidity ^0.8.0; -import { CertManager } from "@nitro-validator/CertManager.sol"; import { IEspressoNitroTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; import { EspressoNitroTEEVerifier } from "@espresso-tee-contracts/EspressoNitroTEEVerifier.sol"; import { BaseDeployIO } from "scripts/deploy/BaseDeployIO.sol"; import { Script } from "forge-std/Script.sol"; import { Solarray } from "scripts/libraries/Solarray.sol"; import { DeployUtils } from "scripts/libraries/DeployUtils.sol"; +import { INitroEnclaveVerifier } from "aws-nitro-enclave-attestation/interfaces/INitroEnclaveVerifier.sol"; + +contract MockEspressoNitroTEEVerifier is IEspressoNitroTEEVerifier { + constructor() { } + + function registeredSigners(address) external pure override returns (bool) { + return true; + } + + function registeredEnclaveHash(bytes32) external pure override returns (bool) { + return true; + } + + function registerSigner(bytes calldata, bytes calldata) external override { } + + function setEnclaveHash(bytes32, bool) external override { } + + function deleteRegisteredSigners(address[] memory) external override { } +} contract DeployAWSNitroVerifierInput is BaseDeployIO { bytes32 internal _enclaveHash; + address internal _nitroEnclaveVerifier; function set(bytes4 _sel, bytes32 _val) public { if (_sel == this.enclaveHash.selector) _enclaveHash = _val; @@ -18,9 +37,20 @@ contract DeployAWSNitroVerifierInput is BaseDeployIO { } function enclaveHash() public view returns (bytes32) { - require(_enclaveHash != 0, "DeployAWSNitroVerifierInput: enclaveHash not set"); return _enclaveHash; } + + function set(bytes4 _sel, address _val) public { + if (_sel == this.nitroEnclaveVerifier.selector) { + _nitroEnclaveVerifier = _val; + } else { + revert("DeployAWSNitroVerifierInput: unknown selector"); + } + } + + function nitroEnclaveVerifier() public view returns (address) { + return _nitroEnclaveVerifier; + } } contract DeployAWSNitroVerifierOutput is BaseDeployIO { @@ -43,34 +73,32 @@ contract DeployAWSNitroVerifierOutput is BaseDeployIO { contract DeployAWSNitroVerifier is Script { function run(DeployAWSNitroVerifierInput input, DeployAWSNitroVerifierOutput output) public { - CertManager manager = deployCertManager(); - deployNitroTEEVerifier(input, output, manager); + deployNitroTEEVerifier(input, output); checkOutput(output); } function deployNitroTEEVerifier( DeployAWSNitroVerifierInput input, - DeployAWSNitroVerifierOutput output, - CertManager certManager + DeployAWSNitroVerifierOutput output ) public returns (IEspressoNitroTEEVerifier) { - bytes32 enclaveHash = input.enclaveHash(); vm.broadcast(msg.sender); - IEspressoNitroTEEVerifier impl = new EspressoNitroTEEVerifier(enclaveHash, certManager); + bytes32 enclaveHash = input.enclaveHash(); + address nitroEnclaveVerifier = input.nitroEnclaveVerifier(); + + IEspressoNitroTEEVerifier impl; + if (nitroEnclaveVerifier == address(0)) { + impl = new MockEspressoNitroTEEVerifier(); + } else { + impl = new EspressoNitroTEEVerifier(enclaveHash, INitroEnclaveVerifier(nitroEnclaveVerifier)); + } vm.label(address(impl), "NitroTEEVerifierImpl"); output.set(output.nitroTEEVerifierAddress.selector, address(impl)); return impl; } - function deployCertManager() public returns (CertManager) { - vm.broadcast(msg.sender); - CertManager impl = new CertManager(); - vm.label(address(impl), "CertManagerImpl"); - return impl; - } - function checkOutput(DeployAWSNitroVerifierOutput output) public view { address[] memory addresses = Solarray.addresses(address(output.nitroTEEVerifierAddress())); DeployUtils.assertValidContractAddresses(addresses); diff --git a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol index 329c3b81405..77e76c95e38 100644 --- a/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol +++ b/packages/contracts-bedrock/src/L1/BatchAuthenticator.sol @@ -1,12 +1,10 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {ISemver} from "interfaces/universal/ISemver.sol"; -import { - IEspressoTEEVerifier -} from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; +import { ECDSA } from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; +import { ISemver } from "interfaces/universal/ISemver.sol"; +import { IEspressoTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; contract BatchAuthenticator is ISemver, Ownable { /// @notice Semantic version. @@ -33,15 +31,11 @@ contract BatchAuthenticator is ISemver, Ownable { address _teeBatcher, address _nonTeeBatcher, address _owner - ) Ownable() { - require( - _teeBatcher != address(0), - "BatchAuthenticator: zero tee batcher" - ); - require( - _nonTeeBatcher != address(0), - "BatchAuthenticator: zero non-tee batcher" - ); + ) + Ownable() + { + require(_teeBatcher != address(0), "BatchAuthenticator: zero tee batcher"); + require(_nonTeeBatcher != address(0), "BatchAuthenticator: zero non-tee batcher"); espressoTEEVerifier = _espressoTEEVerifier; teeBatcher = _teeBatcher; @@ -56,10 +50,7 @@ contract BatchAuthenticator is ISemver, Ownable { activeIsTee = !activeIsTee; } - function authenticateBatchInfo( - bytes32 commitment, - bytes calldata _signature - ) external { + function authenticateBatchInfo(bytes32 commitment, bytes calldata _signature) external { // https://github.com/ethereum/go-ethereum/issues/19751#issuecomment-504900739 bytes memory signature = _signature; uint8 v = uint8(signature[64]); @@ -73,25 +64,14 @@ contract BatchAuthenticator is ISemver, Ownable { revert("Invalid signature"); } - if ( - !espressoTEEVerifier.espressoNitroTEEVerifier().registeredSigners( - signer - ) && signer != teeBatcher - ) { + if (!espressoTEEVerifier.espressoNitroTEEVerifier().registeredSigners(signer) && signer != teeBatcher) { revert("Invalid signer"); } validBatchInfo[commitment] = true; } - function registerSigner( - bytes calldata attestationTbs, - bytes calldata signature - ) external { - espressoTEEVerifier.registerSigner( - attestationTbs, - signature, - IEspressoTEEVerifier.TeeType.NITRO - ); + function registerSigner(bytes calldata attestationTbs, bytes calldata signature) external { + espressoTEEVerifier.registerSigner(attestationTbs, signature, IEspressoTEEVerifier.TeeType.NITRO); } } diff --git a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol index 1cbcb49907c..541f0765fea 100644 --- a/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol +++ b/packages/contracts-bedrock/test/L1/BatchAuthenticator.t.sol @@ -2,43 +2,30 @@ pragma solidity ^0.8.0; // Testing -import {Test} from "forge-std/Test.sol"; +import { Test } from "forge-std/Test.sol"; // Contracts -import {BatchAuthenticator} from "src/L1/BatchAuthenticator.sol"; -import { - IEspressoTEEVerifier -} from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; -import { - IEspressoNitroTEEVerifier -} from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; -import { - IEspressoSGXTEEVerifier -} from "@espresso-tee-contracts/interface/IEspressoSGXTEEVerifier.sol"; +import { BatchAuthenticator } from "src/L1/BatchAuthenticator.sol"; +import { IEspressoTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; +import { IEspressoNitroTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoNitroTEEVerifier.sol"; +import { IEspressoSGXTEEVerifier } from "@espresso-tee-contracts/interface/IEspressoSGXTEEVerifier.sol"; contract MockNitroTEEVerifier is IEspressoNitroTEEVerifier { mapping(address => bool) private _registeredSigners; - function registeredSigners( - address signer - ) external view override returns (bool) { + function registeredSigners(address signer) external view override returns (bool) { return _registeredSigners[signer]; } - function registeredEnclaveHash( - bytes32 - ) external pure override returns (bool) { + function registeredEnclaveHash(bytes32) external pure override returns (bool) { return false; } - function registerSigner( - bytes calldata, - bytes calldata - ) external pure override {} + function registerSigner(bytes calldata, bytes calldata) external pure override { } - function setEnclaveHash(bytes32, bool) external pure override {} + function setEnclaveHash(bytes32, bool) external pure override { } - function deleteRegisteredSigners(address[] memory) external pure override {} + function deleteRegisteredSigners(address[] memory) external pure override { } // Test helper function setRegisteredSigner(address signer, bool value) external { @@ -55,61 +42,33 @@ contract MockEspressoTEEVerifier is IEspressoTEEVerifier { sgx = IEspressoSGXTEEVerifier(address(0)); } - function espressoNitroTEEVerifier() - external - view - override - returns (IEspressoNitroTEEVerifier) - { + function espressoNitroTEEVerifier() external view override returns (IEspressoNitroTEEVerifier) { return nitro; } - function espressoSGXTEEVerifier() - external - view - override - returns (IEspressoSGXTEEVerifier) - { + function espressoSGXTEEVerifier() external view override returns (IEspressoSGXTEEVerifier) { return sgx; } - function verify( - bytes memory, - bytes32, - TeeType - ) external pure override returns (bool) { + function verify(bytes memory, bytes32, TeeType) external pure override returns (bool) { return true; } - function registerSigner( - bytes calldata, - bytes calldata, - TeeType - ) external pure override {} + function registerSigner(bytes calldata, bytes calldata, TeeType) external pure override { } - function registeredSigners( - address, - TeeType - ) external pure override returns (bool) { + function registeredSigners(address, TeeType) external pure override returns (bool) { return false; } - function registeredEnclaveHashes( - bytes32, - TeeType - ) external pure override returns (bool) { + function registeredEnclaveHashes(bytes32, TeeType) external pure override returns (bool) { return false; } - function setEspressoSGXTEEVerifier( - IEspressoSGXTEEVerifier _sgx - ) external override { + function setEspressoSGXTEEVerifier(IEspressoSGXTEEVerifier _sgx) external override { sgx = _sgx; } - function setEspressoNitroTEEVerifier( - IEspressoNitroTEEVerifier _nitro - ) external override { + function setEspressoNitroTEEVerifier(IEspressoNitroTEEVerifier _nitro) external override { nitro = _nitro; } } @@ -132,12 +91,8 @@ contract BatchAuthenticator_SwitchBatcher_Test is Test { teeVerifier = new MockEspressoTEEVerifier(nitroVerifier); vm.prank(deployer); - authenticator = new BatchAuthenticator( - IEspressoTEEVerifier(address(teeVerifier)), - teeBatcher, - nonTeeBatcher, - deployer - ); + authenticator = + new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, nonTeeBatcher, deployer); } /// @notice Test that only the owner can switch the active batcher @@ -146,11 +101,7 @@ contract BatchAuthenticator_SwitchBatcher_Test is Test { vm.startPrank(deployer); bool initialIsTee = authenticator.activeIsTee(); authenticator.switchBatcher(); - assertEq( - authenticator.activeIsTee(), - !initialIsTee, - "owner should be able to switch batcher" - ); + assertEq(authenticator.activeIsTee(), !initialIsTee, "owner should be able to switch batcher"); vm.stopPrank(); // Non-owner cannot switch batcher. @@ -176,31 +127,17 @@ contract BatchAuthenticator_Constructor_Test is Test { function test_constructor_revertsWhenTeeBatcherIsZero() external { vm.expectRevert("BatchAuthenticator: zero tee batcher"); - new BatchAuthenticator( - IEspressoTEEVerifier(address(teeVerifier)), - address(0), - nonTeeBatcher, - owner - ); + new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), address(0), nonTeeBatcher, owner); } function test_constructor_revertsWhenNonTeeBatcherIsZero() external { vm.expectRevert("BatchAuthenticator: zero non-tee batcher"); - new BatchAuthenticator( - IEspressoTEEVerifier(address(teeVerifier)), - teeBatcher, - address(0), - owner - ); + new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, address(0), owner); } function test_constructor_succeedsWithValidAddresses() external { - BatchAuthenticator authenticator = new BatchAuthenticator( - IEspressoTEEVerifier(address(teeVerifier)), - teeBatcher, - nonTeeBatcher, - owner - ); + BatchAuthenticator authenticator = + new BatchAuthenticator(IEspressoTEEVerifier(address(teeVerifier)), teeBatcher, nonTeeBatcher, owner); assertEq(authenticator.teeBatcher(), teeBatcher); assertEq(authenticator.nonTeeBatcher(), nonTeeBatcher); } From 854f4a7ed0aa670ccb05314f0b0d6404828351c1 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Mon, 8 Dec 2025 17:52:26 -0800 Subject: [PATCH 09/33] add support for attestation verifier service --- espresso/docker-compose.yml | 5 +- .../environment/espresso_docker_helpers.go | 9 +++- .../optitmism_espresso_test_helpers.go | 54 +++++++++++++++++-- .../contracts-bedrock/src/L1/BatchInbox.sol | 2 +- 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 168883717e5..2cda18d01db 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -359,7 +359,8 @@ services: condition: service_healthy l2-genesis: condition: service_completed_successfully - + attestation-service-zk: + condition: service_started environment: L1_RPC: http://l1-geth:${L1_HTTP_PORT} OP_BATCHER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT} @@ -419,6 +420,8 @@ services: condition: service_started l2-genesis: condition: service_completed_successfully + attestation-service-zk: + condition: service_started network_mode: "host" environment: http_proxy: http://127.0.0.1:3128 diff --git a/espresso/environment/espresso_docker_helpers.go b/espresso/environment/espresso_docker_helpers.go index 063ffce89cc..10318283392 100644 --- a/espresso/environment/espresso_docker_helpers.go +++ b/espresso/environment/espresso_docker_helpers.go @@ -44,8 +44,9 @@ type DockerContainerConfig struct { Ports []string - Network string - AutoRM bool + Network string + AutoRM bool + Platform string } // DockerBuildArg is a configuration struct that is used to pass @@ -91,6 +92,10 @@ func (d *DockerCli) LaunchContainer(ctx context.Context, config DockerContainerC args = append(args, "-p", port) } } + // Add platform support + if config.Platform != "" { + args = append(args, "--platform", config.Platform) + } for key, value := range config.Environment { args = append(args, "-e", key+"="+value) diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index aba11f3efcb..bf2d2a369be 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -74,6 +74,17 @@ const ESPRESSO_BUILDER_PORT = "31003" const ESPRESSO_SEQUENCER_API_PORT = "24000" const ESPRESSO_DEV_NODE_PORT = "24002" +const ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE = "ghcr.io/espressosystems/attestation-verifier-zk:sha-146d85a" +const ATTESTATION_VERIFIER_ZK_SERVER_PORT = "8080" +const SP1_PROVER = "mock" +const NETWORK_RPC_URL = "https://rpc.mainnet.succinct.xyz" +const NETWORK_PRIVATE_KEY = "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" // Default Hardhat Key +const NITRO_VERIFIER_ADDRESS = "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" +const USE_DOCKER = "1" +const SKIP_TIME_VALIDITY_CHECK = "true" +const RUST_LOG = "info" +const RPC_URL = "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" + // ErrEspressoBlockHeightDidNotIncrease is a sentinel error that occurs when // the Espresso Block Height does not increase within the alloted context // allowance. @@ -345,7 +356,7 @@ func (l *EspressoDevNodeLauncherDocker) GetE2eDevnetWithFaultDisputeSysConfig(ct func (l *EspressoDevNodeLauncherDocker) GetE2eDevnetStartOptions(originalCtx context.Context, t *testing.T, sysConfig *e2esys.SystemConfig, options ...E2eDevnetLauncherOption) ([]e2esys.StartOption, *E2eDevnetLauncherContext) { initialOptions := []E2eDevnetLauncherOption{ allowHostDockerInternalVirtualHost(), - launchEspressoDevNodeDocker(), + launchEspressoDevNodeAndAttestationServiceDocker(), } if l.EnclaveBatcher { @@ -801,10 +812,11 @@ func ensureHardCodedPortsAreMappedFromTheirOriginalValues(containerInfo *DockerC } } -// launchEspressoDevNodeDocker is E2eDevnetLauncherOption that launches th +// launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches th // Espresso Dev Node within a Docker container. It also ensures that the // Espresso Dev Node is actively producing blocks before returning. -func launchEspressoDevNodeStartOption(ct *E2eDevnetLauncherContext) e2esys.StartOption { +// Additionally, it launches the Attestation Verifier ZK server in a Docker container. +func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLauncherContext) e2esys.StartOption { return e2esys.StartOption{ Role: "launch-espresso-dev-node", BatcherMod: func(c *batcher.CLIConfig, sys *e2esys.System) { @@ -867,6 +879,38 @@ func launchEspressoDevNodeStartOption(ct *E2eDevnetLauncherContext) e2esys.Start c.Espresso.QueryServiceURLs = espressoDevNode.espressoUrls c.LogConfig.Level = slog.LevelDebug c.Espresso.LightClientAddr = common.HexToAddress(ESPRESSO_LIGHT_CLIENT_ADDRESS) + + // Now we need to launch the attestation verifier zk server + fmt.Printf("launching attestation verifier service") + dockerConfig = DockerContainerConfig{ + Image: ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE, + Network: determineDockerNetworkMode(), + Ports: []string{ + ATTESTATION_VERIFIER_ZK_SERVER_PORT, + }, + Platform: "linux/amd64", + Environment: map[string]string{ + "NETWORK_RPC_URL": NETWORK_RPC_URL, + "SP1_PROVER": SP1_PROVER, + "NITRO_VERIFIER_ADDRESS": NITRO_VERIFIER_ADDRESS, + "USE_DOCKER": USE_DOCKER, + "SKIP_TIME_VALIDITY_CHECK": SKIP_TIME_VALIDITY_CHECK, + "RUST_LOG": RUST_LOG, + "NETWORK_PRIVATE_KEY": NETWORK_PRIVATE_KEY, + "RPC_URL": RPC_URL, + }, + } + containerCli = new(DockerCli) + + _, err = containerCli.LaunchContainer(ct.Ctx, dockerConfig) + if err != nil { + fmt.Printf("failed to start the container: %v", err) + ct.Error = FailedToLaunchDockerContainer{Cause: err} + return + } + // url pf the attestation verifier zk server + c.Espresso.EspressoAttestationService = "http://localhost:" + ATTESTATION_VERIFIER_ZK_SERVER_PORT + }, } @@ -875,11 +919,11 @@ func launchEspressoDevNodeStartOption(ct *E2eDevnetLauncherContext) e2esys.Start // launchEspressoDevNodeDocker is E2eDevnetLauncherOption that launches th // Espresso Dev Node within a Docker container. It also ensures that the // Espresso Dev Node is actively producing blocks before returning. -func launchEspressoDevNodeDocker() E2eDevnetLauncherOption { +func launchEspressoDevNodeAndAttestationServiceDocker() E2eDevnetLauncherOption { return func(ct *E2eDevnetLauncherContext) E2eSystemOption { return E2eSystemOption{ StartOptions: []e2esys.StartOption{ - launchEspressoDevNodeStartOption(ct), + launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct), }, } } diff --git a/packages/contracts-bedrock/src/L1/BatchInbox.sol b/packages/contracts-bedrock/src/L1/BatchInbox.sol index d5b7e30f660..3402a629ad7 100644 --- a/packages/contracts-bedrock/src/L1/BatchInbox.sol +++ b/packages/contracts-bedrock/src/L1/BatchInbox.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.24; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { IBatchAuthenticator } from "interfaces/L1/IBatchAuthenticator.sol"; From f80b5b171534d9c0b1e919ea95560ea18dda1f1a Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 07:48:06 -0800 Subject: [PATCH 10/33] fix tee tests --- espresso/docker-compose.yml | 1 + espresso/docker/op-batcher-tee/run-enclave.sh | 3 +++ espresso/environment/new.txt | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 espresso/environment/new.txt diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 2cda18d01db..288912f2cb7 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -449,6 +449,7 @@ services: export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}" export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}" + export ATTESTATION_SERVICE_URL="http://localhost:8080" /source/espresso/docker/op-batcher-tee/run-enclave.sh # Legacy op-proposer (for non-succinct mode) diff --git a/espresso/docker/op-batcher-tee/run-enclave.sh b/espresso/docker/op-batcher-tee/run-enclave.sh index ccc98397114..31c98e7647d 100755 --- a/espresso/docker/op-batcher-tee/run-enclave.sh +++ b/espresso/docker/op-batcher-tee/run-enclave.sh @@ -10,6 +10,7 @@ set -e : ${ROLLUP_RPC_URL:?Error: ROLLUP_RPC_URL is required} : ${ESPRESSO_URL1:?Error: ESPRESSO_URL1 is required} : ${OPERATOR_PRIVATE_KEY:?Error: OPERATOR_PRIVATE_KEY is required} +: ${ATTESTATION_SERVICE_URL:?Error: ATTESTATION_SERVICE_URL is required} # Optional configuration with defaults TAG="${TAG:-op-batcher-enclavetool}" @@ -28,6 +29,7 @@ echo "L1 RPC URL: $L1_RPC_URL" echo "L2 RPC URL: $L2_RPC_URL" echo "Rollup RPC URL: $ROLLUP_RPC_URL" echo "Espresso URLs: $ESPRESSO_URL1, $ESPRESSO_URL2" +echo "Attestation service url: $ATTESTATION_SERVICE_URL" echo "Debug Mode: $ENCLAVE_DEBUG" echo "Monitor Interval: $MONITOR_INTERVAL seconds" echo "Memory: ${MEMORY_MB}MB" @@ -48,6 +50,7 @@ BATCHER_ARGS="$BATCHER_ARGS,--max-channel-duration=1" BATCHER_ARGS="$BATCHER_ARGS,--target-num-frames=1" BATCHER_ARGS="$BATCHER_ARGS,--espresso.fetch-api=true" BATCHER_ARGS="$BATCHER_ARGS,--espresso.light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797" +BATCHER_ARGS="$BATCHER_ARGS,--espresso.espresso-attestation-service=$ATTESTATION_SERVICE_URL" # Add debug arguments if enabled if [ "$ENCLAVE_DEBUG" = "true" ]; then diff --git a/espresso/environment/new.txt b/espresso/environment/new.txt new file mode 100644 index 00000000000..3755f8d8792 --- /dev/null +++ b/espresso/environment/new.txt @@ -0,0 +1,5 @@ +- Check that docker compose down also shuts down attestation veifier service +- Check that you can add tests for contracts +- check that the docker compose yml you edited has some effect? Basically use it in some test +and see if it works +- Also add a test in go code, is it going to be part of devnet tests? unit tests? From 6472c74b0b00e905513172599bd261af035f1a5d Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 07:50:58 -0800 Subject: [PATCH 11/33] use higher version of github runner --- .github/workflows/espresso-integration.yaml | 2 +- espresso/environment/new.txt | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 espresso/environment/new.txt diff --git a/.github/workflows/espresso-integration.yaml b/.github/workflows/espresso-integration.yaml index 9f33765b873..b7d0c9363c8 100644 --- a/.github/workflows/espresso-integration.yaml +++ b/.github/workflows/espresso-integration.yaml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04-8core strategy: fail-fast: false matrix: diff --git a/espresso/environment/new.txt b/espresso/environment/new.txt deleted file mode 100644 index 3755f8d8792..00000000000 --- a/espresso/environment/new.txt +++ /dev/null @@ -1,5 +0,0 @@ -- Check that docker compose down also shuts down attestation veifier service -- Check that you can add tests for contracts -- check that the docker compose yml you edited has some effect? Basically use it in some test -and see if it works -- Also add a test in go code, is it going to be part of devnet tests? unit tests? From 582de40cdd21a2bdfa8a07cf7c48d595bfd80622 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 08:32:54 -0800 Subject: [PATCH 12/33] fix tee args --- espresso/cli.go | 7 +++++++ espresso/environment/enclave_helpers.go | 2 +- op-batcher/enclave-entrypoint.bash | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/espresso/cli.go b/espresso/cli.go index 6d3e7d9a14b..9a4a24a9fe9 100644 --- a/espresso/cli.go +++ b/espresso/cli.go @@ -36,6 +36,7 @@ var ( OriginHeight = espressoFlags("origin-height") NamespaceFlagName = espressoFlags("namespace") RollupL1UrlFlagName = espressoFlags("rollup-l1-url") + AttestationServiceFlagName = espressoFlags("espresso-attestation-service") ) func CLIFlags(envPrefix string, category string) []cli.Flag { @@ -103,6 +104,12 @@ func CLIFlags(envPrefix string, category string) []cli.Flag { EnvVars: espressoEnvs(envPrefix, "ROLLUP_L1_URL"), Category: category, }, + &cli.StringFlag{ + Name: AttestationServiceFlagName, + Usage: "URL of the Espresso attestation service", + EnvVars: espressoEnvs(envPrefix, "ESPRESSO_ATTESTATION_SERVICE"), + Category: category, + }, } } diff --git a/espresso/environment/enclave_helpers.go b/espresso/environment/enclave_helpers.go index 03abbde8b01..781b3318500 100644 --- a/espresso/environment/enclave_helpers.go +++ b/espresso/environment/enclave_helpers.go @@ -182,7 +182,7 @@ func LaunchBatcherInEnclave() E2eDevnetLauncherOption { for _, url := range c.Espresso.QueryServiceURLs { appendArg(&args, espresso.QueryServiceUrlsFlagName, url) } - + appendArg(&args, espresso.AttestationServiceFlagName, c.Espresso.EspressoAttestationService) err := SetupEnclaver(ct.Ctx, sys, args...) if err != nil { panic(fmt.Sprintf("failed to setup enclaver: %v", err)) diff --git a/op-batcher/enclave-entrypoint.bash b/op-batcher/enclave-entrypoint.bash index b921883ed6a..1d88cc63678 100644 --- a/op-batcher/enclave-entrypoint.bash +++ b/op-batcher/enclave-entrypoint.bash @@ -150,8 +150,8 @@ launch_socat() { } # URL argument regex pattern -URL_ARG_RE='^(--altda\.da-server|--espresso\.urls|--espresso\.l1-url|--espresso\.rollup-l1-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)(=|$)' - +# Line 156 +URL_ARG_RE='^(--altda\.da-server|--espresso\.attestation-service|--espresso\.urls|--espresso\.l1-url|--espresso\.rollup-l1-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)(=|$)' # Process all arguments filtered_args=() url_args=() From 69efedf454ac066fcf859fe847128a644b487954 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 09:45:40 -0800 Subject: [PATCH 13/33] fix tee args --- espresso/cli.go | 15 ++++++++------- espresso/docker-compose.yml | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/espresso/cli.go b/espresso/cli.go index 9a4a24a9fe9..e0dff2e066c 100644 --- a/espresso/cli.go +++ b/espresso/cli.go @@ -154,13 +154,14 @@ func (c CLIConfig) Check() error { func ReadCLIConfig(c *cli.Context) CLIConfig { config := CLIConfig{ - Enabled: c.Bool(EnabledFlagName), - PollInterval: c.Duration(PollIntervalFlagName), - UseFetchAPI: c.Bool(UseFetchApiFlagName), - L1URL: c.String(L1UrlFlagName), - RollupL1URL: c.String(RollupL1UrlFlagName), - Namespace: c.Uint64(NamespaceFlagName), - OriginHeight: c.Uint64(OriginHeight), + Enabled: c.Bool(EnabledFlagName), + PollInterval: c.Duration(PollIntervalFlagName), + UseFetchAPI: c.Bool(UseFetchApiFlagName), + L1URL: c.String(L1UrlFlagName), + RollupL1URL: c.String(RollupL1UrlFlagName), + Namespace: c.Uint64(NamespaceFlagName), + OriginHeight: c.Uint64(OriginHeight), + EspressoAttestationService: c.String(AttestationServiceFlagName), } config.QueryServiceURLs = c.StringSlice(QueryServiceUrlsFlagName) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 45a061090c0..cf9a98e7e40 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -431,6 +431,7 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} + ATTESTATION_SERVICE_URL: "http://localhost:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro From e2383514da4535b4dbb3e6f7f8d38fbcce69b6b6 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 10:19:01 -0800 Subject: [PATCH 14/33] add healthcheck to attestation verifier zk --- espresso/docker-compose.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index cf9a98e7e40..c9bc2c65dda 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -360,7 +360,7 @@ services: l2-genesis: condition: service_completed_successfully attestation-service-zk: - condition: service_started + condition: service_healthy environment: L1_RPC: http://l1-geth:${L1_HTTP_PORT} OP_BATCHER_L1_ETH_RPC: http://l1-geth:${L1_HTTP_PORT} @@ -421,7 +421,7 @@ services: l2-genesis: condition: service_completed_successfully attestation-service-zk: - condition: service_started + condition: service_healthy network_mode: "host" environment: http_proxy: http://127.0.0.1:3128 @@ -431,7 +431,7 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} - ATTESTATION_SERVICE_URL: "http://localhost:8080" + ATTESTATION_SERVICE_URL: "http://attestation-service-zk:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro @@ -450,7 +450,7 @@ services: export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}" export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}" - export ATTESTATION_SERVICE_URL="http://localhost:8080" + export ATTESTATION_SERVICE_URL="http://attestation-service-zk:8080" /source/espresso/docker/op-batcher-tee/run-enclave.sh # Legacy op-proposer (for non-succinct mode) @@ -637,6 +637,12 @@ services: attestation-service-zk: image: ghcr.io/espressosystems/attestation-verifier-zk:sha-146d85a platform: linux/amd64 + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:8080/ || exit 1"] + interval: 5s + timeout: 3s + retries: 10 + start_period: 30s environment: # This is a demo private key for tests, it doesnt contain any funds NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" From 171349aab5234fd982e8e81e08bfd33078b57f6d Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 10:26:20 -0800 Subject: [PATCH 15/33] increase timeout --- espresso/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index c9bc2c65dda..b6e1f0f591b 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -640,7 +640,7 @@ services: healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8080/ || exit 1"] interval: 5s - timeout: 3s + timeout: 60s retries: 10 start_period: 30s environment: From 078f029e54086769c8189a6f782c96385d1c32c8 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 15:48:17 -0800 Subject: [PATCH 16/33] Invalid attestation test passing --- espresso/docker-compose.yml | 12 +++-- .../5_batch_authentication_test.go | 5 +- .../environment/espresso_docker_helpers.go | 5 ++ .../optitmism_espresso_test_helpers.go | 50 +++++++++++++++++-- 4 files changed, 59 insertions(+), 13 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index b6e1f0f591b..ff164878d99 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -635,14 +635,14 @@ services: restart: unless-stopped attestation-service-zk: - image: ghcr.io/espressosystems/attestation-verifier-zk:sha-146d85a + image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 platform: linux/amd64 healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:8080/ || exit 1"] - interval: 5s - timeout: 60s + test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + interval: 500s + timeout: 300s retries: 10 - start_period: 30s + start_period: 300s environment: # This is a demo private key for tests, it doesnt contain any funds NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" @@ -653,6 +653,8 @@ services: USE_DOCKER: "1" SKIP_TIME_VALIDITY_CHECK: "true" RUST_LOG: "info" + HOST: "0.0.0.0" + PORT: "8080" espresso-dev-node: image: ${ESPRESSO_DEV_NODE_IMAGE} diff --git a/espresso/environment/5_batch_authentication_test.go b/espresso/environment/5_batch_authentication_test.go index 01c31f664e2..9de1fe49e11 100644 --- a/espresso/environment/5_batch_authentication_test.go +++ b/espresso/environment/5_batch_authentication_test.go @@ -18,10 +18,6 @@ import ( // when provided with an invalid attestation. This test ensures that the batch inbox contract // properly validates attestations func TestE2eDevnetWithInvalidAttestation(t *testing.T) { - // Sishan TODO: this test is skipped now as we skip the attestation verification, should be restored after https://app.asana.com/1/1208976916964769/project/1209976130071762/task/1211868671079203?focus=true - // Related task: https://app.asana.com/1/1208976916964769/project/1209976130071762/task/1212349352131215?focus=true - t.Skip("skipping E2E invalid attestation test for now as we skip the attestation verification, should be restored after zk verification added.") - ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -67,6 +63,7 @@ func TestE2eDevnetWithInvalidAttestation(t *testing.T) { // TestE2eDevnetWithUnattestedBatcherKey verifies that when a batcher key is not properly // attested, the L2 chain can still produce unsafe blocks but cannot progress to safe L2 blocks. func TestE2eDevnetWithUnattestedBatcherKey(t *testing.T) { + t.Skip("skip for now") ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/espresso/environment/espresso_docker_helpers.go b/espresso/environment/espresso_docker_helpers.go index 10318283392..294596c69fc 100644 --- a/espresso/environment/espresso_docker_helpers.go +++ b/espresso/environment/espresso_docker_helpers.go @@ -47,6 +47,7 @@ type DockerContainerConfig struct { Network string AutoRM bool Platform string + Name string } // DockerBuildArg is a configuration struct that is used to pass @@ -97,6 +98,10 @@ func (d *DockerCli) LaunchContainer(ctx context.Context, config DockerContainerC args = append(args, "--platform", config.Platform) } + if config.Name != "" { + args = append(args, "--name", config.Name) + } + for key, value := range config.Environment { args = append(args, "-e", key+"="+value) } diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index bf2d2a369be..12203c7fd74 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -74,7 +74,7 @@ const ESPRESSO_BUILDER_PORT = "31003" const ESPRESSO_SEQUENCER_API_PORT = "24000" const ESPRESSO_DEV_NODE_PORT = "24002" -const ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE = "ghcr.io/espressosystems/attestation-verifier-zk:sha-146d85a" +const ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE = "ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3" const ATTESTATION_VERIFIER_ZK_SERVER_PORT = "8080" const SP1_PROVER = "mock" const NETWORK_RPC_URL = "https://rpc.mainnet.succinct.xyz" @@ -888,6 +888,7 @@ func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLaunc Ports: []string{ ATTESTATION_VERIFIER_ZK_SERVER_PORT, }, + Name: "attestation-verifier-zk", Platform: "linux/amd64", Environment: map[string]string{ "NETWORK_RPC_URL": NETWORK_RPC_URL, @@ -898,19 +899,60 @@ func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLaunc "RUST_LOG": RUST_LOG, "NETWORK_PRIVATE_KEY": NETWORK_PRIVATE_KEY, "RPC_URL": RPC_URL, + "HOST": "0.0.0.0", + "PORT": "8080", }, } containerCli = new(DockerCli) - _, err = containerCli.LaunchContainer(ct.Ctx, dockerConfig) + attestationVerifierInfo, err := containerCli.LaunchContainer(ct.Ctx, dockerConfig) if err != nil { fmt.Printf("failed to start the container: %v", err) ct.Error = FailedToLaunchDockerContainer{Cause: err} return } - // url pf the attestation verifier zk server - c.Espresso.EspressoAttestationService = "http://localhost:" + ATTESTATION_VERIFIER_ZK_SERVER_PORT + // Get the actual mapped port + ports := attestationVerifierInfo.PortMap[ATTESTATION_VERIFIER_ZK_SERVER_PORT] + if len(ports) == 0 { + ct.Error = fmt.Errorf("no port mapping found for attestation verifier") + return + } + + healthCheckCtx, cancel := context.WithTimeout(ct.Ctx, 60*time.Second) + defer cancel() + + ticker := time.NewTicker(500 * time.Millisecond) + defer ticker.Stop() + attestationHostPort, err := getContainerRemappedHostPort(ports[0]) + if err != nil { + ct.Error = err + return + } + + // Use the actual host:port for health check + attestationURL := "http://" + attestationHostPort + + // url pf the attestation verifier zk server + c.Espresso.EspressoAttestationService = attestationURL + + for { + select { + case <-healthCheckCtx.Done(): + ct.Error = fmt.Errorf("attestation verifier did not become healthy: %w", healthCheckCtx.Err()) + return + case <-ticker.C: + resp, err := http.Get(attestationURL + "/health") + if err == nil && resp.StatusCode == http.StatusOK { + resp.Body.Close() + goto healthy + } + if resp != nil { + resp.Body.Close() + } + } + } + healthy: }, } From c6ef14f11da0c0b97a757ef6d0e331205809d5ec Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 17:31:48 -0800 Subject: [PATCH 17/33] small fixes --- espresso/docker-compose.yml | 4 ++-- espresso/environment/espresso_docker_helpers.go | 7 +++++++ op-batcher/batcher/espresso.go | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index ff164878d99..cfd2e1a9a67 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -431,7 +431,7 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} - ATTESTATION_SERVICE_URL: "http://attestation-service-zk:8080" + ATTESTATION_SERVICE_URL: "http://localhost:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro @@ -450,7 +450,7 @@ services: export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}" export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}" - export ATTESTATION_SERVICE_URL="http://attestation-service-zk:8080" + export ATTESTATION_SERVICE_URL="http://localhost:8080" /source/espresso/docker/op-batcher-tee/run-enclave.sh # Legacy op-proposer (for non-succinct mode) diff --git a/espresso/environment/espresso_docker_helpers.go b/espresso/environment/espresso_docker_helpers.go index 294596c69fc..89368c715e7 100644 --- a/espresso/environment/espresso_docker_helpers.go +++ b/espresso/environment/espresso_docker_helpers.go @@ -73,6 +73,13 @@ func (d *DockerCli) LaunchContainer(ctx context.Context, config DockerContainerC ctx, cancel := context.WithCancel(ctx) defer cancel() + // Remove existing container with the same name if it exists + if config.Name != "" { + // Try to remove the container, ignore errors if it doesn't exist + removeCmd := exec.CommandContext(ctx, "docker", "rm", "-f", config.Name) + _ = removeCmd.Run() // Ignore errors - container might not exist + } + outputBuffer := new(bytes.Buffer) var args []string // Let's build the arguments for the docker launch command diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 0d24946a576..742c9867f07 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -974,19 +974,23 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { attestationDocBytes, err := json.Marshal(l.Attestation.Document) if err != nil { + l.Log.Error("failed to marshal attestation document", "err", err) return fmt.Errorf("failed to marshal attestation document: %w", err) } onchainProof, err := l.GenerateZKProof(ctx, attestationDocBytes) if err != nil { + l.Log.Error("failed to generate zk proof from nitro attestation", "err", err) return fmt.Errorf("failed to generate zk proof from nitro attestation: %w", err) } journalBytes, err := hex.DecodeString(stripHexPrefix(onchainProof.RawProof.Journal)) if err != nil { + l.Log.Error("failed to decode journal hex string", "err", err) return fmt.Errorf("failed to decode journal hex string: %w", err) } onchainProofBytes, err := hex.DecodeString(stripHexPrefix(onchainProof.OnchainProof)) if err != nil { + l.Log.Error("failed to decode onchain proof hex string", "err", err) return fmt.Errorf("failed to decode onchain proof hex string: %w", err) } log.Info("successfully generated zk proof from nitro attestation") From 33bddb1c91a170a76a4eb82d6757772e0992ec7a Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 18:01:06 -0800 Subject: [PATCH 18/33] fix TestE2eDevnetWithUnattestedBatcherKey --- espresso/environment/5_batch_authentication_test.go | 5 ++--- .../scripts/deploy/DeployAWSNitroVerifier.s.sol | 6 +++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/espresso/environment/5_batch_authentication_test.go b/espresso/environment/5_batch_authentication_test.go index 9de1fe49e11..9a43e5bf8b2 100644 --- a/espresso/environment/5_batch_authentication_test.go +++ b/espresso/environment/5_batch_authentication_test.go @@ -63,15 +63,14 @@ func TestE2eDevnetWithInvalidAttestation(t *testing.T) { // TestE2eDevnetWithUnattestedBatcherKey verifies that when a batcher key is not properly // attested, the L2 chain can still produce unsafe blocks but cannot progress to safe L2 blocks. func TestE2eDevnetWithUnattestedBatcherKey(t *testing.T) { - t.Skip("skip for now") ctx, cancel := context.WithCancel(context.Background()) defer cancel() launcher := new(env.EspressoDevNodeLauncherDocker) - privateKey, err := crypto.GenerateKey() + privateKey, err := crypto.HexToECDSA("841c29acb9520a7ea8a48e7686cd825b93e8a3ecd966b62cb396ff8a2cd7e80e") if err != nil { - t.Fatalf("failed to generate private key") + t.Fatalf("failed to parse private key: %v", err) } system, _, err := diff --git a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol index 7a3e2085300..f396dbd6c19 100644 --- a/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol +++ b/packages/contracts-bedrock/scripts/deploy/DeployAWSNitroVerifier.s.sol @@ -12,7 +12,11 @@ import { INitroEnclaveVerifier } from "aws-nitro-enclave-attestation/interfaces/ contract MockEspressoNitroTEEVerifier is IEspressoNitroTEEVerifier { constructor() { } - function registeredSigners(address) external pure override returns (bool) { + function registeredSigners(address signer) external pure override returns (bool) { + // Added this special condition for test TestE2eDevnetWithUnattestedBatcherKey + if (signer == address(0xe16d5c4080C0faD6D2Ef4eb07C657674a217271C)) { + return false; + } return true; } From c631af9df2ac85399b8c7aa26bc212c3b82ededa Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 18:07:29 -0800 Subject: [PATCH 19/33] fix health check --- espresso/docker-compose.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index cfd2e1a9a67..379c75ef9a9 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -637,12 +637,28 @@ services: attestation-service-zk: image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 platform: linux/amd64 + healthcheck: + attestation-service-zk: + image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 + platform: linux/amd64 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] - interval: 500s - timeout: 300s - retries: 10 - start_period: 300s + interval: 5s + timeout: 3s + retries: 30 + start_period: 150s + environment: + # This is a demo private key for tests, it doesnt contain any funds + NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" + NETWORK_RPC_URL: "https://rpc.mainnet.succinct.xyz" + SP1_PROVER: "mock" + RPC_URL: "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" + NITRO_VERIFIER_ADDRESS: "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" + USE_DOCKER: "1" + SKIP_TIME_VALIDITY_CHECK: "true" + RUST_LOG: "info" + HOST: "0.0.0.0" + PORT: "8080" environment: # This is a demo private key for tests, it doesnt contain any funds NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" From 0c3135e40af3b05288ef5b64be4720cf5df8f72d Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 21:01:11 -0800 Subject: [PATCH 20/33] fix devnet test --- espresso/docker-compose.yml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 379c75ef9a9..c45b7dcde8c 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -637,12 +637,14 @@ services: attestation-service-zk: image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 platform: linux/amd64 + ports: + - "8080:8080" healthcheck: - attestation-service-zk: - image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 - platform: linux/amd64 - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + test: + [ + "CMD-SHELL", + "timeout 2 bash -c 'cat < /dev/null > /dev/tcp/localhost/8080' || exit 1", + ] interval: 5s timeout: 3s retries: 30 @@ -659,18 +661,6 @@ services: RUST_LOG: "info" HOST: "0.0.0.0" PORT: "8080" - environment: - # This is a demo private key for tests, it doesnt contain any funds - NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" - NETWORK_RPC_URL: "https://rpc.mainnet.succinct.xyz" - SP1_PROVER: "mock" - RPC_URL: "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" - NITRO_VERIFIER_ADDRESS: "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" - USE_DOCKER: "1" - SKIP_TIME_VALIDITY_CHECK: "true" - RUST_LOG: "info" - HOST: "0.0.0.0" - PORT: "8080" espresso-dev-node: image: ${ESPRESSO_DEV_NODE_IMAGE} From 428fbf0d2344f29bca0d259ec0923497c33ca84e Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Tue, 9 Dec 2025 21:59:23 -0800 Subject: [PATCH 21/33] use 127.0.0.1 --- espresso/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index c45b7dcde8c..bbcdd96a254 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -431,7 +431,7 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} - ATTESTATION_SERVICE_URL: "http://localhost:8080" + ATTESTATION_SERVICE_URL: "http://127.0.0.1:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro @@ -450,7 +450,7 @@ services: export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}" export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}" - export ATTESTATION_SERVICE_URL="http://localhost:8080" + export ATTESTATION_SERVICE_URL="http://127.0.0.1:8080" /source/espresso/docker/op-batcher-tee/run-enclave.sh # Legacy op-proposer (for non-succinct mode) From c894164eac5e1f1a819acaec136fa46aa8ed53c2 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 09:17:58 -0800 Subject: [PATCH 22/33] fix regex --- espresso/docker-compose.yml | 1 - op-batcher/enclave-entrypoint.bash | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index bbcdd96a254..650d847b897 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -431,7 +431,6 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} - ATTESTATION_SERVICE_URL: "http://127.0.0.1:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro diff --git a/op-batcher/enclave-entrypoint.bash b/op-batcher/enclave-entrypoint.bash index 1d88cc63678..549432cc84a 100644 --- a/op-batcher/enclave-entrypoint.bash +++ b/op-batcher/enclave-entrypoint.bash @@ -151,7 +151,7 @@ launch_socat() { # URL argument regex pattern # Line 156 -URL_ARG_RE='^(--altda\.da-server|--espresso\.attestation-service|--espresso\.urls|--espresso\.l1-url|--espresso\.rollup-l1-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)(=|$)' +URL_ARG_RE='^(--altda\.da-server|--espresso\.espresso-attestation-service|--espresso\.urls|--espresso\.l1-url|--espresso\.rollup-l1-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)(=|$)' # Process all arguments filtered_args=() url_args=() From 7cd80e68e5fc1afd6a5809798e91d95f37aa5374 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 09:41:03 -0800 Subject: [PATCH 23/33] debug --- op-batcher/batcher/espresso.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 742c9867f07..4a68b496dd5 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1031,10 +1031,13 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ } defer res.Body.Close() + l.Log.Info("Received response from attestation service", "status", res.StatusCode) + responseData, err := io.ReadAll(res.Body) if err != nil { return nil, err } + l.Log.Info("Attestation service response", "bodySize", len(responseData), "body", string(responseData)) var zkProof EspressoOnchainProof err = json.Unmarshal(responseData, &zkProof) From febccc7d4c4a1054b5bd9955abba2e5ea239b2b6 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 10:01:09 -0800 Subject: [PATCH 24/33] fix proof generation --- espresso/environment/5_batch_authentication_test.go | 7 +------ op-batcher/batcher/driver.go | 3 +-- op-batcher/batcher/espresso.go | 7 +------ op-batcher/batcher/service.go | 6 +++--- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/espresso/environment/5_batch_authentication_test.go b/espresso/environment/5_batch_authentication_test.go index 9a43e5bf8b2..1d8c1717012 100644 --- a/espresso/environment/5_batch_authentication_test.go +++ b/espresso/environment/5_batch_authentication_test.go @@ -11,7 +11,6 @@ import ( "github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth" "github.com/ethereum-optimism/optimism/op-e2e/system/e2esys" "github.com/ethereum/go-ethereum/crypto" - "github.com/hf/nitrite" ) // TestE2eDevnetWithInvalidAttestation verifies that the batcher correctly fails to register @@ -41,11 +40,7 @@ func TestE2eDevnetWithInvalidAttestation(t *testing.T) { } batchDriver := system.BatchSubmitter.TestDriver() - batchDriver.Attestation = &nitrite.Result{ - Document: &nitrite.Document{ - CABundle: [][]byte{[]byte{1, 2, 3, 4}}, - }, - } + batchDriver.Attestation = []byte("this is an invalid attestation") err = batchDriver.StartBatchSubmitting() if err == nil { diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index 3414131bdcd..a27909b7a8c 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -11,7 +11,6 @@ import ( "sync/atomic" "time" - "github.com/hf/nitrite" "golang.org/x/sync/errgroup" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -109,7 +108,7 @@ type DriverSetup struct { EspressoStreamer espresso.EspressoStreamer[derive.EspressoBatch] EspressoClient espressoClient.EspressoClient ChainSigner opcrypto.ChainSigner - Attestation *nitrite.Result + Attestation []byte } type EspressoOnchainProof struct { diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 4a68b496dd5..005c3c6a06a 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -972,12 +972,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { return fmt.Errorf("failed to get Batch Authenticator ABI: %w", err) } - attestationDocBytes, err := json.Marshal(l.Attestation.Document) - if err != nil { - l.Log.Error("failed to marshal attestation document", "err", err) - return fmt.Errorf("failed to marshal attestation document: %w", err) - } - onchainProof, err := l.GenerateZKProof(ctx, attestationDocBytes) + onchainProof, err := l.GenerateZKProof(ctx, l.Attestation) if err != nil { l.Log.Error("failed to generate zk proof from nitro attestation", "err", err) return fmt.Errorf("failed to generate zk proof from nitro attestation: %w", err) diff --git a/op-batcher/batcher/service.go b/op-batcher/batcher/service.go index 4c673905f0a..7e13a615644 100644 --- a/op-batcher/batcher/service.go +++ b/op-batcher/batcher/service.go @@ -95,7 +95,7 @@ type BatcherService struct { opcrypto.ChainSigner EspressoStreamer espresso.EspressoStreamer[derive.EspressoBatch] EspressoClient espressoClient.EspressoClient - Attestation *nitrite.Result + Attestation []byte } type DriverSetupOption func(setup *DriverSetup) @@ -608,11 +608,11 @@ func (bs *BatcherService) initEspresso(cfg *CLIConfig) error { } else { // output length of attestation bs.Log.Info("Successfully got attestation. Attestation length", "length", len(attestationBytes)) - result, err := nitrite.Verify(attestationBytes, nitrite.VerifyOptions{}) + _, err := nitrite.Verify(attestationBytes, nitrite.VerifyOptions{}) if err != nil { return fmt.Errorf("Couldn't verify attestation: %w", err) } - bs.Attestation = result + bs.Attestation = attestationBytes } return nil From e158d3270d702129aed1f99931c3c8c45c3fe0c0 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 10:36:03 -0800 Subject: [PATCH 25/33] debug --- op-batcher/batcher/espresso.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 005c3c6a06a..128332b5da5 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1016,6 +1016,8 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ if err != nil { return nil, err } + + l.Log.Info("Attestation service URL", "url", l.Config.EspressoAttestationService+"/generate_proof") request.Header.Set("Content-Type", "application/octet-stream") client := http.Client{ Timeout: 2 * time.Minute, From 410015d31f2cbee1ecf2a07cdf8651e3eb56ff36 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 11:01:00 -0800 Subject: [PATCH 26/33] fix url --- op-batcher/batcher/espresso.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 128332b5da5..0f694bf2144 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -8,6 +8,7 @@ import ( "fmt" "io" "net/http" + "strings" "time" "context" @@ -1012,12 +1013,15 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { } func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*EspressoOnchainProof, error) { - request, err := http.NewRequestWithContext(ctx, "POST", l.Config.EspressoAttestationService+"/generate_proof", bytes.NewBuffer(attestationBytes)) + // Remove trailing slash to prevent double slashes in URL + attestationServiceURL := strings.TrimSuffix(l.Config.EspressoAttestationService, "/") + url := attestationServiceURL + "/generate_proof" + request, err := http.NewRequestWithContext(ctx, "POST", url+"/generate_proof", bytes.NewBuffer(attestationBytes)) if err != nil { return nil, err } - l.Log.Info("Attestation service URL", "url", l.Config.EspressoAttestationService+"/generate_proof") + l.Log.Info("Attestation service URL", "url", url) request.Header.Set("Content-Type", "application/octet-stream") client := http.Client{ Timeout: 2 * time.Minute, From 63c47ef8439f51ca431c462522bea78ff9d5bbe6 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 11:29:09 -0800 Subject: [PATCH 27/33] fix url --- op-batcher/batcher/espresso.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 0f694bf2144..7424d29bae5 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1016,7 +1016,7 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ // Remove trailing slash to prevent double slashes in URL attestationServiceURL := strings.TrimSuffix(l.Config.EspressoAttestationService, "/") url := attestationServiceURL + "/generate_proof" - request, err := http.NewRequestWithContext(ctx, "POST", url+"/generate_proof", bytes.NewBuffer(attestationBytes)) + request, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(attestationBytes)) if err != nil { return nil, err } From 72174b02428f013b561ff4a7e49f36b6477dc034 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 12:00:50 -0800 Subject: [PATCH 28/33] remove debug logs --- op-batcher/batcher/espresso.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 7424d29bae5..711666870b3 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1013,7 +1013,6 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { } func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes []byte) (*EspressoOnchainProof, error) { - // Remove trailing slash to prevent double slashes in URL attestationServiceURL := strings.TrimSuffix(l.Config.EspressoAttestationService, "/") url := attestationServiceURL + "/generate_proof" request, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(attestationBytes)) @@ -1021,7 +1020,6 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ return nil, err } - l.Log.Info("Attestation service URL", "url", url) request.Header.Set("Content-Type", "application/octet-stream") client := http.Client{ Timeout: 2 * time.Minute, @@ -1032,13 +1030,10 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ } defer res.Body.Close() - l.Log.Info("Received response from attestation service", "status", res.StatusCode) - responseData, err := io.ReadAll(res.Body) if err != nil { return nil, err } - l.Log.Info("Attestation service response", "bodySize", len(responseData), "body", string(responseData)) var zkProof EspressoOnchainProof err = json.Unmarshal(responseData, &zkProof) From 4ea1a680ff16690da5ef3bd8b46e39358920f972 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Wed, 10 Dec 2025 12:18:58 -0800 Subject: [PATCH 29/33] resolve based on comments --- espresso/environment/optitmism_espresso_test_helpers.go | 5 ++--- op-batcher/batcher/driver.go | 4 ++-- op-batcher/batcher/espresso.go | 2 +- op-deployer/pkg/deployer/pipeline/espresso.go | 2 -- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index 12203c7fd74..47b98b9f329 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -812,7 +812,7 @@ func ensureHardCodedPortsAreMappedFromTheirOriginalValues(containerInfo *DockerC } } -// launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches th +// launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches the // Espresso Dev Node within a Docker container. It also ensures that the // Espresso Dev Node is actively producing blocks before returning. // Additionally, it launches the Attestation Verifier ZK server in a Docker container. @@ -933,7 +933,6 @@ func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLaunc // Use the actual host:port for health check attestationURL := "http://" + attestationHostPort - // url pf the attestation verifier zk server c.Espresso.EspressoAttestationService = attestationURL for { @@ -958,7 +957,7 @@ func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLaunc } -// launchEspressoDevNodeDocker is E2eDevnetLauncherOption that launches th +// launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches the // Espresso Dev Node within a Docker container. It also ensures that the // Espresso Dev Node is actively producing blocks before returning. func launchEspressoDevNodeAndAttestationServiceDocker() E2eDevnetLauncherOption { diff --git a/op-batcher/batcher/driver.go b/op-batcher/batcher/driver.go index a27909b7a8c..bdb39d4c7e6 100644 --- a/op-batcher/batcher/driver.go +++ b/op-batcher/batcher/driver.go @@ -112,8 +112,8 @@ type DriverSetup struct { } type EspressoOnchainProof struct { - Zktype string `json:"zktype"` - ZkvmVersion string `json:"zkvm_version"` + ZKType string `json:"zktype"` + ZKVMVersion string `json:"zkvm_version"` ProgramID struct { VerifierID string `json:"verifier_id"` VerifierProofID string `json:"verifier_proof_id"` diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index 711666870b3..a295c44fb84 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -962,7 +962,7 @@ func (l *BatchSubmitter) registerBatcher(ctx context.Context) error { 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) + return fmt.Errorf("failed to check code at contract address: %w", err) } if len(code) == 0 { return fmt.Errorf("no contract deployed at this address %w", err) diff --git a/op-deployer/pkg/deployer/pipeline/espresso.go b/op-deployer/pkg/deployer/pipeline/espresso.go index 40499977e82..99c91663d85 100644 --- a/op-deployer/pkg/deployer/pipeline/espresso.go +++ b/op-deployer/pkg/deployer/pipeline/espresso.go @@ -35,7 +35,6 @@ func DeployEspresso(env *Env, intent *state.Intent, st *state.State, chainID com lgr.Info("Using nitro enclave verifier address from NITRO_ENCLAVE_VERIFIER_ADDRESS env var", "address", nitroEnclaveVerifierAddress.Hex()) } else { lgr.Info("NITRO_ENCLAVE_VERIFIER_ADDRESS env var not set, using empty address") - fmt.Printf("Nitro enclave verifier address not set") // this means we should deploy a mock verifier ( should only be used in dev / test environments nitroEnclaveVerifierAddress = common.Address{} } @@ -47,7 +46,6 @@ func DeployEspresso(env *Env, intent *state.Intent, st *state.State, chainID com lgr.Info("Using enclave hash from ENCLAVE_HASH env var", "hash", common.Bytes2Hex(enclaveHash[:])) } else { lgr.Info("ENCLAVE_HASH env var not set, using zeroed hash") - fmt.Printf("Enclave hash not set, using zeroed hash\n") } var nvo opcm.DeployAWSNitroVerifierOutput From 096c4e017c7d36fe98b333313f3a565323d6c28a Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Thu, 11 Dec 2025 12:24:05 -0800 Subject: [PATCH 30/33] address comments --- .github/workflows/espresso-devnet-tests.yaml | 12 + .github/workflows/espresso-integration.yaml | 12 + espresso/.env | 14 ++ espresso/docker-compose.yml | 30 +-- espresso/docker/op-batcher-tee/run-enclave.sh | 6 +- .../5_batch_authentication_test.go | 6 + .../optitmism_espresso_test_helpers.go | 218 +++++++++++------- op-batcher/batcher/espresso.go | 4 + op-batcher/enclave-entrypoint.bash | 1 - 9 files changed, 207 insertions(+), 96 deletions(-) diff --git a/.github/workflows/espresso-devnet-tests.yaml b/.github/workflows/espresso-devnet-tests.yaml index 95d71846e23..0846fc958e7 100644 --- a/.github/workflows/espresso-devnet-tests.yaml +++ b/.github/workflows/espresso-devnet-tests.yaml @@ -38,6 +38,18 @@ jobs: - name: Compile contracts run: just compile-contracts + - name: Load environment variables + run: | + while IFS= read -r line; do + # Skip comments and empty lines + if [[ ! "$line" =~ ^#.* ]] && [[ -n "$line" ]]; then + # Remove quotes from values + line=$(echo "$line" | sed 's/"\(.*\)"/\1/') + echo "$line" >> $GITHUB_ENV + fi + done < ./espresso/.env + shell: bash + - name: Build Devnet without TEE run: | cd op-deployer diff --git a/.github/workflows/espresso-integration.yaml b/.github/workflows/espresso-integration.yaml index b7d0c9363c8..3d3714e8702 100644 --- a/.github/workflows/espresso-integration.yaml +++ b/.github/workflows/espresso-integration.yaml @@ -37,6 +37,18 @@ jobs: - name: Compile contracts run: just compile-contracts + - name: Load environment variables + run: | + while IFS= read -r line; do + # Skip comments and empty lines + if [[ ! "$line" =~ ^#.* ]] && [[ -n "$line" ]]; then + # Remove quotes from values + line=$(echo "$line" | sed 's/"\(.*\)"/\1/') + echo "$line" >> $GITHUB_ENV + fi + done < ./espresso/.env + shell: bash + - name: Generate test slice id: test_split uses: hashicorp-forge/go-test-split-action@v1 diff --git a/espresso/.env b/espresso/.env index 32443839196..ff2b64f8d83 100644 --- a/espresso/.env +++ b/espresso/.env @@ -26,6 +26,20 @@ ESPRESSO_SEQUENCER_API_PORT=24000 ESPRESSO_DEV_NODE_PORT=24002 ESPRESSO_BUILDER_PORT=31003 + +##### Espresso Attestation Verifier Service ###### +ESPRESSO_ATTESTATION_VERIFIER_PORT=8080 +ESPRESSO_ATTESTATION_VERIFIER_RPC_URL="https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" +ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER="mock" +ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS="0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" +ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK=true +ESPRESSO_ATTESTATION_VERIFIER_HOST="0.0.0.0" +ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY="0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" +ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL="https://rpc.mainnet.succinct.xyz" +ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER=1 +ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG="info" +ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE="ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3" + L1_ENGINE_PORT=8551 L1_HTTP_PORT=8545 L1_BEACON_PORT=5052 diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index 650d847b897..f8e71f16b00 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -376,7 +376,7 @@ services: - --espresso.enabled=true - --espresso.fetch-api=true - --espresso.poll-interval=1s - - --espresso.espresso-attestation-service=http://attestation-service-zk:8080 + - --espresso.espresso-attestation-service=http://attestation-service-zk:${ESPRESSO_ATTESTATION_VERIFIER_PORT} - --espresso.light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797 - --espresso.testing-batcher-private-key=${OP_TESTING_BATCHER_PRIVATE_KEY:-$OPERATOR_PRIVATE_KEY} - --private-key=${OP_BATCHER_PRIVATE_KEY:-$OPERATOR_PRIVATE_KEY} @@ -449,7 +449,7 @@ services: export L2_RPC_URL="http://127.0.0.1:${OP_HTTP_PORT}" export ROLLUP_RPC_URL="http://127.0.0.1:${ROLLUP_PORT}" export ESPRESSO_URL1="http://127.0.0.1:${ESPRESSO_SEQUENCER_API_PORT}" - export ATTESTATION_SERVICE_URL="http://127.0.0.1:8080" + export ESPRESSO_ATTESTATION_SERVICE_URL="http://127.0.0.1:${ESPRESSO_ATTESTATION_VERIFIER_PORT}" /source/espresso/docker/op-batcher-tee/run-enclave.sh # Legacy op-proposer (for non-succinct mode) @@ -637,29 +637,31 @@ services: image: ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3 platform: linux/amd64 ports: - - "8080:8080" + - "${ESPRESSO_ATTESTATION_VERIFIER_PORT}:${ESPRESSO_ATTESTATION_VERIFIER_PORT}" healthcheck: test: [ "CMD-SHELL", - "timeout 2 bash -c 'cat < /dev/null > /dev/tcp/localhost/8080' || exit 1", + "timeout 2 bash -c 'cat < /dev/null > /dev/tcp/localhost/${ESPRESSO_ATTESTATION_VERIFIER_PORT}' || exit 1", ] interval: 5s timeout: 3s retries: 30 start_period: 150s + env_file: + - ./.env environment: # This is a demo private key for tests, it doesnt contain any funds - NETWORK_PRIVATE_KEY: "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" - NETWORK_RPC_URL: "https://rpc.mainnet.succinct.xyz" - SP1_PROVER: "mock" - RPC_URL: "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" - NITRO_VERIFIER_ADDRESS: "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" - USE_DOCKER: "1" - SKIP_TIME_VALIDITY_CHECK: "true" - RUST_LOG: "info" - HOST: "0.0.0.0" - PORT: "8080" + NETWORK_PRIVATE_KEY: "${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY}" + NETWORK_RPC_URL: "${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL}" + SP1_PROVER: "${ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER}" + RPC_URL: "${ESPRESSO_ATTESTATION_VERIFIER_RPC_URL}" + NITRO_VERIFIER_ADDRESS: "${ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS}" + USE_DOCKER: "${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER}" + SKIP_TIME_VALIDITY_CHECK: "${ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK}" + RUST_LOG: "${ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG}" + HOST: "${ESPRESSO_ATTESTATION_VERIFIER_HOST}" + PORT: "${ESPRESSO_ATTESTATION_VERIFIER_PORT}" espresso-dev-node: image: ${ESPRESSO_DEV_NODE_IMAGE} diff --git a/espresso/docker/op-batcher-tee/run-enclave.sh b/espresso/docker/op-batcher-tee/run-enclave.sh index 31c98e7647d..e07f78b6759 100755 --- a/espresso/docker/op-batcher-tee/run-enclave.sh +++ b/espresso/docker/op-batcher-tee/run-enclave.sh @@ -10,7 +10,7 @@ set -e : ${ROLLUP_RPC_URL:?Error: ROLLUP_RPC_URL is required} : ${ESPRESSO_URL1:?Error: ESPRESSO_URL1 is required} : ${OPERATOR_PRIVATE_KEY:?Error: OPERATOR_PRIVATE_KEY is required} -: ${ATTESTATION_SERVICE_URL:?Error: ATTESTATION_SERVICE_URL is required} +: ${ESPRESSO_ATTESTATION_SERVICE_URL:?Error: ESPRESSO_ATTESTATION_SERVICE_URL is required} # Optional configuration with defaults TAG="${TAG:-op-batcher-enclavetool}" @@ -29,7 +29,7 @@ echo "L1 RPC URL: $L1_RPC_URL" echo "L2 RPC URL: $L2_RPC_URL" echo "Rollup RPC URL: $ROLLUP_RPC_URL" echo "Espresso URLs: $ESPRESSO_URL1, $ESPRESSO_URL2" -echo "Attestation service url: $ATTESTATION_SERVICE_URL" +echo "Attestation service url: $ESPRESSO_ATTESTATION_SERVICE_URL" echo "Debug Mode: $ENCLAVE_DEBUG" echo "Monitor Interval: $MONITOR_INTERVAL seconds" echo "Memory: ${MEMORY_MB}MB" @@ -50,7 +50,7 @@ BATCHER_ARGS="$BATCHER_ARGS,--max-channel-duration=1" BATCHER_ARGS="$BATCHER_ARGS,--target-num-frames=1" BATCHER_ARGS="$BATCHER_ARGS,--espresso.fetch-api=true" BATCHER_ARGS="$BATCHER_ARGS,--espresso.light-client-addr=0x703848f4c85f18e3acd8196c8ec91eb0b7bd0797" -BATCHER_ARGS="$BATCHER_ARGS,--espresso.espresso-attestation-service=$ATTESTATION_SERVICE_URL" +BATCHER_ARGS="$BATCHER_ARGS,--espresso.espresso-attestation-service=$ESPRESSO_ATTESTATION_SERVICE_URL" # Add debug arguments if enabled if [ "$ENCLAVE_DEBUG" = "true" ]; then diff --git a/espresso/environment/5_batch_authentication_test.go b/espresso/environment/5_batch_authentication_test.go index 1d8c1717012..8622f8d15f5 100644 --- a/espresso/environment/5_batch_authentication_test.go +++ b/espresso/environment/5_batch_authentication_test.go @@ -63,6 +63,12 @@ func TestE2eDevnetWithUnattestedBatcherKey(t *testing.T) { launcher := new(env.EspressoDevNodeLauncherDocker) + // This is a random private key belonging to address 0xe16d5c4080C0faD6D2Ef4eb07C657674a217271C that will result in Mock Nitro verifier to return `false` + // because the given key is not registered as an attested batcher. + // Check the following code in Mock Espresso Nitro verifier: + // if (signer == address(0xe16d5c4080C0faD6D2Ef4eb07C657674a217271C)) { + // return false; + // } privateKey, err := crypto.HexToECDSA("841c29acb9520a7ea8a48e7686cd825b93e8a3ecd966b62cb396ff8a2cd7e80e") if err != nil { t.Fatalf("failed to parse private key: %v", err) diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index 47b98b9f329..c99cf3f6aba 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -15,6 +15,7 @@ import ( "net" "net/http" "net/url" + "os" "strconv" "testing" "time" @@ -74,17 +75,6 @@ const ESPRESSO_BUILDER_PORT = "31003" const ESPRESSO_SEQUENCER_API_PORT = "24000" const ESPRESSO_DEV_NODE_PORT = "24002" -const ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE = "ghcr.io/espressosystems/attestation-verifier-zk:sha-0e987c3" -const ATTESTATION_VERIFIER_ZK_SERVER_PORT = "8080" -const SP1_PROVER = "mock" -const NETWORK_RPC_URL = "https://rpc.mainnet.succinct.xyz" -const NETWORK_PRIVATE_KEY = "0x71f8e55f7555c946eadd5a2b5897465a9813b3ee493d6ef4ba6f1505a6e97af3" // Default Hardhat Key -const NITRO_VERIFIER_ADDRESS = "0x2D7fbBAD6792698Ba92e67b7e180f8010B9Ec788" -const USE_DOCKER = "1" -const SKIP_TIME_VALIDITY_CHECK = "true" -const RUST_LOG = "info" -const RPC_URL = "https://rpc.ankr.com/eth_sepolia/ece75e2d2d01c537031b3b31a619b7830674b9cd1b9fe6bc957a3d393c035dbb" - // ErrEspressoBlockHeightDidNotIncrease is a sentinel error that occurs when // the Espresso Block Height does not increase within the alloted context // allowance. @@ -880,81 +870,153 @@ func launchEspressoDevNodeAndAttestationVerifierZKStartOption(ct *E2eDevnetLaunc c.LogConfig.Level = slog.LevelDebug c.Espresso.LightClientAddr = common.HexToAddress(ESPRESSO_LIGHT_CLIENT_ADDRESS) - // Now we need to launch the attestation verifier zk server - fmt.Printf("launching attestation verifier service") - dockerConfig = DockerContainerConfig{ - Image: ATTESTATION_VERIFIER_ZK_SERVER_DOCKER_IMAGE, - Network: determineDockerNetworkMode(), - Ports: []string{ - ATTESTATION_VERIFIER_ZK_SERVER_PORT, - }, - Name: "attestation-verifier-zk", - Platform: "linux/amd64", - Environment: map[string]string{ - "NETWORK_RPC_URL": NETWORK_RPC_URL, - "SP1_PROVER": SP1_PROVER, - "NITRO_VERIFIER_ADDRESS": NITRO_VERIFIER_ADDRESS, - "USE_DOCKER": USE_DOCKER, - "SKIP_TIME_VALIDITY_CHECK": SKIP_TIME_VALIDITY_CHECK, - "RUST_LOG": RUST_LOG, - "NETWORK_PRIVATE_KEY": NETWORK_PRIVATE_KEY, - "RPC_URL": RPC_URL, - "HOST": "0.0.0.0", - "PORT": "8080", - }, - } - containerCli = new(DockerCli) + // Now launch the attestation verifier zk server + launchEspressoAttestationVerifierService(ct, c) + }, + } +} - attestationVerifierInfo, err := containerCli.LaunchContainer(ct.Ctx, dockerConfig) - if err != nil { - fmt.Printf("failed to start the container: %v", err) - ct.Error = FailedToLaunchDockerContainer{Cause: err} - return - } +// launchEspressoAttestationVerifierService launches the attestation verifier zk server +// in a Docker container and configures the batcher CLIConfig to use it. +func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *batcher.CLIConfig) { + // Now we need to launch the attestation verifier zk server + fmt.Println("Starting attestation verifier zk server...") - // Get the actual mapped port - ports := attestationVerifierInfo.PortMap[ATTESTATION_VERIFIER_ZK_SERVER_PORT] - if len(ports) == 0 { - ct.Error = fmt.Errorf("no port mapping found for attestation verifier") - return - } + espressoAttestationVerifierNetworkRPCURL := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL") + if espressoAttestationVerifierNetworkRPCURL == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL environment variable is not set") + return + } - healthCheckCtx, cancel := context.WithTimeout(ct.Ctx, 60*time.Second) - defer cancel() + espressoAttestationVerifierSp1Prover := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER") + if espressoAttestationVerifierSp1Prover == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER environment variable is not set") + return + } - ticker := time.NewTicker(500 * time.Millisecond) - defer ticker.Stop() - attestationHostPort, err := getContainerRemappedHostPort(ports[0]) - if err != nil { - ct.Error = err - return - } + espressoAttestationVerifierNitroVerifierAddress := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS") + if espressoAttestationVerifierNitroVerifierAddress == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS environment variable is not set") + return + } - // Use the actual host:port for health check - attestationURL := "http://" + attestationHostPort - - c.Espresso.EspressoAttestationService = attestationURL - - for { - select { - case <-healthCheckCtx.Done(): - ct.Error = fmt.Errorf("attestation verifier did not become healthy: %w", healthCheckCtx.Err()) - return - case <-ticker.C: - resp, err := http.Get(attestationURL + "/health") - if err == nil && resp.StatusCode == http.StatusOK { - resp.Body.Close() - goto healthy - } - if resp != nil { - resp.Body.Close() - } - } - } - healthy: + espressoAttestationVerifierUseDocker := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER") + if espressoAttestationVerifierUseDocker == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER environment variable is not set") + return + } + + espressoAttestationVerifierSkipTimeValidityCheck := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK") + if espressoAttestationVerifierSkipTimeValidityCheck == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK environment variable is not set") + return + } + + espressoAttestationVerifierRustLog := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG") + if espressoAttestationVerifierRustLog == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG environment variable is not set") + return + } + + espressoAttestationVerifierNetworkPrivateKey := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY") + if espressoAttestationVerifierNetworkPrivateKey == "" { + ct.Error = fmt.Errorf("networkPrivateKey environment variable is not set") + return + } + + espressoAttestationVerifierRPCUrl := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RPC_URL") + if espressoAttestationVerifierRPCUrl == "" { + ct.Error = fmt.Errorf("RPC_URL environment variable is not set") + return + } + + espressoAttestationVerifierHost := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_HOST") + if espressoAttestationVerifierHost == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_HOST environment variable is not set") + return + } + + espressoAttestationVerifierPort := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_PORT") + if espressoAttestationVerifierPort == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_PORT environment variable is not set") + return + } + + espressoAttestationVerifierDockerImage := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE") + if espressoAttestationVerifierDockerImage == "" { + ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE environment variable is not set") + return + } + + dockerConfig := DockerContainerConfig{ + Image: espressoAttestationVerifierDockerImage, + Network: determineDockerNetworkMode(), + Ports: []string{ + espressoAttestationVerifierPort, + }, + Name: "attestation-verifier-zk", + Platform: "linux/amd64", + Environment: map[string]string{ + "NETWORK_RPC_URL": espressoAttestationVerifierNetworkRPCURL, + "SP1_PROVER": espressoAttestationVerifierSp1Prover, + "NITRO_VERIFIER_ADDRESS": espressoAttestationVerifierNitroVerifierAddress, + "USE_DOCKER": espressoAttestationVerifierUseDocker, + "SKIP_TIME_VALIDITY_CHECK": espressoAttestationVerifierSkipTimeValidityCheck, + "RUST_LOG": espressoAttestationVerifierRustLog, + "NETWORK_PRIVATE_KEY": espressoAttestationVerifierNetworkPrivateKey, + "RPC_URL": espressoAttestationVerifierRPCUrl, + "HOST": espressoAttestationVerifierHost, + "PORT": espressoAttestationVerifierPort, }, } + containerCli := new(DockerCli) + attestationVerifierInfo, err := containerCli.LaunchContainer(ct.Ctx, dockerConfig) + if err != nil { + ct.Error = FailedToLaunchDockerContainer{Cause: err} + return + } + + // Get the actual mapped port + ports := attestationVerifierInfo.PortMap[espressoAttestationVerifierPort] + if len(ports) == 0 { + ct.Error = fmt.Errorf("no port mapping found for attestation verifier") + return + } + + healthCheckCtx, cancel := context.WithTimeout(ct.Ctx, 60*time.Second) + defer cancel() + + ticker := time.NewTicker(500 * time.Millisecond) + defer ticker.Stop() + attestationHostPort, err := getContainerRemappedHostPort(ports[0]) + if err != nil { + ct.Error = err + return + } + + // Use the actual host:port for health check + attestationURL := "http://" + attestationHostPort + + c.Espresso.EspressoAttestationService = attestationURL + + for { + select { + case <-healthCheckCtx.Done(): + ct.Error = fmt.Errorf("attestation verifier did not become healthy: %w", healthCheckCtx.Err()) + return + case <-ticker.C: + resp, err := http.Get(attestationURL + "/health") + if err == nil && resp.StatusCode == http.StatusOK { + resp.Body.Close() + goto healthy + } + if resp != nil { + resp.Body.Close() + } + } + } +healthy: } // launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches the diff --git a/op-batcher/batcher/espresso.go b/op-batcher/batcher/espresso.go index a295c44fb84..5b8a2d7d997 100644 --- a/op-batcher/batcher/espresso.go +++ b/op-batcher/batcher/espresso.go @@ -1030,6 +1030,10 @@ func (l *BatchSubmitter) GenerateZKProof(ctx context.Context, attestationBytes [ } defer res.Body.Close() + if res.StatusCode != http.StatusOK { + return nil, fmt.Errorf("received non-200 response: %d", res.StatusCode) + } + responseData, err := io.ReadAll(res.Body) if err != nil { return nil, err diff --git a/op-batcher/enclave-entrypoint.bash b/op-batcher/enclave-entrypoint.bash index 549432cc84a..8b1cadc8695 100644 --- a/op-batcher/enclave-entrypoint.bash +++ b/op-batcher/enclave-entrypoint.bash @@ -150,7 +150,6 @@ launch_socat() { } # URL argument regex pattern -# Line 156 URL_ARG_RE='^(--altda\.da-server|--espresso\.espresso-attestation-service|--espresso\.urls|--espresso\.l1-url|--espresso\.rollup-l1-url|--l1-eth-rpc|--l2-eth-rpc|--rollup-rpc|--signer\.endpoint)(=|$)' # Process all arguments filtered_args=() From bc5e61d9b1c61925e619d0c25c73eb43d9cf53a5 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Fri, 12 Dec 2025 07:17:51 -0800 Subject: [PATCH 31/33] update github runner enclave --- .github/workflows/espresso-enclave.yaml | 12 ++++++ espresso/cli.go | 2 +- espresso/docker-compose.yml | 11 ++++++ .../optitmism_espresso_test_helpers.go | 39 +++++++++++++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/.github/workflows/espresso-enclave.yaml b/.github/workflows/espresso-enclave.yaml index 8939f64b3f9..09b2cba2903 100644 --- a/.github/workflows/espresso-enclave.yaml +++ b/.github/workflows/espresso-enclave.yaml @@ -68,6 +68,18 @@ jobs: --port 22 \ --cidr 0.0.0.0/0 || true + - name: Load environment variables + run: | + while IFS= read -r line; do + # Skip comments and empty lines + if [[ ! "$line" =~ ^#.* ]] && [[ -n "$line" ]]; then + # Remove quotes from values + line=$(echo "$line" | sed 's/"\(.*\)"/\1/') + echo "$line" >> $GITHUB_ENV + fi + done < ./espresso/.env + shell: bash + - name: Launch EC2 Instance id: ec2 run: | diff --git a/espresso/cli.go b/espresso/cli.go index e0dff2e066c..f339d0be3cb 100644 --- a/espresso/cli.go +++ b/espresso/cli.go @@ -107,7 +107,7 @@ func CLIFlags(envPrefix string, category string) []cli.Flag { &cli.StringFlag{ Name: AttestationServiceFlagName, Usage: "URL of the Espresso attestation service", - EnvVars: espressoEnvs(envPrefix, "ESPRESSO_ATTESTATION_SERVICE"), + EnvVars: espressoEnvs(envPrefix, "ATTESTATION_SERVICE_URL"), Category: category, }, } diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index f8e71f16b00..b44ba0f7c28 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -431,6 +431,17 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} + ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL} + ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY} + ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER: ${ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER} + ESPRESSO_ATTESTATION_VERIFIER_RPC_URL: ${ESPRESSO_ATTESTATION_VERIFIER_RPC_URL} + ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS: ${ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS} + ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER} + ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK: ${ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK} + ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG: ${ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG} + ESPRESSO_ATTESTATION_VERIFIER_HOST: ${ESPRESSO_ATTESTATION_VERIFIER_HOST} + ESPRESSO_ATTESTATION_VERIFIER_PORT: ${ESPRESSO_ATTESTATION_VERIFIER_PORT} + ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE: ${ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE} volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index c99cf3f6aba..897db770d29 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -884,70 +884,103 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b espressoAttestationVerifierNetworkRPCURL := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL") if espressoAttestationVerifierNetworkRPCURL == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL: %s\n", espressoAttestationVerifierNetworkRPCURL) + espressoAttestationVerifierSp1Prover := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER") if espressoAttestationVerifierSp1Prover == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER: %s\n", espressoAttestationVerifierSp1Prover) + espressoAttestationVerifierNitroVerifierAddress := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS") if espressoAttestationVerifierNitroVerifierAddress == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS: %s\n", espressoAttestationVerifierNitroVerifierAddress) + espressoAttestationVerifierUseDocker := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER") if espressoAttestationVerifierUseDocker == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER: %s\n", espressoAttestationVerifierUseDocker) + espressoAttestationVerifierSkipTimeValidityCheck := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK") if espressoAttestationVerifierSkipTimeValidityCheck == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK: %s\n", espressoAttestationVerifierSkipTimeValidityCheck) + espressoAttestationVerifierRustLog := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG") if espressoAttestationVerifierRustLog == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG: %s\n", espressoAttestationVerifierRustLog) + espressoAttestationVerifierNetworkPrivateKey := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY") if espressoAttestationVerifierNetworkPrivateKey == "" { + fmt.Printf("networkPrivateKey environment variable is not set\n") ct.Error = fmt.Errorf("networkPrivateKey environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY: %s\n", espressoAttestationVerifierNetworkPrivateKey) + espressoAttestationVerifierRPCUrl := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RPC_URL") if espressoAttestationVerifierRPCUrl == "" { + fmt.Printf("espressoAttestationVerifierRPCUrl environment variable is not set\n") ct.Error = fmt.Errorf("RPC_URL environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_RPC_URL: %s\n", espressoAttestationVerifierRPCUrl) + espressoAttestationVerifierHost := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_HOST") if espressoAttestationVerifierHost == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_HOST environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_HOST environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_HOST: %s\n", espressoAttestationVerifierHost) + espressoAttestationVerifierPort := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_PORT") if espressoAttestationVerifierPort == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_PORT environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_PORT environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_PORT: %s\n", espressoAttestationVerifierPort) + espressoAttestationVerifierDockerImage := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE") if espressoAttestationVerifierDockerImage == "" { + fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE environment variable is not set") return } + fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE: %s\n", espressoAttestationVerifierDockerImage) + dockerConfig := DockerContainerConfig{ Image: espressoAttestationVerifierDockerImage, Network: determineDockerNetworkMode(), @@ -977,6 +1010,8 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b return } + fmt.Println("Attestation verifier zk server started.") + // Get the actual mapped port ports := attestationVerifierInfo.PortMap[espressoAttestationVerifierPort] if len(ports) == 0 { @@ -1000,6 +1035,8 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b c.Espresso.EspressoAttestationService = attestationURL + fmt.Printf("c.Espresso.EspressoAttestationService set to %s\n", c.Espresso.EspressoAttestationService) + for { select { case <-healthCheckCtx.Done(): @@ -1017,6 +1054,8 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b } } healthy: + + fmt.Println("Attestation verifier zk server is healthy.") } // launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches the From 975d2acd5e08e96a7a29813feab81cc403f20504 Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Fri, 12 Dec 2025 10:33:49 -0800 Subject: [PATCH 32/33] fix based on suggestions --- .github/workflows/espresso-enclave.yaml | 11 +++++++++++ espresso/docker-compose.yml | 13 ++----------- espresso/scripts/run-tests-github-actions.sh | 2 +- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/espresso-enclave.yaml b/.github/workflows/espresso-enclave.yaml index 09b2cba2903..2797157f4df 100644 --- a/.github/workflows/espresso-enclave.yaml +++ b/.github/workflows/espresso-enclave.yaml @@ -120,6 +120,17 @@ jobs: run: | ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=5 -i key.pem ec2-user@$DNS << EOF export BRANCH_NAME=$BRANCH_NAME + export ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL="${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL}" + export ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY="${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY}" + export ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER="${ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER}" + export ESPRESSO_ATTESTATION_VERIFIER_RPC_URL="${ESPRESSO_ATTESTATION_VERIFIER_RPC_URL}" + export ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS="${ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS}" + export ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER="${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER}" + export ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK="${ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK}" + export ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG="${ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG}" + export ESPRESSO_ATTESTATION_VERIFIER_HOST="${ESPRESSO_ATTESTATION_VERIFIER_HOST}" + export ESPRESSO_ATTESTATION_VERIFIER_PORT="${ESPRESSO_ATTESTATION_VERIFIER_PORT}" + export ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE="${ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE}" ./run-tests-github-actions.sh ${{ secrets.CACHIX_AUTH_TOKEN }} EOF diff --git a/espresso/docker-compose.yml b/espresso/docker-compose.yml index b44ba0f7c28..c6233e41eab 100644 --- a/espresso/docker-compose.yml +++ b/espresso/docker-compose.yml @@ -423,6 +423,8 @@ services: attestation-service-zk: condition: service_healthy network_mode: "host" + env_file: + - ./.env environment: http_proxy: http://127.0.0.1:3128 HTTP_PROXY: http://127.0.0.1:3128 @@ -431,17 +433,6 @@ services: CONTAINER_MONITOR_INTERVAL: ${CONTAINER_MONITOR_INTERVAL:-1} ENCLAVE_MEMORY_MB: ${ENCLAVE_MEMORY_MB:-4096} ENCLAVE_CPU_COUNT: ${ENCLAVE_CPU_COUNT:-2} - ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL} - ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY} - ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER: ${ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER} - ESPRESSO_ATTESTATION_VERIFIER_RPC_URL: ${ESPRESSO_ATTESTATION_VERIFIER_RPC_URL} - ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS: ${ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS} - ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER: ${ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER} - ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK: ${ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK} - ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG: ${ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG} - ESPRESSO_ATTESTATION_VERIFIER_HOST: ${ESPRESSO_ATTESTATION_VERIFIER_HOST} - ESPRESSO_ATTESTATION_VERIFIER_PORT: ${ESPRESSO_ATTESTATION_VERIFIER_PORT} - ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE: ${ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE} volumes: - /var/run/docker.sock:/var/run/docker.sock - ..:/source:ro diff --git a/espresso/scripts/run-tests-github-actions.sh b/espresso/scripts/run-tests-github-actions.sh index fbbdb03646b..4ffb5498463 100644 --- a/espresso/scripts/run-tests-github-actions.sh +++ b/espresso/scripts/run-tests-github-actions.sh @@ -28,4 +28,4 @@ sudo systemctl start nitro-enclaves-allocator.service echo "[*] Running tests in nix develop shell..." -nix develop --command bash -c "just compile-contracts-fast && just build-batcher-enclave-image && just espresso-enclave-tests" +nix develop --command bash -c "source ./espresso/.env && just compile-contracts-fast && just build-batcher-enclave-image && just espresso-enclave-tests" From 34c40e67c63221197729ee731fa1a837800ce3ae Mon Sep 17 00:00:00 2001 From: Sneh Koul Date: Fri, 12 Dec 2025 11:05:57 -0800 Subject: [PATCH 33/33] cleanup logs --- .../optitmism_espresso_test_helpers.go | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/espresso/environment/optitmism_espresso_test_helpers.go b/espresso/environment/optitmism_espresso_test_helpers.go index 897db770d29..c99cf3f6aba 100644 --- a/espresso/environment/optitmism_espresso_test_helpers.go +++ b/espresso/environment/optitmism_espresso_test_helpers.go @@ -884,103 +884,70 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b espressoAttestationVerifierNetworkRPCURL := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL") if espressoAttestationVerifierNetworkRPCURL == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_RPC_URL: %s\n", espressoAttestationVerifierNetworkRPCURL) - espressoAttestationVerifierSp1Prover := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER") if espressoAttestationVerifierSp1Prover == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_SP1_PROVER: %s\n", espressoAttestationVerifierSp1Prover) - espressoAttestationVerifierNitroVerifierAddress := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS") if espressoAttestationVerifierNitroVerifierAddress == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NITRO_VERIFIER_ADDRESS: %s\n", espressoAttestationVerifierNitroVerifierAddress) - espressoAttestationVerifierUseDocker := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER") if espressoAttestationVerifierUseDocker == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_USE_DOCKER: %s\n", espressoAttestationVerifierUseDocker) - espressoAttestationVerifierSkipTimeValidityCheck := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK") if espressoAttestationVerifierSkipTimeValidityCheck == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_SKIP_TIME_VALIDITY_CHECK: %s\n", espressoAttestationVerifierSkipTimeValidityCheck) - espressoAttestationVerifierRustLog := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG") if espressoAttestationVerifierRustLog == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_RUST_LOG: %s\n", espressoAttestationVerifierRustLog) - espressoAttestationVerifierNetworkPrivateKey := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY") if espressoAttestationVerifierNetworkPrivateKey == "" { - fmt.Printf("networkPrivateKey environment variable is not set\n") ct.Error = fmt.Errorf("networkPrivateKey environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_NETWORK_PRIVATE_KEY: %s\n", espressoAttestationVerifierNetworkPrivateKey) - espressoAttestationVerifierRPCUrl := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_RPC_URL") if espressoAttestationVerifierRPCUrl == "" { - fmt.Printf("espressoAttestationVerifierRPCUrl environment variable is not set\n") ct.Error = fmt.Errorf("RPC_URL environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_RPC_URL: %s\n", espressoAttestationVerifierRPCUrl) - espressoAttestationVerifierHost := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_HOST") if espressoAttestationVerifierHost == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_HOST environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_HOST environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_HOST: %s\n", espressoAttestationVerifierHost) - espressoAttestationVerifierPort := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_PORT") if espressoAttestationVerifierPort == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_PORT environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_PORT environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_PORT: %s\n", espressoAttestationVerifierPort) - espressoAttestationVerifierDockerImage := os.Getenv("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE") if espressoAttestationVerifierDockerImage == "" { - fmt.Printf("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE environment variable is not set\n") ct.Error = fmt.Errorf("ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE environment variable is not set") return } - fmt.Printf("Using ESPRESSO_ATTESTATION_VERIFIER_DOCKER_IMAGE: %s\n", espressoAttestationVerifierDockerImage) - dockerConfig := DockerContainerConfig{ Image: espressoAttestationVerifierDockerImage, Network: determineDockerNetworkMode(), @@ -1010,8 +977,6 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b return } - fmt.Println("Attestation verifier zk server started.") - // Get the actual mapped port ports := attestationVerifierInfo.PortMap[espressoAttestationVerifierPort] if len(ports) == 0 { @@ -1035,8 +1000,6 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b c.Espresso.EspressoAttestationService = attestationURL - fmt.Printf("c.Espresso.EspressoAttestationService set to %s\n", c.Espresso.EspressoAttestationService) - for { select { case <-healthCheckCtx.Done(): @@ -1054,8 +1017,6 @@ func launchEspressoAttestationVerifierService(ct *E2eDevnetLauncherContext, c *b } } healthy: - - fmt.Println("Attestation verifier zk server is healthy.") } // launchEspressoDevNodeAndAttestationVerifierZKStartOption is E2eDevnetLauncherOption that launches the