From 1549d5597030af670e376268456738b7f727f348 Mon Sep 17 00:00:00 2001 From: gusiri Date: Tue, 1 Oct 2024 12:27:09 +0000 Subject: [PATCH 01/12] add missing allow inputs --- prover/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/config/config.go b/prover/config/config.go index 2c327f35..13989ba3 100644 --- a/prover/config/config.go +++ b/prover/config/config.go @@ -225,7 +225,7 @@ type Aggregation struct { // AllowedInputs determines the "inner" plonk circuits the "outer" aggregation circuit can aggregate. // Order matters. - AllowedInputs []string `mapstructure:"allowed_inputs" validate:"required,dive,oneof=execution-dummy execution execution-large blob-decompression-dummy blob-decompression-v0 blob-decompression-v1"` + AllowedInputs []string `mapstructure:"allowed_inputs" validate:"required,dive,oneof=execution-dummy execution execution-large blob-decompression-dummy blob-decompression-v0 blob-decompression-v1 emulation-dummy aggregation emulation public-input-interconnection"` // note @gbotrel keeping that around in case we need to support two emulation contract // during a migration. From 8a04c39b3e2d4e366d4c98b0bb86e60850aad4f3 Mon Sep 17 00:00:00 2001 From: gusiri Date: Fri, 11 Oct 2024 18:31:28 +0000 Subject: [PATCH 02/12] set MaxUncompressedBytes to 756000 --- prover/lib/compressor/blob/v1/blob_maker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prover/lib/compressor/blob/v1/blob_maker.go b/prover/lib/compressor/blob/v1/blob_maker.go index 6e6b3030..d88483b3 100644 --- a/prover/lib/compressor/blob/v1/blob_maker.go +++ b/prover/lib/compressor/blob/v1/blob_maker.go @@ -29,8 +29,8 @@ const ( NbElemsEncodingBytes = 2 // These also impact the circuit constraints (compile / setup time) - MaxUncompressedBytes = 740 * 1024 // defines the max size we can handle for a blob (uncompressed) input - MaxUsableBytes = 32 * 4096 // defines the number of bytes available in a blob + MaxUncompressedBytes = 756000 // defines the max size we can handle for a blob (uncompressed) input + MaxUsableBytes = 32 * 4096 // defines the number of bytes available in a blob ) // BlobMaker is a bm for RLP encoded blocks (see EIP-4844). From 453af0aa7297a130c67ed9d2ac5e229919328808 Mon Sep 17 00:00:00 2001 From: gusiri Date: Fri, 11 Oct 2024 18:31:46 +0000 Subject: [PATCH 03/12] implement WizardCompilationParameters --- prover/circuits/pi-interconnection/circuit.go | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/prover/circuits/pi-interconnection/circuit.go b/prover/circuits/pi-interconnection/circuit.go index 0f4394dc..5add8430 100644 --- a/prover/circuits/pi-interconnection/circuit.go +++ b/prover/circuits/pi-interconnection/circuit.go @@ -24,6 +24,12 @@ import ( "github.com/consensys/linea-monorepo/prover/circuits/internal" "github.com/consensys/linea-monorepo/prover/circuits/pi-interconnection/keccak" "github.com/consensys/linea-monorepo/prover/crypto/mimc/gkrmimc" + "github.com/consensys/linea-monorepo/prover/crypto/ringsis" + "github.com/consensys/linea-monorepo/prover/protocol/compiler" + "github.com/consensys/linea-monorepo/prover/protocol/compiler/cleanup" + mimcComp "github.com/consensys/linea-monorepo/prover/protocol/compiler/mimc" + "github.com/consensys/linea-monorepo/prover/protocol/compiler/selfrecursion" + "github.com/consensys/linea-monorepo/prover/protocol/compiler/vortex" "github.com/consensys/linea-monorepo/prover/protocol/wizard" "github.com/consensys/linea-monorepo/prover/utils" ) @@ -49,6 +55,10 @@ type Circuit struct { MockKeccakWizard bool // for testing purposes, bypass expensive keccak verification } +// type alias to denote a wizard-compilation suite. This is used when calling +// compile and provides internal parameters for the wizard package. +type compilationSuite = []func(*wizard.CompiledIOP) + func (c *Circuit) Define(api frontend.API) error { maxNbDecompression, maxNbExecution := len(c.DecompressionPublicInput), len(c.ExecutionPublicInput) if len(c.DecompressionFPIQ) != maxNbDecompression || len(c.ExecutionFPIQ) != maxNbExecution { @@ -327,7 +337,42 @@ func (b builder) Compile() (constraint.ConstraintSystem, error) { } func WizardCompilationParameters() []func(iop *wizard.CompiledIOP) { - panic("implement me") // TODO @alexandre.belling + var ( + sisInstance = ringsis.Params{LogTwoBound: 16, LogTwoDegree: 6} + + fullCompilationSuite = compilationSuite{ + + compiler.Arcane(1<<10, 1<<18, false), + vortex.Compile( + 2, + vortex.ForceNumOpenedColumns(256), + vortex.WithSISParams(&sisInstance), + ), + + selfrecursion.SelfRecurse, + cleanup.CleanUp, + mimcComp.CompileMiMC, + compiler.Arcane(1<<10, 1<<16, false), + vortex.Compile( + 8, + vortex.ForceNumOpenedColumns(64), + vortex.WithSISParams(&sisInstance), + ), + + selfrecursion.SelfRecurse, + cleanup.CleanUp, + mimcComp.CompileMiMC, + compiler.Arcane(1<<10, 1<<13, false), + vortex.Compile( + 8, + vortex.ForceNumOpenedColumns(64), + vortex.ReplaceSisByMimc(), + ), + } + ) + + return fullCompilationSuite + } // GetMaxNbCircuitsSum computes MaxNbDecompression + MaxNbExecution from the compiled constraint system From e921ced2cc3a5eaa43877175fbd439a8479e6b4b Mon Sep 17 00:00:00 2001 From: AlexandreBelling Date: Mon, 14 Oct 2024 22:39:48 +0200 Subject: [PATCH 04/12] fix the pi interconnection circuit setup --- prover/circuits/pi-interconnection/circuit.go | 7 ++----- prover/circuits/pi-interconnection/keccak/assign.go | 3 +++ .../pi-interconnection/keccak/customize_keccak.go | 12 +++++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/prover/circuits/pi-interconnection/circuit.go b/prover/circuits/pi-interconnection/circuit.go index 3bd33d7c..ba55c8ab 100644 --- a/prover/circuits/pi-interconnection/circuit.go +++ b/prover/circuits/pi-interconnection/circuit.go @@ -2,7 +2,6 @@ package pi_interconnection import ( "errors" - "fmt" "math/big" "slices" @@ -324,14 +323,12 @@ func (b builder) Compile() (constraint.ConstraintSystem, error) { if err != nil { return nil, err } - const estimatedNbConstraints = 35_000_000 + const estimatedNbConstraints = 1 << 27 cs, err := frontend.Compile(ecc.BLS12_377.ScalarField(), scs.NewBuilder, c.Circuit, frontend.WithCapacity(estimatedNbConstraints)) if err != nil { return nil, err } - if nbC := cs.GetNbConstraints(); nbC > estimatedNbConstraints || estimatedNbConstraints-nbC > 5_000_000 { - return nil, fmt.Errorf("constraint estimate is off; got %d", nbC) - } + return cs, nil } diff --git a/prover/circuits/pi-interconnection/keccak/assign.go b/prover/circuits/pi-interconnection/keccak/assign.go index bc46b8a9..529c64cc 100644 --- a/prover/circuits/pi-interconnection/keccak/assign.go +++ b/prover/circuits/pi-interconnection/keccak/assign.go @@ -12,6 +12,7 @@ import ( "github.com/consensys/gnark/std/compress" "github.com/consensys/linea-monorepo/prover/circuits/internal" "github.com/consensys/linea-monorepo/prover/protocol/wizard" + "github.com/sirupsen/logrus" "golang.org/x/crypto/sha3" ) @@ -87,6 +88,8 @@ func (h *StrictHasherCompiler) Compile(wizardCompilationOpts ...func(iop *wizard nbKeccakF += l/blockNbBytesIn + 1 // extra room for padding } + logrus.Infof("Public-input interconnection requires %v keccak permutations", nbKeccakF) + wc := NewWizardVerifierSubCircuit(nbKeccakF, wizardCompilationOpts...) return CompiledStrictHasher{ diff --git a/prover/circuits/pi-interconnection/keccak/customize_keccak.go b/prover/circuits/pi-interconnection/keccak/customize_keccak.go index b8d1d96d..c503d0df 100644 --- a/prover/circuits/pi-interconnection/keccak/customize_keccak.go +++ b/prover/circuits/pi-interconnection/keccak/customize_keccak.go @@ -1,6 +1,7 @@ package keccak import ( + "github.com/consensys/linea-monorepo/prover/protocol/column" "github.com/consensys/linea-monorepo/prover/protocol/wizard" "github.com/consensys/linea-monorepo/prover/utils" @@ -16,19 +17,24 @@ type module struct { // The correctness of original blocks is checked outside of the module, // where one also should assert that the expected blocks are the same as correct original blocks. func NewCustomizedKeccak(comp *wizard.CompiledIOP, maxNbKeccakF int) *module { + var ( size = utils.NextPowerOfTwo(generic.KeccakUsecase.NbOfLanesPerBlock() * maxNbKeccakF) inp = keccak.KeccakOverBlockInputs{ LaneInfo: keccak.LaneInfo{ - Lanes: comp.InsertCommit(0, "Lane", size), - IsFirstLaneOfNewHash: comp.InsertCommit(0, "IsFirstLaneOfNewHash", size), - IsLaneActive: comp.InsertCommit(0, "IsLaneActive", size), + Lanes: comp.InsertProof(0, "Lane", size), + IsFirstLaneOfNewHash: comp.InsertProof(0, "IsFirstLaneOfNewHash", size), + IsLaneActive: comp.InsertProof(0, "IsLaneActive", size), }, MaxNumKeccakF: maxNbKeccakF, } m = keccak.NewKeccakOverBlocks(comp, inp) ) + + comp.Columns.SetStatus("HASH_OUTPUT_Hash_Lo", column.Proof) + comp.Columns.SetStatus("HASH_OUTPUT_Hash_Hi", column.Proof) + return &module{ keccak: *m, } From 7da9357f09a51fb4f75e61616e33a2adffc57302 Mon Sep 17 00:00:00 2001 From: gusiri Date: Tue, 15 Oct 2024 15:21:19 +0000 Subject: [PATCH 05/12] fix: error flag `maxUsableBytes` is not an int --- prover/circuits/setup_manifest.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/prover/circuits/setup_manifest.go b/prover/circuits/setup_manifest.go index 3a71007b..e5bcad9a 100644 --- a/prover/circuits/setup_manifest.go +++ b/prover/circuits/setup_manifest.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "path" + "strconv" "time" "github.com/consensys/gnark-crypto/ecc" @@ -51,12 +52,19 @@ func (m *SetupManifest) GetInt(key string) (int, error) { return 0, err } - i, ok := v.(int) - if !ok { - return 0, fmt.Errorf("flag `%s` is not an int", key) + switch i := v.(type) { + case int: + return i, nil + case int64: + return int(i), nil + case float64: + return int(i), nil + case string: + // If stored as a string, try to parse it as an int + return strconv.Atoi(i) + default: + return 0, fmt.Errorf("flag `%s` is not an int, got %T", key, v) } - - return i, nil } func (m *SetupManifest) GetString(key string) (string, error) { From 04c6942b3cc9717673561f5f7c5828e26749588a Mon Sep 17 00:00:00 2001 From: AlexandreBelling Date: Tue, 15 Oct 2024 15:43:50 +0000 Subject: [PATCH 06/12] fix(execution): loosen the chainID constraints when there are only legacy txs --- .../execution/pi_wizard_extraction.go | 48 +++++++++++++++++-- .../rlp_txn_fetcher.go | 15 ++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/prover/circuits/execution/pi_wizard_extraction.go b/prover/circuits/execution/pi_wizard_extraction.go index 111187be..cb3ff321 100644 --- a/prover/circuits/execution/pi_wizard_extraction.go +++ b/prover/circuits/execution/pi_wizard_extraction.go @@ -113,12 +113,54 @@ func checkPublicInputs( ) ) + // The way the chainID is extracted is by comparing a length-1 column accessor + // with the content of the transactions RLP. If there is at least one single + // non-legacy transaction, its RLP will contain the chainID (not used by the + // rest of the arithmetization) and the constraint will check that this + // chainID match the one we extract. This consequently ensure that all the + // non-legacy transactions have the same chainID. + // + // In case every transaction of the current batch is a legacy transaction, + // the constraints for the chainID and chainIDNbBytes are loose because there + // nothing to compare with the alleged chainID of the block. In that case, + // we do not impose additional constraint as it means that the same transactions + // would have given the same result regardless of the chainID. The prover + // will "honestly" use 0 as a value for the chainID but this is not enforced. + // + // The problem is that the witness value for `gnarkFuncInp.ChainID` will + // still be the "right" value. And thus, a direct equality constraint would + // not apply. We solve that by conditionning the equality-check to the case + // where the extracted chain-ID is non-zero. + // + // This gives us the following case disjunction. + // + // 1/ Only legacy transactions in the batch: the "fetched" chainID is a free + // value for the prover. + // a) The prover chooses zero => the corresponding public input is again + // a free value + // b) The prover chooses a non-zero value => the public input is enforced + // to be equal to that non-zero value. + // + // In both (1.a) and (1.b) the public value of the chainID is a free value. + // And this is fine because every value of the chainID would have yielded the + // same exectution result. + // + // 2/ There is at least one non-legacy transaction in the batch: the "fetched" + // chainID is the "actual" value. + // a) That chainID is always non-zero as Linea only uses non-zero chain-IDs + // so the corresponding public input is enforced to be equal to it. api.AssertIsEqual( - api.Div( + api.Mul( + api.Sub( + api.Div( + wvc.GetLocalPointEvalParams(wizardFuncInp.ChainID.ID).Y, + twoPow112, + ), + gnarkFuncInp.ChainID, + ), wvc.GetLocalPointEvalParams(wizardFuncInp.ChainID.ID).Y, - twoPow112, ), - gnarkFuncInp.ChainID, + 0, ) api.AssertIsEqual(bridgeAddress, gnarkFuncInp.L2MessageServiceAddr) diff --git a/prover/zkevm/prover/publicInput/fetchers_arithmetization/rlp_txn_fetcher.go b/prover/zkevm/prover/publicInput/fetchers_arithmetization/rlp_txn_fetcher.go index 57b9e135..2028de5f 100644 --- a/prover/zkevm/prover/publicInput/fetchers_arithmetization/rlp_txn_fetcher.go +++ b/prover/zkevm/prover/publicInput/fetchers_arithmetization/rlp_txn_fetcher.go @@ -51,6 +51,21 @@ func ConstrainChainID(comp *wizard.CompiledIOP, fetcher *RlpTxnFetcher, name str // get accessors accChainID := accessors.NewFromPublicColumn(fetcher.ChainID, 0) accNBytesChainID := accessors.NewFromPublicColumn(fetcher.NBytesChainID, 0) + + // The way the chainID is extracted is by comparing a length-1 column accessor + // with the content of the transactions RLP. If there is at least one single + // non-legacy transaction, its RLP will contain the chainID (not used by the + // rest of the arithmetization) and the constraint will check that this + // chainID match the one we extract. This consequently ensure that all the + // non-legacy transactions have the same chainID. + // + // In case every transaction of the current batch is a legacy transaction, + // the constraints for the chainID and chainIDNbBytes are loose because there + // nothing to compare with the alleged chainID of the block. In that case, + // we do not impose additional constraint as it means that the same transactions + // would have given the same result regardless of the chainID. The prover + // will "honestly" use 0 as a value for the chainID but this is not enforced. + // constraint for the ChainID column comp.InsertGlobal( 0, From 1e58dafc177c8ad11582fc078809106482921a25 Mon Sep 17 00:00:00 2001 From: gusiri Date: Tue, 15 Oct 2024 20:33:12 +0000 Subject: [PATCH 07/12] update GetRepoRootPath to include support for deployment path /opt/linea --- prover/lib/compressor/blob/blob.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/prover/lib/compressor/blob/blob.go b/prover/lib/compressor/blob/blob.go index ba5bd8e2..6e7e4105 100644 --- a/prover/lib/compressor/blob/blob.go +++ b/prover/lib/compressor/blob/blob.go @@ -2,6 +2,7 @@ package blob import ( "errors" + "fmt" "os" "path/filepath" "strings" @@ -34,16 +35,24 @@ func DictionaryChecksum(dict []byte, version uint16) ([]byte, error) { return nil, errors.New("unsupported version") } -// GetRepoRootPath assumes that current working directory is within the repo +// GetRepoRootPath returns the root path of the repository func GetRepoRootPath() (string, error) { + // First, check if the deployment path exists + deploymentPath := "/opt/linea" + if _, err := os.Stat(deploymentPath); err == nil { + return deploymentPath, nil + } + + // If not found, fall back to checking the local development path based on the current directory wd, err := os.Getwd() if err != nil { return "", err } + const repoName = "linea-monorepo" i := strings.LastIndex(wd, repoName) if i == -1 { - return "", errors.New("could not find repo root") + return "", fmt.Errorf("could not find repo root. Current working directory: %s", wd) } i += len(repoName) return wd[:i], nil From 5e98461593035d5942d929cf8555660dae8dfb7a Mon Sep 17 00:00:00 2001 From: gusiri Date: Tue, 15 Oct 2024 20:39:18 +0000 Subject: [PATCH 08/12] use errors.New instead of fmt.Errorf --- prover/lib/compressor/blob/blob.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/prover/lib/compressor/blob/blob.go b/prover/lib/compressor/blob/blob.go index 6e7e4105..5f6d7dd9 100644 --- a/prover/lib/compressor/blob/blob.go +++ b/prover/lib/compressor/blob/blob.go @@ -2,7 +2,6 @@ package blob import ( "errors" - "fmt" "os" "path/filepath" "strings" @@ -52,7 +51,7 @@ func GetRepoRootPath() (string, error) { const repoName = "linea-monorepo" i := strings.LastIndex(wd, repoName) if i == -1 { - return "", fmt.Errorf("could not find repo root. Current working directory: %s", wd) + return "", errors.New("could not find repo root. Current working directory: " + wd) } i += len(repoName) return wd[:i], nil From b5e91abddb5da86c4801caaaf54004a573216918 Mon Sep 17 00:00:00 2001 From: gusiri Date: Wed, 16 Oct 2024 10:15:19 +0000 Subject: [PATCH 09/12] fix FinalStateRootHash --- prover/backend/aggregation/craft.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/backend/aggregation/craft.go b/prover/backend/aggregation/craft.go index 13059dbb..fa92d9ec 100644 --- a/prover/backend/aggregation/craft.go +++ b/prover/backend/aggregation/craft.go @@ -112,7 +112,7 @@ func collectFields(cfg *config.Config, req *Request) (*CollectedFields, error) { finalBlock := &po.BlocksData[len(po.BlocksData)-1] piq, err := public_input.ExecutionSerializable{ L2MsgHashes: l2MessageHashes, - FinalStateRootHash: po.PublicInput.Hex(), // TODO @tabaie make sure this is the right value + FinalStateRootHash: finalBlock.RootHash.Hex(), FinalBlockNumber: uint64(cf.FinalBlockNumber), FinalBlockTimestamp: finalBlock.TimeStamp, FinalRollingHash: cf.L1RollingHash, From b91ff20da2c88f4e8b324aeb6acef53d2021faf7 Mon Sep 17 00:00:00 2001 From: gusiri Date: Wed, 16 Oct 2024 10:23:30 +0000 Subject: [PATCH 10/12] fix consistency check for FinalRollingHash --- prover/circuits/pi-interconnection/assign.go | 30 ++++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/prover/circuits/pi-interconnection/assign.go b/prover/circuits/pi-interconnection/assign.go index 4c1139f9..8666febb 100644 --- a/prover/circuits/pi-interconnection/assign.go +++ b/prover/circuits/pi-interconnection/assign.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/base64" "errors" + "fmt" "hash" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" @@ -121,7 +122,7 @@ func (c *Compiled) Assign(r Request) (a Circuit, err error) { } if prevShnarf = shnarf.Compute(); !bytes.Equal(prevShnarf, shnarfs[i]) { - err = errors.New("shnarf mismatch") + err = fmt.Errorf("shnarf mismatch, i:%d, shnarf: %x, prevShnarf: %x, ", i, shnarfs[i], prevShnarf) return } } @@ -216,13 +217,30 @@ func (c *Compiled) Assign(r Request) (a Circuit, err error) { a.ExecutionFPIQ[i] = executionFPI.ToSnarkType().FunctionalPublicInputQSnark } // consistency check - if executionFPI.FinalBlockTimestamp != aggregationFPI.FinalBlockTimestamp || - executionFPI.FinalBlockNumber != aggregationFPI.FinalBlockNumber || - executionFPI.FinalRollingHash != aggregationFPI.FinalRollingHash || - executionFPI.FinalRollingHashNumber != aggregationFPI.FinalRollingHashNumber { - err = errors.New("final execution values not matching final aggregation values") + if executionFPI.FinalBlockTimestamp != aggregationFPI.FinalBlockTimestamp { + err = fmt.Errorf("final block timestamps do not match: execution=%x, aggregation=%x", + executionFPI.FinalBlockTimestamp, aggregationFPI.FinalBlockTimestamp) return } + if executionFPI.FinalBlockNumber != aggregationFPI.FinalBlockNumber { + err = fmt.Errorf("final block numbers do not match: execution=%v, aggregation=%x", + executionFPI.FinalBlockNumber, aggregationFPI.FinalBlockNumber) + return + } + if executionFPI.FinalRollingHash != [32]byte{} { + if executionFPI.FinalRollingHash != aggregationFPI.FinalRollingHash { + err = fmt.Errorf("final rolling hashes do not match: execution=%x, aggregation=%x", + executionFPI.FinalRollingHash, aggregationFPI.FinalRollingHash) + return + } + + if executionFPI.FinalRollingHashNumber != aggregationFPI.FinalRollingHashNumber { + err = fmt.Errorf("final rolling hash numbers do not match: execution=%v, aggregation=%v", + executionFPI.FinalRollingHashNumber, aggregationFPI.FinalRollingHashNumber) + return + } + } + if len(l2MessageHashes) > maxNbL2MessageHashes { err = errors.New("too many L2 messages") return From 4cdf2987e545b4af6e685b4243ad490db1316ad8 Mon Sep 17 00:00:00 2001 From: gusiri Date: Wed, 16 Oct 2024 10:55:54 +0000 Subject: [PATCH 11/12] fix L2MsgHashes --- prover/backend/aggregation/craft.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/prover/backend/aggregation/craft.go b/prover/backend/aggregation/craft.go index fa92d9ec..a5b99379 100644 --- a/prover/backend/aggregation/craft.go +++ b/prover/backend/aggregation/craft.go @@ -39,9 +39,9 @@ const ( func collectFields(cfg *config.Config, req *Request) (*CollectedFields, error) { var ( - l2MessageHashes []string - l2MsgBlockOffsets []bool - cf = &CollectedFields{ + allL2MessageHashes []string + l2MsgBlockOffsets []bool + cf = &CollectedFields{ L2MsgTreeDepth: l2MsgMerkleTreeDepth, ParentAggregationLastBlockTimestamp: uint(req.ParentAggregationLastBlockTimestamp), LastFinalizedL1RollingHash: req.ParentAggregationLastL1RollingHash, @@ -55,9 +55,10 @@ func collectFields(cfg *config.Config, req *Request) (*CollectedFields, error) { for i, execReqFPath := range req.ExecutionProofs { var ( - po = &execution.Response{} - fpath = path.Join(cfg.Execution.DirTo(), execReqFPath) - f = files.MustRead(fpath) + po = &execution.Response{} + l2MessageHashes []string + fpath = path.Join(cfg.Execution.DirTo(), execReqFPath) + f = files.MustRead(fpath) ) if err := json.NewDecoder(f).Decode(po); err != nil { @@ -166,7 +167,7 @@ func collectFields(cfg *config.Config, req *Request) (*CollectedFields, error) { } cf.L2MessagingBlocksOffsets = utils.HexEncodeToString(PackOffsets(l2MsgBlockOffsets)) - cf.L2MsgRootHashes = PackInMiniTrees(l2MessageHashes) + cf.L2MsgRootHashes = PackInMiniTrees(allL2MessageHashes) return cf, nil From 77ed108d22e19db2383eb4e47d83199378b0b11c Mon Sep 17 00:00:00 2001 From: gusiri Date: Tue, 22 Oct 2024 12:31:49 +0000 Subject: [PATCH 12/12] remove unused fmt --- kzgsrs/.gitignore | 7 +++++++ prover/circuits/pi-interconnection/circuit.go | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 kzgsrs/.gitignore diff --git a/kzgsrs/.gitignore b/kzgsrs/.gitignore new file mode 100644 index 00000000..51cbb0b6 --- /dev/null +++ b/kzgsrs/.gitignore @@ -0,0 +1,7 @@ +# Ignore everything +* + +# But not these files... +!.gitignore +!kzg_srs_canonical_259_bn254_aztec.memdump +!kzg_srs_canonical_259_bls12377_aleo.memdump diff --git a/prover/circuits/pi-interconnection/circuit.go b/prover/circuits/pi-interconnection/circuit.go index 83d62286..67606765 100644 --- a/prover/circuits/pi-interconnection/circuit.go +++ b/prover/circuits/pi-interconnection/circuit.go @@ -2,7 +2,6 @@ package pi_interconnection import ( "errors" - "fmt" "math" "math/big" "slices"