From 5d8579a6093c223f66ace58ebfc3adc44249d6a6 Mon Sep 17 00:00:00 2001 From: arnaucube Date: Thu, 4 Mar 2021 19:54:04 +0100 Subject: [PATCH] Fix TxSel discard tx when ProcessL2Tx gives err Refactor getL1L2TxSelection, which fixes some problems for certain combinations of txs. --- common/accountcreationauths.go | 18 +-- test/txsets/tilsets.go | 16 ++- test/zkproof/flows_test.go | 8 +- txprocessor/txprocessor.go | 6 +- txprocessor/txprocessor_test.go | 16 +-- txprocessor/zkinputsgen_test.go | 28 ++-- txselector/txselector.go | 244 +++++++++++++++++++------------- txselector/txselector_test.go | 114 ++++++++++++--- 8 files changed, 294 insertions(+), 156 deletions(-) diff --git a/common/accountcreationauths.go b/common/accountcreationauths.go index 522269a..5c0605a 100644 --- a/common/accountcreationauths.go +++ b/common/accountcreationauths.go @@ -11,15 +11,15 @@ import ( "github.com/iden3/go-iden3-crypto/babyjub" ) -// AccountCreationAuthMsg is the message that is signed to authorize a Hermez -// account creation -const AccountCreationAuthMsg = "Account creation" - -// EIP712Version is the used version of the EIP-712 -const EIP712Version = "1" - -// EIP712Provider defines the Provider for the EIP-712 -const EIP712Provider = "Hermez Network" +const ( + // AccountCreationAuthMsg is the message that is signed to authorize a + // Hermez account creation + AccountCreationAuthMsg = "Account creation" + // EIP712Version is the used version of the EIP-712 + EIP712Version = "1" + // EIP712Provider defines the Provider for the EIP-712 + EIP712Provider = "Hermez Network" +) var ( // EmptyEthSignature is an ethereum signature of all zeroes diff --git a/test/txsets/tilsets.go b/test/txsets/tilsets.go index 0cc8a19..86baedb 100644 --- a/test/txsets/tilsets.go +++ b/test/txsets/tilsets.go @@ -212,6 +212,17 @@ PoolTransferToBJJ(1) A-C: 3 (1) // SetBlockchainMinimumFlow0 contains a set of transactions with a minimal flow var SetBlockchainMinimumFlow0 = ` Type: Blockchain +// Idxs: +// 256: A(0) +// 257: C(1) +// 258: A(1) +// 259: B(0) +// 260: D(0) +// 261: Coord(1) +// 262: Coord(0) +// 263: B(1) +// 264: C(0) +// 265: F(0) AddToken(1) @@ -255,10 +266,11 @@ CreateAccountDeposit(0) D: 800 // C(0): 0 // Coordinator creates needed accounts to receive Fees -CreateAccountCoordinator(1) Coord -CreateAccountCoordinator(0) Coord // Coordinator creates needed 'To' accounts for the L2Txs +// sorted in the way that the TxSelector creates them +CreateAccountCoordinator(1) Coord CreateAccountCoordinator(1) B +CreateAccountCoordinator(0) Coord CreateAccountCoordinator(0) C diff --git a/test/zkproof/flows_test.go b/test/zkproof/flows_test.go index 9418c75..f697794 100644 --- a/test/zkproof/flows_test.go +++ b/test/zkproof/flows_test.go @@ -186,7 +186,7 @@ func TestTxSelectorBatchBuilderZKInputsMinimumFlow0(t *testing.T) { zki, err := bb.BuildBatch(coordIdxs, configBatch, oL1UserTxs, oL1CoordTxs, oL2Txs) require.NoError(t, err) assert.Equal(t, - "3844339393304253264418296322137281996442345663805792718218845145754742722151", + "4392049343656836675348565048374261353937130287163762821533580216441778455298", bb.LocalStateDB().MT.Root().BigInt().String()) sendProofAndCheckResp(t, zki) err = l2DBTxSel.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), @@ -215,7 +215,7 @@ func TestTxSelectorBatchBuilderZKInputsMinimumFlow0(t *testing.T) { zki, err = bb.BuildBatch(coordIdxs, configBatch, oL1UserTxs, oL1CoordTxs, oL2Txs) require.NoError(t, err) assert.Equal(t, - "2537294203394018451170116789946369404362093672592091326351037700505720139801", + "8905191229562583213069132470917469035834300549892959854483573322676101624713", bb.LocalStateDB().MT.Root().BigInt().String()) sendProofAndCheckResp(t, zki) err = l2DBTxSel.StartForging(common.TxIDsFromPoolL2Txs(l2Txs), @@ -242,7 +242,7 @@ func TestTxSelectorBatchBuilderZKInputsMinimumFlow0(t *testing.T) { zki, err = bb.BuildBatch(coordIdxs, configBatch, oL1UserTxs, oL1CoordTxs, oL2Txs) require.NoError(t, err) assert.Equal(t, - "13463929859122729344499006353544877221550995454069650137270994940730475267399", + "20593679664586247774284790801579542411781976279024409415159440382607791042723", bb.LocalStateDB().MT.Root().BigInt().String()) sendProofAndCheckResp(t, zki) err = l2DBTxSel.StartForging(common.TxIDsFromPoolL2Txs(l2Txs), @@ -264,7 +264,7 @@ func TestTxSelectorBatchBuilderZKInputsMinimumFlow0(t *testing.T) { // same root as previous batch, as the L1CoordinatorTxs created by the // Til set is not created by the TxSelector in this test assert.Equal(t, - "13463929859122729344499006353544877221550995454069650137270994940730475267399", + "20593679664586247774284790801579542411781976279024409415159440382607791042723", bb.LocalStateDB().MT.Root().BigInt().String()) sendProofAndCheckResp(t, zki) err = l2DBTxSel.StartForging(common.TxIDsFromPoolL2Txs(l2Txs), diff --git a/txprocessor/txprocessor.go b/txprocessor/txprocessor.go index db9810f..5aebd28 100644 --- a/txprocessor/txprocessor.go +++ b/txprocessor/txprocessor.go @@ -732,13 +732,13 @@ func (tp *TxProcessor) ProcessL2Tx(coordIdxsMap map[common.TokenID]common.Idx, // if tx.ToIdx==0, get toIdx by ToEthAddr or ToBJJ if tx.ToIdx == common.Idx(0) && tx.AuxToIdx == common.Idx(0) { if tp.s.Type() == statedb.TypeSynchronizer { - // thisTypeould never be reached + // this in TypeSynchronizer should never be reached log.Error("WARNING: In StateDB with Synchronizer mode L2.ToIdx can't be 0") return nil, nil, false, tracerr.Wrap(fmt.Errorf("In StateDB with Synchronizer mode L2.ToIdx can't be 0")) } - // case when tx.Type== common.TxTypeTransferToEthAddr or common.TxTypeTransferToBJJ - + // case when tx.Type == common.TxTypeTransferToEthAddr or + // common.TxTypeTransferToBJJ: accSender, err := tp.s.GetAccount(tx.FromIdx) if err != nil { return nil, nil, false, tracerr.Wrap(err) diff --git a/txprocessor/txprocessor_test.go b/txprocessor/txprocessor_test.go index 4c3b57b..8ef33f0 100644 --- a/txprocessor/txprocessor_test.go +++ b/txprocessor/txprocessor_test.go @@ -218,7 +218,7 @@ func TestProcessTxsBalances(t *testing.T) { assert.NoError(t, err) chainID := uint16(0) - // generate test transactions from test.SetBlockchain0 code + // generate test transactions from test.SetBlockchainMinimumFlow0 code tc := til.NewContext(chainID, common.RollupConstMaxL1UserTx) blocks, err := tc.GenerateBlocks(txsets.SetBlockchainMinimumFlow0) require.NoError(t, err) @@ -288,7 +288,7 @@ func TestProcessTxsBalances(t *testing.T) { "9061858435528794221929846392270405504056106238451760714188625065949729889651", tp.s.MT.Root().BigInt().String()) - coordIdxs := []common.Idx{261, 262} + coordIdxs := []common.Idx{261, 263} log.Debug("block:0 batch:7") l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[6].Batch.ForgeL1TxsNum]) l2Txs = common.L2TxsToPoolL2Txs(blocks[0].Rollup.Batches[6].L2Txs) @@ -303,7 +303,7 @@ func TestProcessTxsBalances(t *testing.T) { checkBalance(t, tc, sdb, "C", 0, "100") checkBalance(t, tc, sdb, "D", 0, "800") assert.Equal(t, - "3844339393304253264418296322137281996442345663805792718218845145754742722151", + "4392049343656836675348565048374261353937130287163762821533580216441778455298", tp.s.MT.Root().BigInt().String()) log.Debug("block:0 batch:8") @@ -321,7 +321,7 @@ func TestProcessTxsBalances(t *testing.T) { checkBalance(t, tc, sdb, "C", 1, "100") checkBalance(t, tc, sdb, "D", 0, "800") assert.Equal(t, - "2537294203394018451170116789946369404362093672592091326351037700505720139801", + "8905191229562583213069132470917469035834300549892959854483573322676101624713", tp.s.MT.Root().BigInt().String()) coordIdxs = []common.Idx{262} @@ -330,8 +330,8 @@ func TestProcessTxsBalances(t *testing.T) { l2Txs = common.L2TxsToPoolL2Txs(blocks[1].Rollup.Batches[0].L2Txs) _, err = tp.ProcessTxs(coordIdxs, l1UserTxs, blocks[1].Rollup.Batches[0].L1CoordinatorTxs, l2Txs) require.NoError(t, err) - checkBalance(t, tc, sdb, "Coord", 0, "75") checkBalance(t, tc, sdb, "Coord", 1, "30") + checkBalance(t, tc, sdb, "Coord", 0, "35") checkBalance(t, tc, sdb, "A", 0, "730") checkBalance(t, tc, sdb, "A", 1, "280") checkBalance(t, tc, sdb, "B", 0, "380") @@ -340,7 +340,7 @@ func TestProcessTxsBalances(t *testing.T) { checkBalance(t, tc, sdb, "C", 1, "100") checkBalance(t, tc, sdb, "D", 0, "470") assert.Equal(t, - "13463929859122729344499006353544877221550995454069650137270994940730475267399", + "12063160053709941400160547588624831667157042937323422396363359123696668555050", tp.s.MT.Root().BigInt().String()) coordIdxs = []common.Idx{} @@ -350,7 +350,7 @@ func TestProcessTxsBalances(t *testing.T) { _, err = tp.ProcessTxs(coordIdxs, l1UserTxs, blocks[1].Rollup.Batches[1].L1CoordinatorTxs, l2Txs) require.NoError(t, err) assert.Equal(t, - "21058792089669864857092637997959333050678445584244682889041632034478049099916", + "20375835796927052406196249140510136992262283055544831070430919054949353249481", tp.s.MT.Root().BigInt().String()) // use Set of PoolL2 txs @@ -359,8 +359,8 @@ func TestProcessTxsBalances(t *testing.T) { _, err = tp.ProcessTxs(coordIdxs, []common.L1Tx{}, []common.L1Tx{}, poolL2Txs) require.NoError(t, err) - checkBalance(t, tc, sdb, "Coord", 0, "75") checkBalance(t, tc, sdb, "Coord", 1, "30") + checkBalance(t, tc, sdb, "Coord", 0, "35") checkBalance(t, tc, sdb, "A", 0, "510") checkBalance(t, tc, sdb, "A", 1, "170") checkBalance(t, tc, sdb, "B", 0, "480") diff --git a/txprocessor/zkinputsgen_test.go b/txprocessor/zkinputsgen_test.go index c5abca3..03f239b 100644 --- a/txprocessor/zkinputsgen_test.go +++ b/txprocessor/zkinputsgen_test.go @@ -855,24 +855,24 @@ func TestZKInputs6(t *testing.T) { require.NoError(t, err) // Coordinator Idx where to send the fees - coordIdxs := []common.Idx{261, 262} + coordIdxs := []common.Idx{261, 263} l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[6].Batch.ForgeL1TxsNum]) l2Txs = poolL2Txs ptOut, err = tp.ProcessTxs(coordIdxs, l1UserTxs, blocks[0].Rollup.Batches[6].L1CoordinatorTxs, l2Txs) require.NoError(t, err) assert.Equal(t, - "3844339393304253264418296322137281996442345663805792718218845145754742722151", + "4392049343656836675348565048374261353937130287163762821533580216441778455298", sdb.MT.Root().BigInt().String()) h, err = ptOut.ZKInputs.HashGlobalData() require.NoError(t, err) assert.Equal(t, - "5032718856148451421545185380036766915168034966925659381828133541616492724034", + "16933045224569170916286405531152273569266691791699589574035702855645450977474", h.String()) s, err = json.Marshal(ptOut.ZKInputs) require.NoError(t, err) // the 'expected' data has been checked with the circom circuits - expected = `{"amountF":["0","0","0","0","0","200","100","0","0","0","0"],"auxFromIdx":["260","261","262","263","264","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","263","264","0","0","0","0"],"ay1":["7299054315324763317564375227723527917820889071879589087797584828752306403468","13127348242808033949662858905093082484882988923889598397206419708399907983738","13127348242808033949662858905093082484882988923889598397206419708399907983738","21759653464180282217133439550283093276794317614482080451288933258136700169296","20534271334408079873799448508761237599936782740731511933526664305820108254173","14382649545529405976710664157356364657039027681269256663271478725131562622080","21759653464180282217133439550283093276794317614482080451288933258136700169296","0","0","0","0"],"ay2":["0","0","0","0","0","21759653464180282217133439550283093276794317614482080451288933258136700169296","20534271334408079873799448508761237599936782740731511933526664305820108254173","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0"],"balance1":["800","0","0","0","0","500","400","0","0","0","0"],"balance2":["0","0","0","0","0","0","0","0","0","0","0"],"balance3":["0","0","0","0"],"currentNumBatch":"7","ethAddr1":["1288347612158191397270705234830805381732297126518","176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","721457446580647751014191829380889690493307935711","247512291986854564435551364600938690683113101007","0","0","0","0"],"ethAddr2":["0","0","0","0","0","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","0","0"],"feeIdxs":["261","262","0","0"],"feePlanTokens":["1","0","0","0"],"fromBjjCompressed":[["0","0","1","1","0","0","0","1","0","0","0","1","1","1","1","0","0","0","1","1","1","0","1","0","1","1","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","1","0","1","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","1","1","1","0","0","1","1","0","1","1","1","1","1","1","0","0","1","0","1","1","0","1","0","0","1","1","0","1","0","0","0","0","1","1","0","0","1","0","1","1","0","0","0","0","1","1","0","0","1","1","1","1","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","1","1","1","1","1","0","0","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","1","0","0","1","0","1","1","1","1","0","1","0","1","0","0","1","1","1","1","1","0","1","1","0","1","1","0","0","0","1","1","0","1","0","0","1","0","0","1","1","0","1","1","0","0","1","1","1","0","1","0","0","1","0","0","1","1","1","1","0","0","0","1","1","0","0","0","1","0","0","0","0","0","0","1","0","0","0"],["0","1","0","1","1","1","1","0","1","0","0","0","1","0","1","0","1","1","0","1","1","0","1","0","0","0","1","0","1","0","1","0","0","0","0","0","0","1","1","1","0","1","1","1","1","1","1","0","1","1","0","0","1","1","0","1","1","0","1","0","1","0","0","0","1","1","1","1","1","0","1","1","1","1","0","1","1","1","0","0","1","1","1","0","0","1","0","0","0","0","0","0","0","1","1","0","0","1","1","1","1","0","0","0","1","0","0","0","0","1","1","0","0","1","0","1","0","1","1","0","0","1","1","0","1","1","1","0","0","0","0","0","0","0","1","0","0","0","0","0","1","0","1","0","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","0","0","0","1","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","1","0","1","0","0","0","0","0","1","0","1","1","1","0","0","0"],["0","1","0","1","1","1","1","0","1","0","0","0","1","0","1","0","1","1","0","1","1","0","1","0","0","0","1","0","1","0","1","0","0","0","0","0","0","1","1","1","0","1","1","1","1","1","1","0","1","1","0","0","1","1","0","1","1","0","1","0","1","0","0","0","1","1","1","1","1","0","1","1","1","1","0","1","1","1","0","0","1","1","1","0","0","1","0","0","0","0","0","0","0","1","1","0","0","1","1","1","1","0","0","0","1","0","0","0","0","1","1","0","0","1","0","1","0","1","1","0","0","1","1","0","1","1","1","0","0","0","0","0","0","0","1","0","0","0","0","0","1","0","1","0","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","0","0","0","1","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","1","0","1","0","0","0","0","0","1","0","1","1","1","0","0","0"],["0","0","0","0","1","0","1","0","0","0","1","1","0","1","0","1","1","0","0","0","0","1","0","0","0","1","1","1","0","0","1","1","0","1","1","1","0","0","1","1","0","0","1","1","0","1","1","0","1","0","0","1","1","0","0","0","0","1","0","1","1","0","1","0","1","0","0","0","0","1","1","1","1","1","1","1","0","1","0","0","0","1","1","1","0","1","0","0","1","1","1","0","0","1","1","0","0","0","0","0","0","0","0","0","1","0","0","0","1","0","0","0","0","0","1","0","0","0","0","1","1","1","1","0","1","1","0","1","1","0","0","1","0","1","0","0","1","0","0","1","0","1","1","0","1","0","1","0","0","1","1","1","1","0","0","1","0","0","0","0","1","0","1","0","0","1","1","0","0","1","1","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","0","0","1","1","1","0","1","0","1","1","1","0","1","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","1","0","1","0","0","1","0","0","0","0","0","1","1","1","0","0","0","0","1","1","1","0","1","1","0","0","0","0","0","0","0","1","1","0","0"],["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["1288347612158191397270705234830805381732297126518","176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","0","0","0","0","0","0"],"fromIdx":["0","0","0","0","0","258","259","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["20","0","0","0"],["20","10","0","0"],["20","10","0","0"],["20","10","0","0"],["20","10","0","0"]],"imExitRoot":["0","0","0","0","0","0","0","0","0","0"],"imFinalAccFee":["20","10","0","0"],"imInitStateRootFee":"9264891848458439618071357719656461211628069425317874868021844444878856898399","imOnChain":["1","1","1","1","1","0","0","0","0","0"],"imOutIdx":["260","261","262","263","264","264","264","264","264","264"],"imStateRoot":["8055843862775304254706568826463499646250013231089379492032756142632539485910","6440734492684925103504435324083111099059468455159698803777795430519320156387","21452219376435241432072602013960710870309744626145479150675736859477461906863","21068186551972556894162938826694175789298149483374676659776659521442270963772","6370270960021792166820680314461259438164571266526274352799603144473364936960","8225652099817380302793739526473515233591144104863148612732274167066689180859","9264891848458439618071357719656461211628069425317874868021844444878856898399","9264891848458439618071357719656461211628069425317874868021844444878856898399","9264891848458439618071357719656461211628069425317874868021844444878856898399","9264891848458439618071357719656461211628069425317874868021844444878856898399"],"imStateRootFee":["19699183959938485873171858977723258211938792566994200408153848064081326480819","3844339393304253264418296322137281996442345663805792718218845145754742722151","3844339393304253264418296322137281996442345663805792718218845145754742722151"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","0","0","0","0","0","0","0","0"],"loadAmountF":["800","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["1","1","1","1","1","0","0","0","0","0","0"],"newExit":["0","0","0","0","0","0","0","0","0","0","0"],"nonce1":["0","0","0","0","0","0","0","0","0","0","0"],"nonce2":["0","0","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["256","257","258","259","256","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"259","oldStateRoot":"9061858435528794221929846392270405504056106238451760714188625065949729889651","oldValue1":["6562150729229138743267014455891184273725543385273447095310127546128519424449","2922089750045328070912118133388673780503526961997250912389906760012441956739","19421590014860408017031009388212071206394178842142297789395859339862413023436","21249140223342182448031284949669740061229572538781098063822693710701073699774","6562150729229138743267014455891184273725543385273447095310127546128519424449","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","1","1","1","1","0","0","0","0","0","0"],"r8x":["0","0","0","0","0","8770607706668248359945566576303935616256160265651383435960480211364357546112","17262037212461398576365522795088670538843993587203604546876447958120541451621","0","0","0","0"],"r8y":["0","0","0","0","0","12311093168939799397001823764682802643621697334938201583983933572943934371028","569635881931475424289735109573228576314932933558639111262539597035286146201","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","0","1191222821583579210553734313486151664513131537567645746568450777927266616354","233823659238401174531419568367279478352512368281766259271702380652050530855","0","0","0","0"],"siblings1":[["19677433422546073304881045118354145314800019963824870333445601305998583462671","10972626243456729342705938923671683591346073099827296619717726184311017773643","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["314380649644034437497614645111544018494756142166059028559280780414545104685","2137207421531663714413080941127393343547214451331189124229908005951387501300","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["8815033147089566264192433432193552302111477712729353545932093180903883923584","12518700578932768688965291105493517842195670873964632084733004769915655162566","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18066100894410907964841410101182807379395812836906673171641405528362719538209","2199003480782397842508894964778228853972027960419082805229304997775258699423","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["2376478495646287582478786841402412517699665953553740168081121112759811106691","15663772269976705627267474400626040176987302151947710638737448399637949184881","18415507397039526176679688506579114602308891419321366426899227563735979799040","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["2376478495646287582478786841402412517699665953553740168081121112759811106691","19792116367207470577093418522642680102063643343783661189577437171467838431223","19307560849761729463770968061597021911167109453432076609490038412937692947799","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["7664484966130005934815236256384756754143258683615817930413384902479009199637","2199003480782397842508894964778228853972027960419082805229304997775258699423","7365164883308398622788453558162720347322356828640213809219966010831422962435","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["7664484966130005934815236256384756754143258683615817930413384902479009199637","2199003480782397842508894964778228853972027960419082805229304997775258699423","2137207421531663714413080941127393343547214451331189124229908005951387501300","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["2098804401681382335640464124345600625431975858469464592225207345019855174774","2912821412685382830222636674974752345530081870580498213760801666905880536817","18415507397039526176679688506579114602308891419321366426899227563735979799040","12482543472932494767369915162702586718952672410215622757039325707968621010863","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["9851105835717610960267662993797029865749034859980819616128328389512568067131","6529772194532068610437560953547428755501917832290185146229575380889792777425","6925334635958825334942359093560850539634901248387497427591330889995136411874","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["775451500470189483763286938669998278945473916117098080622798346273962730711","11405130300736863300336855117644104129642673288799313243396259520585364858599","6797559045384535081852691020171750614120022792545883159476356649291644130253","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"toEthAddr":["0","0","0","0","0","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","0","0","0","0"],"toIdx":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID1":["0","1","0","1","0","1","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","1","0","0","0","0","0"],"tokenID3":["1","0","0","0"],"txCompressedData":["3322668559","22300745198530623141535718272648364828648975","3322668559","22300745198530623141535718272648364828648975","3322668559","13269348750238205523937693788887673002803923556187533286952003167759","13269348750238205523937671488142474472180782020469260920065473897999","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","0","51833393555617990327881616362842488512835329244224786936933384450","51833393555617990327881529250556548829772431193891525049876218115","0","0","0","0"]}` //nolint:lll + expected = `{"amountF":["0","0","0","0","0","200","100","0","0","0","0"],"auxFromIdx":["260","261","262","263","264","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","262","264","0","0","0","0"],"ay1":["7299054315324763317564375227723527917820889071879589087797584828752306403468","13127348242808033949662858905093082484882988923889598397206419708399907983738","21759653464180282217133439550283093276794317614482080451288933258136700169296","13127348242808033949662858905093082484882988923889598397206419708399907983738","20534271334408079873799448508761237599936782740731511933526664305820108254173","14382649545529405976710664157356364657039027681269256663271478725131562622080","21759653464180282217133439550283093276794317614482080451288933258136700169296","0","0","0","0"],"ay2":["0","0","0","0","0","21759653464180282217133439550283093276794317614482080451288933258136700169296","20534271334408079873799448508761237599936782740731511933526664305820108254173","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0"],"balance1":["800","0","0","0","0","500","400","0","0","0","0"],"balance2":["0","0","0","0","0","0","0","0","0","0","0"],"balance3":["0","0","0","0"],"currentNumBatch":"7","ethAddr1":["1288347612158191397270705234830805381732297126518","176962662172908264953938498278848696642639144728","247512291986854564435551364600938690683113101007","176962662172908264953938498278848696642639144728","594179275863704165266696689399235767493667371625","721457446580647751014191829380889690493307935711","247512291986854564435551364600938690683113101007","0","0","0","0"],"ethAddr2":["0","0","0","0","0","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","0","0"],"feeIdxs":["261","263","0","0"],"feePlanTokens":["1","0","0","0"],"fromBjjCompressed":[["0","0","1","1","0","0","0","1","0","0","0","1","1","1","1","0","0","0","1","1","1","0","1","0","1","1","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","1","0","1","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","1","1","1","0","0","1","1","0","1","1","1","1","1","1","0","0","1","0","1","1","0","1","0","0","1","1","0","1","0","0","0","0","1","1","0","0","1","0","1","1","0","0","0","0","1","1","0","0","1","1","1","1","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","1","1","1","1","1","0","0","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","1","0","0","1","0","1","1","1","1","0","1","0","1","0","0","1","1","1","1","1","0","1","1","0","1","1","0","0","0","1","1","0","1","0","0","1","0","0","1","1","0","1","1","0","0","1","1","1","0","1","0","0","1","0","0","1","1","1","1","0","0","0","1","1","0","0","0","1","0","0","0","0","0","0","1","0","0","0"],["0","1","0","1","1","1","1","0","1","0","0","0","1","0","1","0","1","1","0","1","1","0","1","0","0","0","1","0","1","0","1","0","0","0","0","0","0","1","1","1","0","1","1","1","1","1","1","0","1","1","0","0","1","1","0","1","1","0","1","0","1","0","0","0","1","1","1","1","1","0","1","1","1","1","0","1","1","1","0","0","1","1","1","0","0","1","0","0","0","0","0","0","0","1","1","0","0","1","1","1","1","0","0","0","1","0","0","0","0","1","1","0","0","1","0","1","0","1","1","0","0","1","1","0","1","1","1","0","0","0","0","0","0","0","1","0","0","0","0","0","1","0","1","0","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","0","0","0","1","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","1","0","1","0","0","0","0","0","1","0","1","1","1","0","0","0"],["0","0","0","0","1","0","1","0","0","0","1","1","0","1","0","1","1","0","0","0","0","1","0","0","0","1","1","1","0","0","1","1","0","1","1","1","0","0","1","1","0","0","1","1","0","1","1","0","1","0","0","1","1","0","0","0","0","1","0","1","1","0","1","0","1","0","0","0","0","1","1","1","1","1","1","1","0","1","0","0","0","1","1","1","0","1","0","0","1","1","1","0","0","1","1","0","0","0","0","0","0","0","0","0","1","0","0","0","1","0","0","0","0","0","1","0","0","0","0","1","1","1","1","0","1","1","0","1","1","0","0","1","0","1","0","0","1","0","0","1","0","1","1","0","1","0","1","0","0","1","1","1","1","0","0","1","0","0","0","0","1","0","1","0","0","1","1","0","0","1","1","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","0","0","1","1","1","0","1","0","1","1","1","0","1","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","1","0","1","0","0","1","0","0","0","0","0","1","1","1","0","0","0","0","1","1","1","0","1","1","0","0","0","0","0","0","0","1","1","0","0"],["0","1","0","1","1","1","1","0","1","0","0","0","1","0","1","0","1","1","0","1","1","0","1","0","0","0","1","0","1","0","1","0","0","0","0","0","0","1","1","1","0","1","1","1","1","1","1","0","1","1","0","0","1","1","0","1","1","0","1","0","1","0","0","0","1","1","1","1","1","0","1","1","1","1","0","1","1","1","0","0","1","1","1","0","0","1","0","0","0","0","0","0","0","1","1","0","0","1","1","1","1","0","0","0","1","0","0","0","0","1","1","0","0","1","0","1","0","1","1","0","0","1","1","0","1","1","1","0","0","0","0","0","0","0","1","0","0","0","0","0","1","0","1","0","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","0","0","0","1","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","1","0","1","0","0","0","0","0","1","0","1","1","1","0","0","0"],["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["1288347612158191397270705234830805381732297126518","176962662172908264953938498278848696642639144728","247512291986854564435551364600938690683113101007","176962662172908264953938498278848696642639144728","594179275863704165266696689399235767493667371625","0","0","0","0","0","0"],"fromIdx":["0","0","0","0","0","258","259","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["20","0","0","0"],["20","10","0","0"],["20","10","0","0"],["20","10","0","0"],["20","10","0","0"]],"imExitRoot":["0","0","0","0","0","0","0","0","0","0"],"imFinalAccFee":["20","10","0","0"],"imInitStateRootFee":"21568970628531903183192590637378661071540070590973406609839025437699471470737","imOnChain":["1","1","1","1","1","0","0","0","0","0"],"imOutIdx":["260","261","262","263","264","264","264","264","264","264"],"imStateRoot":["8055843862775304254706568826463499646250013231089379492032756142632539485910","6440734492684925103504435324083111099059468455159698803777795430519320156387","17080150834634128835371940985724783570700385951141894137839985999722076129393","5478219012134053524299229475329917964241210884198322594193567802008066288663","20148816818886541368926506049436147840148462806275262307164042642547964024891","775514322804357482319368265967771001913542032911682455477513067859744757485","21568970628531903183192590637378661071540070590973406609839025437699471470737","21568970628531903183192590637378661071540070590973406609839025437699471470737","21568970628531903183192590637378661071540070590973406609839025437699471470737","21568970628531903183192590637378661071540070590973406609839025437699471470737"],"imStateRootFee":["21845262663036701885789796823768213178166652003885839590605490469705095935737","4392049343656836675348565048374261353937130287163762821533580216441778455298","4392049343656836675348565048374261353937130287163762821533580216441778455298"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","0","0","0","0","0","0","0","0"],"loadAmountF":["800","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["1","1","1","1","1","0","0","0","0","0","0"],"newExit":["0","0","0","0","0","0","0","0","0","0","0"],"nonce1":["0","0","0","0","0","0","0","0","0","0","0"],"nonce2":["0","0","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["256","257","258","259","256","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"259","oldStateRoot":"9061858435528794221929846392270405504056106238451760714188625065949729889651","oldValue1":["6562150729229138743267014455891184273725543385273447095310127546128519424449","2922089750045328070912118133388673780503526961997250912389906760012441956739","19421590014860408017031009388212071206394178842142297789395859339862413023436","21249140223342182448031284949669740061229572538781098063822693710701073699774","6562150729229138743267014455891184273725543385273447095310127546128519424449","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","1","1","1","1","0","0","0","0","0","0"],"r8x":["0","0","0","0","0","8770607706668248359945566576303935616256160265651383435960480211364357546112","17262037212461398576365522795088670538843993587203604546876447958120541451621","0","0","0","0"],"r8y":["0","0","0","0","0","12311093168939799397001823764682802643621697334938201583983933572943934371028","569635881931475424289735109573228576314932933558639111262539597035286146201","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","0","1191222821583579210553734313486151664513131537567645746568450777927266616354","233823659238401174531419568367279478352512368281766259271702380652050530855","0","0","0","0"],"siblings1":[["19677433422546073304881045118354145314800019963824870333445601305998583462671","10972626243456729342705938923671683591346073099827296619717726184311017773643","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["314380649644034437497614645111544018494756142166059028559280780414545104685","2137207421531663714413080941127393343547214451331189124229908005951387501300","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["8815033147089566264192433432193552302111477712729353545932093180903883923584","12518700578932768688965291105493517842195670873964632084733004769915655162566","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["11272492735170242722575437927373003223779291420137042751188753413926084073118","2199003480782397842508894964778228853972027960419082805229304997775258699423","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4643196374972907526340613742135810086161994487018477480251770189214133189614","18704948542474136639904658844208369945039074813383956110034045279972062222266","18415507397039526176679688506579114602308891419321366426899227563735979799040","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4643196374972907526340613742135810086161994487018477480251770189214133189614","19792116367207470577093418522642680102063643343783661189577437171467838431223","10581016785966093296352870001556755985871105059569418078686917863666115190249","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["17363003769841670694219084152185831959290353086252876353958035484166924121343","2199003480782397842508894964778228853972027960419082805229304997775258699423","18706346248973561030123698363077940738032023383805113107999029340942965867581","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4643196374972907526340613742135810086161994487018477480251770189214133189614","19792116367207470577093418522642680102063643343783661189577437171467838431223","6797559045384535081852691020171750614120022792545883159476356649291644130253","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["8058635939323113621595178698218683776665665927945114003208363967804168776971","21523542291587713439369917543031392600625173237739392380890514174693422096979","18415507397039526176679688506579114602308891419321366426899227563735979799040","12482543472932494767369915162702586718952672410215622757039325707968621010863","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["18794008474280432366030304157244077690848898062286062938735618673955093983148","9743960653694217950134710833940692866621720432852769177126779949777123685924","6925334635958825334942359093560850539634901248387497427591330889995136411874","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18794008474280432366030304157244077690848898062286062938735618673955093983148","6544148003981681871222929255662142912204014765383469000776030058211355312642","5969849198478509518422038172983111571637630011762865430793127273511995054256","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"toEthAddr":["0","0","0","0","0","247512291986854564435551364600938690683113101007","594179275863704165266696689399235767493667371625","0","0","0","0"],"toIdx":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID1":["0","1","1","0","0","1","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","1","0","0","0","0","0"],"tokenID3":["1","0","0","0"],"txCompressedData":["3322668559","22300745198530623141535718272648364828648975","22300745198530623141535718272648364828648975","3322668559","3322668559","13269348750238205523937693788887673002803923556187533286952003167759","13269348750238205523937671488142474472180782020469260920065473897999","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","0","51833393555617990327881616362842488512835329244224786936933384450","51833393555617990327881529250556548829772431193891525049876218115","0","0","0","0"]}` //nolint:lll assert.Equal(t, expected, string(s)) // printZKInputs(t, ptOut.ZKInputs) @@ -894,17 +894,17 @@ func TestZKInputs6(t *testing.T) { blocks[0].Rollup.Batches[7].L1CoordinatorTxs, l2Txs) require.NoError(t, err) assert.Equal(t, - "2537294203394018451170116789946369404362093672592091326351037700505720139801", + "8905191229562583213069132470917469035834300549892959854483573322676101624713", sdb.MT.Root().BigInt().String()) h, err = ptOut.ZKInputs.HashGlobalData() require.NoError(t, err) assert.Equal(t, - "1845962706283133371736088388636579514829217875303351498240344201667516563673", + "869575727906495310720152785126167041690256162889185479974211887085438433227", h.String()) s, err = json.Marshal(ptOut.ZKInputs) require.NoError(t, err) // the 'expected' data has been checked with the circom circuits - expected = `{"amountF":["100","50","100","100","0","0","0","0","0","0","0"],"auxFromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","0","0","0","0","0","0","0"],"ay2":["21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","14382649545529405976710664157356364657039027681269256663271478725131562622080","0","0","0","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0"],"balance1":["600","100","200","540","0","0","0","0","0","0","0"],"balance2":["290","490","0","0","0","0","0","0","0","0","0"],"balance3":["20","10","0","0"],"currentNumBatch":"8","ethAddr1":["721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","0","0","0","0","0","0","0"],"ethAddr2":["247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","721457446580647751014191829380889690493307935711","0","0","0","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","0","0"],"feeIdxs":["261","262","0","0"],"feePlanTokens":["1","0","0","0"],"fromBjjCompressed":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"fromIdx":["256","264","263","256","0","0","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","10","0","0"],["0","15","0","0"],["10","15","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"]],"imExitRoot":["0","0","0","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915"],"imFinalAccFee":["10","25","0","0"],"imInitStateRootFee":"16999647391401744324454789412518559677047168105558253118304621189387563540458","imOnChain":["0","0","0","0","0","0","0","0","0","0"],"imOutIdx":["264","264","264","264","264","264","264","264","264","264"],"imStateRoot":["21544861846490589225939147131412521402556544657031801673861977550720931547722","18249648285735814324332042468781114524422290116671240646072372984550254691834","20425677330049041453295073761948341888757537774334555333486204745369315917271","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458","16999647391401744324454789412518559677047168105558253118304621189387563540458"],"imStateRootFee":["15762582273572613769439411633551734471986056415380264328582008944204977914051","2537294203394018451170116789946369404362093672592091326351037700505720139801","2537294203394018451170116789946369404362093672592091326351037700505720139801"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","1","0","0","0","0","0","0","0"],"loadAmountF":["0","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["0","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","1","0","0","0","0","0","0","0"],"nonce1":["0","0","0","1","0","0","0","0","0","0","0"],"nonce2":["1","1","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["0","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"3844339393304253264418296322137281996442345663805792718218845145754742722151","oldValue1":["0","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["0","0","0","0","0","0","0","0","0","0","0"],"r8x":["302270758435675574214809309069888323408433789550831886268345938426962682309","21563216029909764711992290530977610010762511172265638092685581723343592382617","5870355838090106414211751098919313984958998796526796689740450067743872655994","1001436453055464042643031027259486452586388894353802935436799723822945175624","0","0","0","0","0","0","0"],"r8y":["15328240804450798523189452255713680159657624365150725550171659311102113064708","4903123605274597892730158883972882319106389492311830708633761710406787160699","11429050162890815253930130233261288300710584405508705816326860610216586377604","9409912941229961179815689897660498509982109379169455108223078399469008689451","0","0","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["2232928562311535160082257159195694446558581426657978661469662341375468867078","2435270033855580861065349426451862556602265060510556123816193814033378449425","393951226412759308803337244034300661019305408633428893788216011149202546496","1061137444505423864271596294262176587432105609076591513874123129881120605628","0","0","0","0","0","0","0"],"siblings1":[["775451500470189483763286938669998278945473916117098080622798346273962730711","5316817326947385123357386467816707915029814254656121290959170636166250895653","18415507397039526176679688506579114602308891419321366426899227563735979799040","3085966888465024427488614056821630329516667319623612962287131639756765962203","0","0","0","0","0","0","0","0","0","0","0","0","0"],["20438136183795238064731306102922544886955296044168981572700215463195252550711","5316817326947385123357386467816707915029814254656121290959170636166250895653","18415507397039526176679688506579114602308891419321366426899227563735979799040","6819435423288173311979537247717891599632371007054341641382056868866104308972","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18863984955739408011275315913004663535206378365254244720059757127033362140280","6544148003981681871222929255662142912204014765383469000776030058211355312642","18183543918182770941889882117666634479723575558022332914228723866339567730166","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["3652192186654325996020096908199789445254600392469256936427054884122030560328","5316817326947385123357386467816707915029814254656121290959170636166250895653","18415507397039526176679688506579114602308891419321366426899227563735979799040","6297316909055097129174836401224799012703267232549005289288013654975501958320","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["13437448180877544755690618842767025259325422897977568807405996672417954317703","6544148003981681871222929255662142912204014765383469000776030058211355312642","7365164883308398622788453558162720347322356828640213809219966010831422962435","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["20438136183795238064731306102922544886955296044168981572700215463195252550711","5316817326947385123357386467816707915029814254656121290959170636166250895653","18415507397039526176679688506579114602308891419321366426899227563735979799040","6297316909055097129174836401224799012703267232549005289288013654975501958320","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18863984955739408011275315913004663535206378365254244720059757127033362140280","1522175970425959229595423133382098839714754108891429734160386299841379478596","13338303469345047684537862475562058883161632564586987947839572622273990170507","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["7292997018824595204215193575710109300194386187513536728288408141824972157004","1522175970425959229595423133382098839714754108891429734160386299841379478596","752163647728876524378487984296494416527655885600573772722793563230109953871","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["15661773609756060357122934362203440417939236909854101304410122153060150500924","8339024557882100328906936584747222148131017278803935602823262061067293012433","6797559045384535081852691020171750614120022792545883159476356649291644130253","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","0","0","0","0","0","0","0","0"],"toEthAddr":["247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","0","0","0","0","0","0","0","0"],"toIdx":["259","256","257","1","0","0","0","0","0","0","0"],"tokenID1":["0","0","1","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","1","0","0","0","0","0","0","0","0"],"tokenID3":["1","0","0","0"],"txCompressedData":["13269348750238205523937671488142474492700876111663723512368426903055","13269348750238205523937671488142474492463191624120932751387608737295","13269348750238205523937693788887673023165561322353469455867681957391","13269348750238301304908975606196121868949207077307500584429224191503","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["51833393555617990327881529250556548829772431193964427068844278016","51833393555617990327881529250556544868364305480746702966716629256","51833393555617990327881616362842480590019077817863366651552989447","51833393555618364472300685961703608973089606562344838443583930624","0","0","0","0","0","0","0"]}` //nolint:lll + expected = `{"amountF":["100","50","100","100","0","0","0","0","0","0","0"],"auxFromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","0","0","0","0","0","0","0"],"ay2":["21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","14382649545529405976710664157356364657039027681269256663271478725131562622080","0","0","0","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0"],"balance1":["600","100","200","540","0","0","0","0","0","0","0"],"balance2":["290","490","0","0","0","0","0","0","0","0","0"],"balance3":["20","10","0","0"],"currentNumBatch":"8","ethAddr1":["721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","0","0","0","0","0","0","0"],"ethAddr2":["247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","721457446580647751014191829380889690493307935711","0","0","0","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","176962662172908264953938498278848696642639144728","0","0"],"feeIdxs":["261","263","0","0"],"feePlanTokens":["1","0","0","0"],"fromBjjCompressed":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"fromIdx":["256","264","262","256","0","0","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","10","0","0"],["0","15","0","0"],["10","15","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"],["10","25","0","0"]],"imExitRoot":["0","0","0","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915","13250144760662777978687264077050092444905467656476402514654550449973838329915"],"imFinalAccFee":["10","25","0","0"],"imInitStateRootFee":"19962327573331823712800383558137412102534362820564928130799687004921920771313","imOnChain":["0","0","0","0","0","0","0","0","0","0"],"imOutIdx":["264","264","264","264","264","264","264","264","264","264"],"imStateRoot":["8420929917779855083168392086161338664556718284168929126509559204106289781063","11198618361999400902293809915790827434464820798953604129344599023037447634598","6477291986074195281648500263979114495040056997695257266171651150837704900583","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313","19962327573331823712800383558137412102534362820564928130799687004921920771313"],"imStateRootFee":["9105638988464013543472781290807744116809126573578336130887297617775620716136","8905191229562583213069132470917469035834300549892959854483573322676101624713","8905191229562583213069132470917469035834300549892959854483573322676101624713"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","1","0","0","0","0","0","0","0"],"loadAmountF":["0","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["0","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","1","0","0","0","0","0","0","0"],"nonce1":["0","0","0","1","0","0","0","0","0","0","0"],"nonce2":["1","1","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["0","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"4392049343656836675348565048374261353937130287163762821533580216441778455298","oldValue1":["0","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["0","0","0","0","0","0","0","0","0","0","0"],"r8x":["302270758435675574214809309069888323408433789550831886268345938426962682309","21563216029909764711992290530977610010762511172265638092685581723343592382617","1307101098299668782959966220864381212229594588154549480302963429093727822076","1001436453055464042643031027259486452586388894353802935436799723822945175624","0","0","0","0","0","0","0"],"r8y":["15328240804450798523189452255713680159657624365150725550171659311102113064708","4903123605274597892730158883972882319106389492311830708633761710406787160699","12923634409989923846870569999684844292643864036887460574113021300453562902791","9409912941229961179815689897660498509982109379169455108223078399469008689451","0","0","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["2232928562311535160082257159195694446558581426657978661469662341375468867078","2435270033855580861065349426451862556602265060510556123816193814033378449425","1121951993240504450657593564089855251244412256187010257909501329320850726325","1061137444505423864271596294262176587432105609076591513874123129881120605628","0","0","0","0","0","0","0"],"siblings1":[["9655301783219273887629572676111617796112581965264718657943912718193181603668","21523542291587713439369917543031392600625173237739392380890514174693422096979","18415507397039526176679688506579114602308891419321366426899227563735979799040","3085966888465024427488614056821630329516667319623612962287131639756765962203","0","0","0","0","0","0","0","0","0","0","0","0","0"],["3033069444170099495505610499193861118958966715969824210168911690601767964124","21523542291587713439369917543031392600625173237739392380890514174693422096979","18415507397039526176679688506579114602308891419321366426899227563735979799040","6819435423288173311979537247717891599632371007054341641382056868866104308972","0","0","0","0","0","0","0","0","0","0","0","0","0"],["3033069444170099495505610499193861118958966715969824210168911690601767964124","2196439739514605091558275107767510317388338213428672646343338815591764215958","6797559045384535081852691020171750614120022792545883159476356649291644130253","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["7015172979258569944003373329951688091097704900937171304974050920728592423751","16139509698469054999538233992982712555809977778601726919301017987108938945574","18415507397039526176679688506579114602308891419321366426899227563735979799040","6297316909055097129174836401224799012703267232549005289288013654975501958320","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["18103319615126982250697112131049137841460002780173831702103268504054464924675","6544148003981681871222929255662142912204014765383469000776030058211355312642","1913604847655644513265342567797581129316275172835434743130072093522946907100","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["3033069444170099495505610499193861118958966715969824210168911690601767964124","21523542291587713439369917543031392600625173237739392380890514174693422096979","18415507397039526176679688506579114602308891419321366426899227563735979799040","6297316909055097129174836401224799012703267232549005289288013654975501958320","0","0","0","0","0","0","0","0","0","0","0","0","0"],["10654609496535964558909566290432480298919624370744901502569342519550073424476","11872834193405429155785221606635733041877785946183895548055231228630415671526","13338303469345047684537862475562058883161632564586987947839572622273990170507","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["10481589107625349543356999071414880624641854424821273757413664142067964978076","11872834193405429155785221606635733041877785946183895548055231228630415671526","752163647728876524378487984296494416527655885600573772722793563230109953871","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["10481589107625349543356999071414880624641854424821273757413664142067964978076","9511566748286243410718405432244363254186644304849399669411385661138784704473","18183543918182770941889882117666634479723575558022332914228723866339567730166","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","20534271334408079873799448508761237599936782740731511933526664305820108254173","0","0","0","0","0","0","0","0"],"toEthAddr":["247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","594179275863704165266696689399235767493667371625","0","0","0","0","0","0","0","0"],"toIdx":["259","256","257","1","0","0","0","0","0","0","0"],"tokenID1":["0","0","1","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","1","0","0","0","0","0","0","0","0"],"tokenID3":["1","0","0","0"],"txCompressedData":["13269348750238205523937671488142474492700876111663723512368426903055","13269348750238205523937671488142474492463191624120932751387608737295","13269348750238205523937693788887673023165561322353469174392705246735","13269348750238301304908975606196121868949207077307500584429224191503","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["51833393555617990327881529250556548829772431193964427068844278016","51833393555617990327881529250556544868364305480746702966716629256","51833393555617990327881616362842480590019077817863366651552989446","51833393555618364472300685961703608973089606562344838443583930624","0","0","0","0","0","0","0"]}` //nolint:lll assert.Equal(t, expected, string(s)) // printZKInputs(t, ptOut.ZKInputs) @@ -920,22 +920,22 @@ func TestZKInputs6(t *testing.T) { l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[1].Rollup.Batches[0].Batch.ForgeL1TxsNum]) l2Txs = poolL2Txs - coordIdxs = []common.Idx{262} + coordIdxs = []common.Idx{263} ptOut, err = tp.ProcessTxs(coordIdxs, l1UserTxs, blocks[1].Rollup.Batches[0].L1CoordinatorTxs, l2Txs) require.NoError(t, err) assert.Equal(t, - "13463929859122729344499006353544877221550995454069650137270994940730475267399", + "20593679664586247774284790801579542411781976279024409415159440382607791042723", sdb.MT.Root().BigInt().String()) h, err = ptOut.ZKInputs.HashGlobalData() require.NoError(t, err) assert.Equal(t, - "17468603272980050776161663164007590026174537329451086196759679200385523230817", + "7723923111532070914423697360795228093551422843840326809969093849660043067823", h.String()) s, err = json.Marshal(ptOut.ZKInputs) require.NoError(t, err) // the 'expected' data has been checked with the circom circuits - expected = `{"amountF":["0","100","200","100","300","100","0","0","0","0","0"],"auxFromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["20534271334408079873799448508761237599936782740731511933526664305820108254173","20534271334408079873799448508761237599936782740731511933526664305820108254173","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","0","0","0","0","0"],"ay2":["0","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","7299054315324763317564375227723527917820889071879589087797584828752306403468","0","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0","0"],"balance1":["45","545","900","590","700","490","0","0","0","0","0"],"balance2":["0","800","390","0","430","370","0","0","0","0","0"],"balance3":["35","0","0","0"],"currentNumBatch":"9","ethAddr1":["594179275863704165266696689399235767493667371625","594179275863704165266696689399235767493667371625","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","0","0","0","0","0"],"ethAddr2":["0","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","1288347612158191397270705234830805381732297126518","0","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","0","0","0"],"feeIdxs":["262","0","0","0"],"feePlanTokens":["0","0","0","0"],"fromBjjCompressed":[["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["0","0","1","1","0","0","0","1","0","0","0","1","1","1","1","0","0","0","1","1","1","0","1","0","1","1","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","1","0","1","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","1","1","1","0","0","1","1","0","1","1","1","1","1","1","0","0","1","0","1","1","0","1","0","0","1","1","0","1","0","0","0","0","1","1","0","0","1","0","1","1","0","0","0","0","1","1","0","0","1","1","1","1","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","1","1","1","1","1","0","0","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","1","0","0","1","0","1","1","1","1","0","1","0","1","0","0","1","1","1","1","1","0","1","1","0","1","1","0","0","0","1","1","0","1","0","0","1","0","0","1","1","0","1","1","0","0","1","1","1","0","1","0","0","1","0","0","1","1","1","1","0","0","0","1","1","0","0","0","1","0","0","0","0","0","0","1","0","0","0"],["0","0","0","0","1","0","1","0","0","0","1","1","0","1","0","1","1","0","0","0","0","1","0","0","0","1","1","1","0","0","1","1","0","1","1","1","0","0","1","1","0","0","1","1","0","1","1","0","1","0","0","1","1","0","0","0","0","1","0","1","1","0","1","0","1","0","0","0","0","1","1","1","1","1","1","1","0","1","0","0","0","1","1","1","0","1","0","0","1","1","1","0","0","1","1","0","0","0","0","0","0","0","0","0","1","0","0","0","1","0","0","0","0","0","1","0","0","0","0","1","1","1","1","0","1","1","0","1","1","0","0","1","0","1","0","0","1","0","0","1","0","1","1","0","1","0","1","0","0","1","1","1","1","0","0","1","0","0","0","0","1","0","1","0","0","1","1","0","0","1","1","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","0","0","1","1","1","0","1","0","1","1","1","0","1","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","1","0","1","0","0","1","0","0","0","0","0","1","1","1","0","0","0","0","1","1","1","0","1","1","0","0","0","0","0","0","0","1","1","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["594179275863704165266696689399235767493667371625","594179275863704165266696689399235767493667371625","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","0","0","0","0","0","0","0"],"fromIdx":["264","264","260","259","260","259","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["30","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"]],"imExitRoot":["0","0","0","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347"],"imFinalAccFee":["40","0","0","0"],"imInitStateRootFee":"12739748017764491962165619761965470592784781155122238711868999177489787566165","imOnChain":["1","1","1","1","0","0","0","0","0","0"],"imOutIdx":["264","264","264","264","264","264","264","264","264","264"],"imStateRoot":["10459632710309749250510737887805004284507232750880581510082503466363771666981","16190336376423523428874938954996295336466647573112817657029947691174779630383","11739850469079313429555588343082600372068652377440758689378844379699928970306","7614082918231776554925232213621605182283791802500580745346785728422780904364","4771953243552498756721911250954018353500179197514756110793959002516170145490","12739748017764491962165619761965470592784781155122238711868999177489787566165","12739748017764491962165619761965470592784781155122238711868999177489787566165","12739748017764491962165619761965470592784781155122238711868999177489787566165","12739748017764491962165619761965470592784781155122238711868999177489787566165","12739748017764491962165619761965470592784781155122238711868999177489787566165"],"imStateRootFee":["13463929859122729344499006353544877221550995454069650137270994940730475267399","13463929859122729344499006353544877221550995454069650137270994940730475267399","13463929859122729344499006353544877221550995454069650137270994940730475267399"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","1","0","0","0","0","0","0","0"],"loadAmountF":["500","400","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["0","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","1","0","0","0","0","0","0","0"],"nonce1":["1","1","0","1","0","1","0","0","0","0","0"],"nonce2":["0","0","1","0","2","1","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["0","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"2537294203394018451170116789946369404362093672592091326351037700505720139801","oldValue1":["0","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","1","1","1","0","0","0","0","0","0","0"],"r8x":["0","0","0","0","16254759499172734417722307213036425081723135786393041297785552945066455173881","3395671717403944983520146880528871871064486932447683466946776953558014089536","0","0","0","0","0"],"r8y":["0","0","0","0","17817737840274164371918975562337388999980903089248613923797910713206113489854","7342398271243038196138915394650506262231940591927774706965905817094280818661","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","2022657604301051614246963175651179116510951523171651563999591629963414240754","1779886882342479525779817527854774386819321478449351536968533800669111511381","0","0","0","0","0"],"siblings1":[["15661773609756060357122934362203440417939236909854101304410122153060150500924","19012915997360430223578439773755658111131395112473758945533469821361608987266","18415507397039526176679688506579114602308891419321366426899227563735979799040","3733363825033960041993832455273006372365256793537049497701258715360801923303","0","0","0","0","0","0","0","0","0","0","0","0","0"],["15661773609756060357122934362203440417939236909854101304410122153060150500924","19012915997360430223578439773755658111131395112473758945533469821361608987266","18415507397039526176679688506579114602308891419321366426899227563735979799040","3733363825033960041993832455273006372365256793537049497701258715360801923303","0","0","0","0","0","0","0","0","0","0","0","0","0"],["15661773609756060357122934362203440417939236909854101304410122153060150500924","19012915997360430223578439773755658111131395112473758945533469821361608987266","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18260825551139164336764776466290336068595214824027541475857664139034023073306","9511566748286243410718405432244363254186644304849399669411385661138784704473","6240312228085940207510384795945349173950389933408267938797007682865923569178","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["12410476788383200503743217012187682104919436315673050798867093380420435059514","19012915997360430223578439773755658111131395112473758945533469821361608987266","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4990961250306417774772705515166579360775002263946429069496206377083134624792","9511566748286243410718405432244363254186644304849399669411385661138784704473","6240312228085940207510384795945349173950389933408267938797007682865923569178","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["15661773609756060357122934362203440417939236909854101304410122153060150500924","19012915997360430223578439773755658111131395112473758945533469821361608987266","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["18260825551139164336764776466290336068595214824027541475857664139034023073306","9511566748286243410718405432244363254186644304849399669411385661138784704473","6240312228085940207510384795945349173950389933408267938797007682865923569178","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["12410476788383200503743217012187682104919436315673050798867093380420435059514","19012915997360430223578439773755658111131395112473758945533469821361608987266","6359100303258919637796150829394060021769124024950410155746732217725400866259","20344417271658968953097914183087577010545934187405279090971244958040170314694","0","0","0","0","0","0","0","0","0","0","0","0","0"],["12659944815654876618188124107823539608547601033074446823535078129473280901769","19012915997360430223578439773755658111131395112473758945533469821361608987266","18908151756180406251762769112222699887463227656846887383022223012263677638724","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["12659944815654876618188124107823539608547601033074446823535078129473280901769","1881811914097925414811472340877100166290562508102356252666583982562981120765","6797559045384535081852691020171750614120022792545883159476356649291644130253","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","14382649545529405976710664157356364657039027681269256663271478725131562622080","7299054315324763317564375227723527917820889071879589087797584828752306403468","0","0","0","0","0"],"toEthAddr":["0","0","0","0","721457446580647751014191829380889690493307935711","1288347612158191397270705234830805381732297126518","0","0","0","0","0"],"toIdx":["0","260","259","1","256","260","0","0","0","0","0"],"tokenID1":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID3":["0","0","0","0"],"txCompressedData":["74309397174281743","20599322253708802083718601369103","20520094091194536620225150576143","79228162514337239615834678799","13269348750238205523937671488142474492463191624120931625487701894671","13269348750238301304908975606196121889469301168501964865582037460495","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","51833393555617990327881529250556564675404934046831101352704213252","51833393555618364472300685961703608973089606562417740462551990531","0","0","0","0","0"]}` //nolint:lll + expected = `{"amountF":["0","100","200","100","300","100","0","0","0","0","0"],"auxFromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["20534271334408079873799448508761237599936782740731511933526664305820108254173","20534271334408079873799448508761237599936782740731511933526664305820108254173","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","0","0","0","0","0"],"ay2":["0","7299054315324763317564375227723527917820889071879589087797584828752306403468","21759653464180282217133439550283093276794317614482080451288933258136700169296","21759653464180282217133439550283093276794317614482080451288933258136700169296","14382649545529405976710664157356364657039027681269256663271478725131562622080","7299054315324763317564375227723527917820889071879589087797584828752306403468","0","0","0","0","0"],"ay3":["13127348242808033949662858905093082484882988923889598397206419708399907983738","0","0","0"],"balance1":["45","545","900","590","700","490","0","0","0","0","0"],"balance2":["0","800","390","0","430","370","0","0","0","0","0"],"balance3":["35","0","0","0"],"currentNumBatch":"9","ethAddr1":["594179275863704165266696689399235767493667371625","594179275863704165266696689399235767493667371625","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","0","0","0","0","0"],"ethAddr2":["0","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","247512291986854564435551364600938690683113101007","721457446580647751014191829380889690493307935711","1288347612158191397270705234830805381732297126518","0","0","0","0","0"],"ethAddr3":["176962662172908264953938498278848696642639144728","0","0","0"],"feeIdxs":["263","0","0","0"],"feePlanTokens":["0","0","0","0"],"fromBjjCompressed":[["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","0","0","0","1","0","1","1","1","0","0","0","1","0","1","1","1","1","1","0","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","1","0","0","1","0","0","1","1","1","1","0","1","1","1","0","0","0","0","0","0","0","0","0","1","0","0","1","0","0","1","0","1","0","1","1","1","0","1","0","0","1","0","1","1","0","1","1","1","0","0","0","1","1","1","1","0","0","0","1","0","0","0","1","1","0","1","1","0","1","1","1","1","0","0","1","0","1","0","1","0","1","0","0","0","0","1","0","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","1","1","1","1","0","0","0","1","0","1","0","0","0","1","1","0","1","0","0","1","0","1","0","0","1","0","0","0","1","1","0","1","1","0","1","1","0","1","0","1","0","1","1","1","0","1","1","1","1","0","1","0","1","1","0","1","0","1","0","1","0","1","1","1","0","1","0","1","0","0","0","1","1","1","1","1","1","1","0","1","0","0","1","1","0","1","0","1","1","0","1","0","0"],["0","0","1","1","0","0","0","1","0","0","0","1","1","1","1","0","0","0","1","1","1","0","1","0","1","1","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","1","0","1","1","0","0","0","1","1","0","0","0","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","1","1","1","0","0","1","1","0","1","1","1","1","1","1","0","0","1","0","1","1","0","1","0","0","1","1","0","1","0","0","0","0","1","1","0","0","1","0","1","1","0","0","0","0","1","1","0","0","1","1","1","1","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","1","1","1","1","1","0","0","1","0","1","0","0","1","0","1","1","0","1","1","0","1","1","0","1","0","0","1","0","0","1","0","1","1","1","1","0","1","0","1","0","0","1","1","1","1","1","0","1","1","0","1","1","0","0","0","1","1","0","1","0","0","1","0","0","1","1","0","1","1","0","0","1","1","1","0","1","0","0","1","0","0","1","1","1","1","0","0","0","1","1","0","0","0","1","0","0","0","0","0","0","1","0","0","0"],["0","0","0","0","1","0","1","0","0","0","1","1","0","1","0","1","1","0","0","0","0","1","0","0","0","1","1","1","0","0","1","1","0","1","1","1","0","0","1","1","0","0","1","1","0","1","1","0","1","0","0","1","1","0","0","0","0","1","0","1","1","0","1","0","1","0","0","0","0","1","1","1","1","1","1","1","0","1","0","0","0","1","1","1","0","1","0","0","1","1","1","0","0","1","1","0","0","0","0","0","0","0","0","0","1","0","0","0","1","0","0","0","0","0","1","0","0","0","0","1","1","1","1","0","1","1","0","1","1","0","0","1","0","1","0","0","1","0","0","1","0","1","1","0","1","0","1","0","0","1","1","1","1","0","0","1","0","0","0","0","1","0","1","0","0","1","1","0","0","1","1","0","0","1","1","0","1","1","0","0","0","0","1","0","1","1","0","0","1","1","1","0","1","0","1","1","1","0","1","0","1","0","0","1","1","1","1","0","1","0","0","0","0","1","1","0","1","0","0","1","0","1","0","1","0","0","1","0","0","0","0","0","1","1","1","0","0","0","0","1","1","1","0","1","1","0","0","0","0","0","0","0","1","1","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["594179275863704165266696689399235767493667371625","594179275863704165266696689399235767493667371625","1288347612158191397270705234830805381732297126518","247512291986854564435551364600938690683113101007","0","0","0","0","0","0","0"],"fromIdx":["264","264","260","259","260","259","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["30","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"],["40","0","0","0"]],"imExitRoot":["0","0","0","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347","16216388525409452520367650034131597795216465011356595646109550140247241387347"],"imFinalAccFee":["40","0","0","0"],"imInitStateRootFee":"12063160053709941400160547588624831667157042937323422396363359123696668555050","imOnChain":["1","1","1","1","0","0","0","0","0","0"],"imOutIdx":["264","264","264","264","264","264","264","264","264","264"],"imStateRoot":["8509190661143151169114766973894404305602702837528290925057905282067787815654","2011390155821304865953272527118765311483288188489014250830216039229563912314","455315233741541690383276804940414455205404930777288049237187986098680838352","3997132609476047186503565211524094551548282946156072921848486839507070828008","14726340140654602491676977019044730457558506243628844084529519410722544143560","12063160053709941400160547588624831667157042937323422396363359123696668555050","12063160053709941400160547588624831667157042937323422396363359123696668555050","12063160053709941400160547588624831667157042937323422396363359123696668555050","12063160053709941400160547588624831667157042937323422396363359123696668555050","12063160053709941400160547588624831667157042937323422396363359123696668555050"],"imStateRootFee":["20593679664586247774284790801579542411781976279024409415159440382607791042723","20593679664586247774284790801579542411781976279024409415159440382607791042723","20593679664586247774284790801579542411781976279024409415159440382607791042723"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","1","0","0","0","0","0","0","0"],"loadAmountF":["500","400","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["0","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","1","0","0","0","0","0","0","0"],"nonce1":["1","1","0","1","0","1","0","0","0","0","0"],"nonce2":["0","0","1","0","2","1","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["0","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"8905191229562583213069132470917469035834300549892959854483573322676101624713","oldValue1":["0","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","1","1","1","0","0","0","0","0","0","0"],"r8x":["0","0","0","0","16254759499172734417722307213036425081723135786393041297785552945066455173881","3395671717403944983520146880528871871064486932447683466946776953558014089536","0","0","0","0","0"],"r8y":["0","0","0","0","17817737840274164371918975562337388999980903089248613923797910713206113489854","7342398271243038196138915394650506262231940591927774706965905817094280818661","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","2022657604301051614246963175651179116510951523171651563999591629963414240754","1779886882342479525779817527854774386819321478449351536968533800669111511381","0","0","0","0","0"],"siblings1":[["803023705192123541955777584206814514084066785011454827642873305228346631419","16139509698469054999538233992982712555809977778601726919301017987108938945574","18415507397039526176679688506579114602308891419321366426899227563735979799040","3733363825033960041993832455273006372365256793537049497701258715360801923303","0","0","0","0","0","0","0","0","0","0","0","0","0"],["803023705192123541955777584206814514084066785011454827642873305228346631419","16139509698469054999538233992982712555809977778601726919301017987108938945574","18415507397039526176679688506579114602308891419321366426899227563735979799040","3733363825033960041993832455273006372365256793537049497701258715360801923303","0","0","0","0","0","0","0","0","0","0","0","0","0"],["803023705192123541955777584206814514084066785011454827642873305228346631419","16139509698469054999538233992982712555809977778601726919301017987108938945574","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4326223072727001253775200618679375783609012839552971932038458727184727710492","9511566748286243410718405432244363254186644304849399669411385661138784704473","14953588290083376396795731213913673284537083615083251729160883959876747477655","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["6979864763769362693023771274212159033883599944157916606562186608306912532121","16139509698469054999538233992982712555809977778601726919301017987108938945574","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["9860176942790404988853823159486469440448221482229555552577267990362268222667","9511566748286243410718405432244363254186644304849399669411385661138784704473","14953588290083376396795731213913673284537083615083251729160883959876747477655","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["803023705192123541955777584206814514084066785011454827642873305228346631419","16139509698469054999538233992982712555809977778601726919301017987108938945574","4621198588491236789915271808966193912932371874379056565652261456168799774329","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["4326223072727001253775200618679375783609012839552971932038458727184727710492","9511566748286243410718405432244363254186644304849399669411385661138784704473","14953588290083376396795731213913673284537083615083251729160883959876747477655","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["6979864763769362693023771274212159033883599944157916606562186608306912532121","16139509698469054999538233992982712555809977778601726919301017987108938945574","6359100303258919637796150829394060021769124024950410155746732217725400866259","20344417271658968953097914183087577010545934187405279090971244958040170314694","0","0","0","0","0","0","0","0","0","0","0","0","0"],["2874873048254704512782501288656967685893402721036588948194321175693399505939","16139509698469054999538233992982712555809977778601726919301017987108938945574","18908151756180406251762769112222699887463227656846887383022223012263677638724","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["530511219117683784235812760691745621426160630714567200056439438196957984","9511566748286243410718405432244363254186644304849399669411385661138784704473","11544148174490001160374664103342829693902057185104149240635194962449774676165","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","14382649545529405976710664157356364657039027681269256663271478725131562622080","7299054315324763317564375227723527917820889071879589087797584828752306403468","0","0","0","0","0"],"toEthAddr":["0","0","0","0","721457446580647751014191829380889690493307935711","1288347612158191397270705234830805381732297126518","0","0","0","0","0"],"toIdx":["0","260","259","1","256","260","0","0","0","0","0"],"tokenID1":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID3":["0","0","0","0"],"txCompressedData":["74309397174281743","20599322253708802083718601369103","20520094091194536620225150576143","79228162514337239615834678799","13269348750238205523937671488142474492463191624120931625487701894671","13269348750238301304908975606196121889469301168501964865582037460495","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","51833393555617990327881529250556564675404934046831101352704213252","51833393555618364472300685961703608973089606562417740462551990531","0","0","0","0","0"]}` //nolint:lll assert.Equal(t, expected, string(s)) // printZKInputs(t, ptOut.ZKInputs) @@ -948,17 +948,17 @@ func TestZKInputs6(t *testing.T) { blocks[1].Rollup.Batches[1].L1CoordinatorTxs, l2Txs) require.NoError(t, err) assert.Equal(t, - "21058792089669864857092637997959333050678445584244682889041632034478049099916", + "7635139306183028888189957942287689775017794868718398189334978386355501406695", sdb.MT.Root().BigInt().String()) h, err = ptOut.ZKInputs.HashGlobalData() require.NoError(t, err) assert.Equal(t, - "6056524900543269591353698804585871403738019438004975502247432297178357143366", + "19819774768501383376082666649646195708939895273062203328571310678881620534373", h.String()) s, err = json.Marshal(ptOut.ZKInputs) require.NoError(t, err) // the 'expected' data has been checked with the circom circuits - expected = `{"amountF":["0","0","0","0","0","0","0","0","0","0","0"],"auxFromIdx":["265","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["14399896874050294773416960703887603710722794411453238547230464125238466395720","0","0","0","0","0","0","0","0","0","0"],"ay2":["0","0","0","0","0","0","0","0","0","0","0"],"ay3":["0","0","0","0"],"balance1":["0","0","0","0","0","0","0","0","0","0","0"],"balance2":["0","0","0","0","0","0","0","0","0","0","0"],"balance3":["0","0","0","0"],"currentNumBatch":"10","ethAddr1":["1310124058894944929521848911038157567604058624321","0","0","0","0","0","0","0","0","0","0"],"ethAddr2":["0","0","0","0","0","0","0","0","0","0","0"],"ethAddr3":["0","0","0","0"],"feeIdxs":["0","0","0","0"],"feePlanTokens":["0","0","0","0"],"fromBjjCompressed":[["0","0","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","1","0","0","1","1","1","1","0","1","0","0","0","0","0","0","0","0","1","0","0","1","1","0","1","1","0","0","0","0","1","1","1","1","0","1","1","1","0","0","0","0","1","0","0","0","0","0","1","1","0","0","1","0","0","0","0","1","1","0","0","1","1","0","1","1","1","0","0","1","0","1","1","1","1","0","0","0","0","1","1","1","1","0","0","1","0","1","1","0","0","1","1","1","0","0","1","1","0","0","1","0","0","0","1","0","1","0","0","0","0","0","0","1","1","0","1","1","0","0","1","1","1","1","0","0","1","0","1","1","1","1","1","1","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","0","0","1","0","0","0","0","1","0","0","0","0","1","0","0","0","0","1","0","1","1","0","0","0","0","0","1","0","1","0","1","1","1","1","1","1","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","0","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","0","1","0","1","1","1","1","1","1","1","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["1310124058894944929521848911038157567604058624321","0","0","0","0","0","0","0","0","0","0"],"fromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"]],"imExitRoot":["0","0","0","0","0","0","0","0","0","0"],"imFinalAccFee":["0","0","0","0"],"imInitStateRootFee":"21058792089669864857092637997959333050678445584244682889041632034478049099916","imOnChain":["1","0","0","0","0","0","0","0","0","0"],"imOutIdx":["265","265","265","265","265","265","265","265","265","265"],"imStateRoot":["21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916"],"imStateRootFee":["21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916","21058792089669864857092637997959333050678445584244682889041632034478049099916"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","0","0","0","0","0","0","0","0"],"loadAmountF":["0","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["1","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","0","0","0","0","0","0","0","0"],"nonce1":["0","0","0","0","0","0","0","0","0","0","0"],"nonce2":["0","0","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["257","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"13463929859122729344499006353544877221550995454069650137270994940730475267399","oldValue1":["4257195831259797492404954778722311885833296640062431738498839551435681147467","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","0","0","0","0","0","0","0","0","0","0"],"r8x":["0","0","0","0","0","0","0","0","0","0","0"],"r8y":["0","0","0","0","0","0","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","0","0","0","0","0","0","0"],"siblings1":[["16958687517091222624613236764295341757327522188816318886751484110353917552662","4103961333618665187837508078313649239965585407147042061590223126212549771665","7724712759630475264744487573511141664766742804458973883688465500340683191441","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"toEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"toIdx":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID1":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID3":["0","0","0","0"],"txCompressedData":["3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"]}` //nolint:lll + expected = `{"amountF":["0","0","0","0","0","0","0","0","0","0","0"],"auxFromIdx":["265","0","0","0","0","0","0","0","0","0","0"],"auxToIdx":["0","0","0","0","0","0","0","0","0","0","0"],"ay1":["14399896874050294773416960703887603710722794411453238547230464125238466395720","0","0","0","0","0","0","0","0","0","0"],"ay2":["0","0","0","0","0","0","0","0","0","0","0"],"ay3":["0","0","0","0"],"balance1":["0","0","0","0","0","0","0","0","0","0","0"],"balance2":["0","0","0","0","0","0","0","0","0","0","0"],"balance3":["0","0","0","0"],"currentNumBatch":"10","ethAddr1":["1310124058894944929521848911038157567604058624321","0","0","0","0","0","0","0","0","0","0"],"ethAddr2":["0","0","0","0","0","0","0","0","0","0","0"],"ethAddr3":["0","0","0","0"],"feeIdxs":["0","0","0","0"],"feePlanTokens":["0","0","0","0"],"fromBjjCompressed":[["0","0","0","1","0","0","1","0","0","1","1","1","1","1","0","0","1","0","1","1","0","0","1","1","1","1","0","1","0","0","0","0","0","0","0","0","1","0","0","1","1","0","1","1","0","0","0","0","1","1","1","1","0","1","1","1","0","0","0","0","1","0","0","0","0","0","1","1","0","0","1","0","0","0","0","1","1","0","0","1","1","0","1","1","1","0","0","1","0","1","1","1","1","0","0","0","0","1","1","1","1","0","0","1","0","1","1","0","0","1","1","1","0","0","1","1","0","0","1","0","0","0","1","0","1","0","0","0","0","0","0","1","1","0","1","1","0","0","1","1","1","1","0","0","1","0","1","1","1","1","1","1","1","1","1","0","0","0","1","1","1","0","0","0","0","1","1","1","0","0","0","1","1","0","0","0","0","0","1","0","0","0","0","1","0","0","0","0","1","0","0","0","0","1","0","1","1","0","0","0","0","0","1","0","1","0","1","1","1","1","1","1","1","1","1","0","1","1","0","1","0","0","0","1","0","0","1","0","0","0","0","1","1","0","1","1","0","0","0","0","0","1","1","0","1","0","1","1","1","1","1","1","1","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"fromEthAddr":["1310124058894944929521848911038157567604058624321","0","0","0","0","0","0","0","0","0","0"],"fromIdx":["0","0","0","0","0","0","0","0","0","0","0"],"globalChainID":"0","imAccFeeOut":[["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"],["0","0","0","0"]],"imExitRoot":["0","0","0","0","0","0","0","0","0","0"],"imFinalAccFee":["0","0","0","0"],"imInitStateRootFee":"7635139306183028888189957942287689775017794868718398189334978386355501406695","imOnChain":["1","0","0","0","0","0","0","0","0","0"],"imOutIdx":["265","265","265","265","265","265","265","265","265","265"],"imStateRoot":["7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695"],"imStateRootFee":["7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695","7635139306183028888189957942287689775017794868718398189334978386355501406695"],"isOld0_1":["0","0","0","0","0","0","0","0","0","0","0"],"isOld0_2":["0","0","0","0","0","0","0","0","0","0","0"],"loadAmountF":["0","0","0","0","0","0","0","0","0","0","0"],"maxNumBatch":["0","0","0","0","0","0","0","0","0","0","0"],"newAccount":["1","0","0","0","0","0","0","0","0","0","0"],"newExit":["0","0","0","0","0","0","0","0","0","0","0"],"nonce1":["0","0","0","0","0","0","0","0","0","0","0"],"nonce2":["0","0","0","0","0","0","0","0","0","0","0"],"nonce3":["0","0","0","0"],"oldKey1":["257","0","0","0","0","0","0","0","0","0","0"],"oldKey2":["0","0","0","0","0","0","0","0","0","0","0"],"oldLastIdx":"264","oldStateRoot":"20593679664586247774284790801579542411781976279024409415159440382607791042723","oldValue1":["4257195831259797492404954778722311885833296640062431738498839551435681147467","0","0","0","0","0","0","0","0","0","0"],"oldValue2":["0","0","0","0","0","0","0","0","0","0","0"],"onChain":["1","0","0","0","0","0","0","0","0","0","0"],"r8x":["0","0","0","0","0","0","0","0","0","0","0"],"r8y":["0","0","0","0","0","0","0","0","0","0","0"],"rqOffset":["0","0","0","0","0","0","0","0","0","0","0"],"rqToBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"rqToEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"rqTxCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"],"s":["0","0","0","0","0","0","0","0","0","0","0"],"siblings1":[["530511219117683784235812760691745621426160630714567200056439438196957984","18367588618280584551737321951686614373027695088935238448076283632726161942664","7724712759630475264744487573511141664766742804458973883688465500340683191441","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings2":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"siblings3":[["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"],["0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"]],"sign1":["0","0","0","0","0","0","0","0","0","0","0"],"sign2":["0","0","0","0","0","0","0","0","0","0","0"],"sign3":["0","0","0","0"],"toBjjAy":["0","0","0","0","0","0","0","0","0","0","0"],"toEthAddr":["0","0","0","0","0","0","0","0","0","0","0"],"toIdx":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID1":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID2":["0","0","0","0","0","0","0","0","0","0","0"],"tokenID3":["0","0","0","0"],"txCompressedData":["3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559","3322668559"],"txCompressedDataV2":["0","0","0","0","0","0","0","0","0","0","0"]}` //nolint:lll assert.Equal(t, expected, string(s)) // printZKInputs(t, ptOut.ZKInputs) diff --git a/txselector/txselector.go b/txselector/txselector.go index c4c27ef..60cc7e5 100644 --- a/txselector/txselector.go +++ b/txselector/txselector.go @@ -148,17 +148,37 @@ func (txsel *TxSelector) GetL1L2TxSelection(selectionConfig txprocessor.Config, discardedL2Txs, tracerr.Wrap(err) } +// getL1L2TxSelection returns the selection of L1 + L2 txs. +// It returns: the CoordinatorIdxs used to receive the fees of the selected +// L2Txs. An array of bytearrays with the signatures of the +// AccountCreationAuthorization of the accounts of the users created by the +// Coordinator with L1CoordinatorTxs of those accounts that does not exist yet +// but there is a transactions to them and the authorization of account +// creation exists. The L1UserTxs, L1CoordinatorTxs, PoolL2Txs that will be +// included in the next batch. func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, l1UserTxs []common.L1Tx) ([]common.Idx, [][]byte, []common.L1Tx, []common.L1Tx, []common.PoolL2Tx, []common.PoolL2Tx, error) { // WIP.0: the TxSelector is not optimized and will need a redesign. The // current version is implemented in order to have a functional - // implementation that can be used asap. - // - // WIP.1: this method uses a 'cherry-pick' of internal calls of the - // StateDB, a refactor of the StateDB to reorganize it internally is - // planned once the main functionallities are covered, with that - // refactor the TxSelector will be updated also. + // implementation that can be used ASAP. + + // Steps of this method: + // - getPendingTxs + // - ProcessL1Txs + // - getProfitable (sort by fee & nonce) + // - loop over l2Txs + // - Fill tx.TokenID tx.Nonce + // - Check enough Balance on sender + // - Check Nonce + // - Create CoordAccount L1CoordTx for TokenID if needed + // - & ProcessL1Tx of L1CoordTx + // - Check validity of receiver Account for ToEthAddr / ToBJJ + // - Create UserAccount L1CoordTx if needed (and possible) + // - If everything is fine, store l2Tx to validTxs & update NoncesMap + // - Prepare coordIdxsMap & AccumulatedFees + // - Distribute AccumulatedFees to CoordIdxs + // - MakeCheckpoint // get pending l2-tx from tx-pool l2TxsRaw, err := txsel.l2db.GetPendingTxs() @@ -185,25 +205,62 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, // Sort l2TxsRaw (cropping at MaxTx at this point). // discardedL2Txs contains an array of the L2Txs that have not been // selected in this Batch. - l2Txs0, discardedL2Txs := txsel.getL2Profitable(l2TxsRaw, selectionConfig.MaxTx) + l2Txs, discardedL2Txs := txsel.getL2Profitable(l2TxsRaw, selectionConfig.MaxTx-uint32(len(l1UserTxs))) for i := range discardedL2Txs { - discardedL2Txs[i].Info = "Tx not selected due to low absolute fee (does not fit inside the profitable set)" + discardedL2Txs[i].Info = + "Tx not selected due to low absolute fee (does not fit inside the profitable set)" } - noncesMap := make(map[common.Idx]common.Nonce) - var l2Txs []common.PoolL2Tx - // iterate over l2Txs - // - if tx.TokenID does not exist at CoordsIdxDB - // - create new L1CoordinatorTx creating a CoordAccount, for - // Coordinator to receive the fee of the new TokenID - for i := 0; i < len(l2Txs0); i++ { - accSender, err := tp.StateDB().GetAccount(l2Txs0[i].FromIdx) + var validTxs []common.PoolL2Tx + tp.AccumulatedFees = make(map[common.Idx]*big.Int) + // Iterate over l2Txs + // - check Nonces + // - check enough Balance for the Amount+Fee + // - if needed, create new L1CoordinatorTxs for unexisting ToIdx + // - keep used accAuths + // - put the valid txs into validTxs array + for i := 0; i < len(l2Txs); i++ { + // Check if there is space for more L2Txs in the selection + maxL2Txs := int(selectionConfig.MaxTx) - + len(l1UserTxs) - len(l1CoordinatorTxs) + if len(validTxs) >= maxL2Txs { + // no more available slots for L2Txs + l2Txs[i].Info = + "Tx not selected due not available slots for L2Txs" + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue + } + + // get Nonce & TokenID from the Account by l2Tx.FromIdx + accSender, err := tp.StateDB().GetAccount(l2Txs[i].FromIdx) if err != nil { return nil, nil, nil, nil, nil, nil, tracerr.Wrap(err) } - l2Txs0[i].TokenID = accSender.TokenID - // populate the noncesMap used at the next iteration - noncesMap[l2Txs0[i].FromIdx] = accSender.Nonce + l2Txs[i].TokenID = accSender.TokenID + + // Check enough Balance on sender + enoughBalance, balance, feeAndAmount := tp.CheckEnoughBalance(l2Txs[i]) + if !enoughBalance { + // not valid Amount with current Balance. Discard L2Tx, + // and update Info parameter of the tx, and add it to + // the discardedTxs array + l2Txs[i].Info = fmt.Sprintf("Tx not selected due to not enough Balance at the sender. "+ + "Current sender account Balance: %s, Amount+Fee: %s", + balance.String(), feeAndAmount.String()) + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue + } + + // Check if Nonce is correct + if l2Txs[i].Nonce != accSender.Nonce { + // not valid Nonce at tx. Discard L2Tx, and update Info + // parameter of the tx, and add it to the discardedTxs + // array + l2Txs[i].Info = fmt.Sprintf("Tx not selected due to not current Nonce. "+ + "Tx.Nonce: %d, Account.Nonce: %d", l2Txs[i].Nonce, accSender.Nonce) + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue + } // if TokenID does not exist yet, create new L1CoordinatorTx to // create the CoordinatorAccount for that TokenID, to receive @@ -218,52 +275,27 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, return nil, nil, nil, nil, nil, nil, tracerr.Wrap(err) } if newL1CoordTx != nil { - // if there is no space for the L1CoordinatorTx, discard the L2Tx - if len(l1CoordinatorTxs) >= int(selectionConfig.MaxL1Tx)-len(l1UserTxs) { + // if there is no space for the L1CoordinatorTx as MaxL1Tx, or no space + // for L1CoordinatorTx + L2Tx as MaxTx, discard the L2Tx + if len(l1CoordinatorTxs) >= int(selectionConfig.MaxL1Tx)-len(l1UserTxs) || + len(l1CoordinatorTxs)+1 >= int(selectionConfig.MaxTx)-len(l1UserTxs) { // discard L2Tx, and update Info parameter of // the tx, and add it to the discardedTxs array - l2Txs0[i].Info = "Tx not selected because the L2Tx depends on a " + + l2Txs[i].Info = "Tx not selected because the L2Tx depends on a " + "L1CoordinatorTx and there is not enough space for L1Coordinator" - discardedL2Txs = append(discardedL2Txs, l2Txs0[i]) + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) continue } // increase positionL1 positionL1++ l1CoordinatorTxs = append(l1CoordinatorTxs, *newL1CoordTx) accAuths = append(accAuths, txsel.coordAccount.AccountCreationAuth) - } - l2Txs = append(l2Txs, l2Txs0[i]) - } - var validTxs []common.PoolL2Tx - // iterate over l2TxsRaw - // - check Nonces - // - check enough Balance for the Amount+Fee - // - if needed, create new L1CoordinatorTxs for unexisting ToIdx - // - keep used accAuths - // - put the valid txs into validTxs array - for i := 0; i < len(l2Txs); i++ { - enoughBalance, balance, feeAndAmount := tp.CheckEnoughBalance(l2Txs[i]) - if !enoughBalance { - // not valid Amount with current Balance. Discard L2Tx, - // and update Info parameter of the tx, and add it to - // the discardedTxs array - l2Txs[i].Info = fmt.Sprintf("Tx not selected due to not enough Balance at the sender. "+ - "Current sender account Balance: %s, Amount+Fee: %s", - balance.String(), feeAndAmount.String()) - discardedL2Txs = append(discardedL2Txs, l2Txs[i]) - continue - } - // check if Nonce is correct - nonce := noncesMap[l2Txs[i].FromIdx] - if l2Txs[i].Nonce != nonce { - // not valid Nonce at tx. Discard L2Tx, and update Info - // parameter of the tx, and add it to the discardedTxs - // array - l2Txs[i].Info = fmt.Sprintf("Tx not selected due to not current Nonce. "+ - "Tx.Nonce: %d, Account.Nonce: %d", l2Txs[i].Nonce, nonce) - discardedL2Txs = append(discardedL2Txs, l2Txs[i]) - continue + // process the L1CoordTx + _, _, _, _, err := tp.ProcessL1Tx(nil, newL1CoordTx) + if err != nil { + return nil, nil, nil, nil, nil, nil, tracerr.Wrap(err) + } } // If tx.ToIdx>=256, tx.ToIdx should exist to localAccountsDB, @@ -287,7 +319,19 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, discardedL2Txs = append(discardedL2Txs, l2Txs[i]) continue } - if l1CoordinatorTx != nil { + // if there is no space for the L1CoordinatorTx as MaxL1Tx, or no space + // for L1CoordinatorTx + L2Tx as MaxTx, discard the L2Tx + if len(l1CoordinatorTxs) >= int(selectionConfig.MaxL1Tx)-len(l1UserTxs) || + len(l1CoordinatorTxs)+1 >= int(selectionConfig.MaxTx)-len(l1UserTxs) { + // discard L2Tx, and update Info parameter of + // the tx, and add it to the discardedTxs array + l2Txs[i].Info = "Tx not selected because the L2Tx depends on a " + + "L1CoordinatorTx and there is not enough space for L1Coordinator" + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue + } + + if l1CoordinatorTx != nil && validL2Tx != nil { // If ToEthAddr == 0xff.. this means that we // are handling a TransferToBJJ, which doesn't // require an authorization because it doesn't @@ -303,9 +347,16 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, l1CoordinatorTxs = append(l1CoordinatorTxs, *l1CoordinatorTx) positionL1++ } + + // process the L1CoordTx + _, _, _, _, err := tp.ProcessL1Tx(nil, l1CoordinatorTx) + if err != nil { + return nil, nil, nil, nil, nil, nil, tracerr.Wrap(err) + } } - if validL2Tx != nil { - validTxs = append(validTxs, *validL2Tx) + if validL2Tx == nil { + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue } } else if l2Txs[i].ToIdx >= common.IdxUserThreshold { receiverAcc, err := txsel.localAccountsDB.GetAccount(l2Txs[i].ToIdx) @@ -352,23 +403,41 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, continue } } + } - // Account found in the DB, include the l2Tx in the selection - validTxs = append(validTxs, l2Txs[i]) - } else if l2Txs[i].ToIdx == common.Idx(1) { - // valid txs (of Exit type) - validTxs = append(validTxs, l2Txs[i]) + // get CoordIdxsMap for the TokenID of the current l2Txs[i] + // get TokenID from tx.Sender account + tokenID := accSender.TokenID + coordIdx, err := txsel.getCoordIdx(tokenID) + if err != nil { + // if err is db.ErrNotFound, should not happen, as all + // the validTxs.TokenID should have a CoordinatorIdx + // created in the DB at this point + return nil, nil, nil, nil, nil, nil, + tracerr.Wrap(fmt.Errorf("Could not get CoordIdx for TokenID=%d, "+ + "due: %s", tokenID, err)) + } + // prepare temp coordIdxsMap & AccumulatedFees for the call to + // ProcessL2Tx + coordIdxsMap := map[common.TokenID]common.Idx{tokenID: coordIdx} + // tp.AccumulatedFees = make(map[common.Idx]*big.Int) + if _, ok := tp.AccumulatedFees[coordIdx]; !ok { + tp.AccumulatedFees[coordIdx] = big.NewInt(0) } - noncesMap[l2Txs[i].FromIdx]++ - } - // Process L1CoordinatorTxs - for i := 0; i < len(l1CoordinatorTxs); i++ { - _, _, _, _, err := tp.ProcessL1Tx(nil, &l1CoordinatorTxs[i]) + _, _, _, err = tp.ProcessL2Tx(coordIdxsMap, nil, nil, &l2Txs[i]) if err != nil { - return nil, nil, nil, nil, nil, nil, tracerr.Wrap(err) + log.Debugw("txselector.getL1L2TxSelection at ProcessL2Tx", "err", err) + // Discard L2Tx, and update Info parameter of the tx, + // and add it to the discardedTxs array + l2Txs[i].Info = fmt.Sprintf("Tx not selected (in ProcessL2Tx) due to %s", + err.Error()) + discardedL2Txs = append(discardedL2Txs, l2Txs[i]) + continue } - } + + validTxs = append(validTxs, l2Txs[i]) + } // after this loop, no checks to discard txs should be done // get CoordIdxsMap for the TokenIDs coordIdxsMap := make(map[common.TokenID]common.Idx) @@ -391,9 +460,7 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, } var coordIdxs []common.Idx - tp.AccumulatedFees = make(map[common.Idx]*big.Int) for _, idx := range coordIdxsMap { - tp.AccumulatedFees[idx] = big.NewInt(0) coordIdxs = append(coordIdxs, idx) } // sort CoordIdxs @@ -401,29 +468,6 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, return coordIdxs[i] < coordIdxs[j] }) - // get most profitable L2-tx - maxL2Txs := int(selectionConfig.MaxTx) - - len(l1UserTxs) - len(l1CoordinatorTxs) - - selectedL2Txs := validTxs - if len(validTxs) > maxL2Txs { - selectedL2Txs = selectedL2Txs[:maxL2Txs] - } - var finalL2Txs []common.PoolL2Tx - for i := 0; i < len(selectedL2Txs); i++ { - _, _, _, err = tp.ProcessL2Tx(coordIdxsMap, nil, nil, &selectedL2Txs[i]) - if err != nil { - // the error can be due not valid tx data, or due other - // cases (such as StateDB error). At this initial - // version of the TxSelector, we discard the L2Tx and - // log the error, assuming that this will be iterated in - // a near future. - return nil, nil, nil, nil, nil, nil, - tracerr.Wrap(fmt.Errorf("TxSelector: txprocessor.ProcessL2Tx: %w", err)) - } - finalL2Txs = append(finalL2Txs, selectedL2Txs[i]) - } - // distribute the AccumulatedFees from the processed L2Txs into the // Coordinator Idxs for idx, accumulatedFee := range tp.AccumulatedFees { @@ -452,10 +496,11 @@ func (txsel *TxSelector) getL1L2TxSelection(selectionConfig txprocessor.Config, metricSelectedL1CoordinatorTxs.Set(float64(len(l1CoordinatorTxs))) metricSelectedL1UserTxs.Set(float64(len(l1UserTxs))) - metricSelectedL2Txs.Set(float64(len(finalL2Txs))) + metricSelectedL2Txs.Set(float64(len(validTxs))) metricDiscardedL2Txs.Set(float64(len(discardedL2Txs))) - return coordIdxs, accAuths, l1UserTxs, l1CoordinatorTxs, finalL2Txs, discardedL2Txs, nil + // return coordIdxs, accAuths, l1UserTxs, l1CoordinatorTxs, validTxs, discardedL2Txs, nil + return coordIdxs, accAuths, l1UserTxs, l1CoordinatorTxs, validTxs, discardedL2Txs, nil } // processTxsToEthAddrBJJ process the common.PoolL2Tx in the case where @@ -567,7 +612,10 @@ func (txsel *TxSelector) processTxToEthAddrBJJ(validTxs []common.PoolL2Tx, Type: common.TxTypeCreateAccountDeposit, } } - if len(l1CoordinatorTxs) >= int(selectionConfig.MaxL1Tx)-nL1UserTxs { + // if there is no space for the L1CoordinatorTx as MaxL1Tx, or no space + // for L1CoordinatorTx + L2Tx as MaxTx, discard the L2Tx + if len(l1CoordinatorTxs) >= int(selectionConfig.MaxL1Tx)-nL1UserTxs || + len(l1CoordinatorTxs)+1 >= int(selectionConfig.MaxTx)-nL1UserTxs { // L2Tx discarded return nil, nil, nil, tracerr.Wrap(fmt.Errorf("L2Tx discarded due to no available slots " + "for L1CoordinatorTx to create a new account for receiver of L2Tx")) diff --git a/txselector/txselector_test.go b/txselector/txselector_test.go index deb82e0..b8bc2ed 100644 --- a/txselector/txselector_test.go +++ b/txselector/txselector_test.go @@ -276,22 +276,23 @@ func TestGetL2TxSelectionMinimumFlow0(t *testing.T) { assert.True(t, l2TxsFromDB[0].VerifySignature(chainID, tc.Users["A"].BJJ.Public().Compress())) assert.True(t, l2TxsFromDB[1].VerifySignature(chainID, tc.Users["B"].BJJ.Public().Compress())) l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[6].Batch.ForgeL1TxsNum]) - coordIdxs, accAuths, oL1UserTxs, oL1CoordTxs, oL2Txs, _, err := + coordIdxs, accAuths, oL1UserTxs, oL1CoordTxs, oL2Txs, discardedL2Txs, err := txsel.GetL1L2TxSelection(tpc, l1UserTxs) require.NoError(t, err) - assert.Equal(t, []common.Idx{261, 262}, coordIdxs) + assert.Equal(t, []common.Idx{261, 263}, coordIdxs) assert.Equal(t, txsel.coordAccount.AccountCreationAuth, accAuths[0]) - assert.Equal(t, txsel.coordAccount.AccountCreationAuth, accAuths[1]) - assert.Equal(t, accAuthSig0, accAuths[2]) + assert.Equal(t, txsel.coordAccount.AccountCreationAuth, accAuths[2]) + assert.Equal(t, accAuthSig0, accAuths[1]) assert.Equal(t, accAuthSig1, accAuths[3]) assert.Equal(t, 1, len(oL1UserTxs)) assert.Equal(t, 4, len(oL1CoordTxs)) assert.Equal(t, 2, len(oL2Txs)) + assert.Equal(t, 0, len(discardedL2Txs)) assert.Equal(t, len(oL1CoordTxs), len(accAuths)) assert.Equal(t, common.BatchNum(7), txsel.localAccountsDB.CurrentBatch()) assert.Equal(t, common.Idx(264), txsel.localAccountsDB.CurrentIdx()) - checkBalanceByIdx(t, txsel, 261, "20") // CoordIdx for TokenID=1 - checkBalanceByIdx(t, txsel, 262, "10") // CoordIdx for TokenID=0 + checkBalance(t, tc, txsel, "Coord", 1, "20") // CoordIdx for TokenID=1 + checkBalance(t, tc, txsel, "Coord", 0, "10") // CoordIdx for TokenID=1 checkBalance(t, tc, txsel, "A", 0, "600") checkBalance(t, tc, txsel, "A", 1, "280") checkBalance(t, tc, txsel, "B", 0, "290") @@ -324,19 +325,20 @@ func TestGetL2TxSelectionMinimumFlow0(t *testing.T) { assert.True(t, l2TxsFromDB[2].VerifySignature(chainID, tc.Users["B"].BJJ.Public().Compress())) assert.True(t, l2TxsFromDB[3].VerifySignature(chainID, tc.Users["A"].BJJ.Public().Compress())) l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[7].Batch.ForgeL1TxsNum]) - coordIdxs, accAuths, oL1UserTxs, oL1CoordTxs, oL2Txs, _, err = + coordIdxs, accAuths, oL1UserTxs, oL1CoordTxs, oL2Txs, discardedL2Txs, err = txsel.GetL1L2TxSelection(tpc, l1UserTxs) require.NoError(t, err) - assert.Equal(t, []common.Idx{261, 262}, coordIdxs) + assert.Equal(t, []common.Idx{261, 263}, coordIdxs) assert.Equal(t, 0, len(accAuths)) assert.Equal(t, 0, len(oL1UserTxs)) assert.Equal(t, 0, len(oL1CoordTxs)) assert.Equal(t, 4, len(oL2Txs)) + assert.Equal(t, 0, len(discardedL2Txs)) assert.Equal(t, len(oL1CoordTxs), len(accAuths)) assert.Equal(t, common.BatchNum(8), txsel.localAccountsDB.CurrentBatch()) assert.Equal(t, common.Idx(264), txsel.localAccountsDB.CurrentIdx()) - checkBalanceByIdx(t, txsel, 261, "30") - checkBalanceByIdx(t, txsel, 262, "35") + checkBalance(t, tc, txsel, "Coord", 1, "30") // CoordIdx for TokenID=1 + checkBalance(t, tc, txsel, "Coord", 0, "35") // CoordIdx for TokenID=1 checkBalance(t, tc, txsel, "A", 0, "430") checkBalance(t, tc, txsel, "A", 1, "280") checkBalance(t, tc, txsel, "B", 0, "390") @@ -370,7 +372,7 @@ func TestGetL2TxSelectionMinimumFlow0(t *testing.T) { coordIdxs, accAuths, oL1UserTxs, oL1CoordTxs, oL2Txs, _, err = txsel.GetL1L2TxSelection(tpc, l1UserTxs) require.NoError(t, err) - assert.Equal(t, []common.Idx{262}, coordIdxs) + assert.Equal(t, []common.Idx{263}, coordIdxs) assert.Equal(t, 0, len(accAuths)) assert.Equal(t, 4, len(oL1UserTxs)) assert.Equal(t, 0, len(oL1CoordTxs)) @@ -379,7 +381,7 @@ func TestGetL2TxSelectionMinimumFlow0(t *testing.T) { assert.Equal(t, common.BatchNum(9), txsel.localAccountsDB.CurrentBatch()) assert.Equal(t, common.Idx(264), txsel.localAccountsDB.CurrentIdx()) checkBalanceByIdx(t, txsel, 261, "30") - checkBalanceByIdx(t, txsel, 262, "75") + checkBalanceByIdx(t, txsel, 263, "75") checkBalance(t, tc, txsel, "A", 0, "730") checkBalance(t, tc, txsel, "A", 1, "280") checkBalance(t, tc, txsel, "B", 0, "380") @@ -580,7 +582,6 @@ func TestTransferToBjj(t *testing.T) { require.Equal(t, 1, len(oL1CoordTxs)) assert.Equal(t, poolL2Txs[0].ToEthAddr, oL1CoordTxs[0].FromEthAddr) assert.Equal(t, poolL2Txs[0].ToBJJ, oL1CoordTxs[0].FromBJJ) - // fmt.Printf("DBG l1CoordTx[0]: %+v\n", oL1CoordTxs[0]) assert.Equal(t, 1, len(oL2Txs)) assert.Equal(t, 0, len(discardedL2Txs)) err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), @@ -712,7 +713,8 @@ func TestTransferManyFromSameAccount(t *testing.T) { // add the PoolL2Txs to the l2DB addL2Txs(t, txsel, poolL2Txs) - // batch 2 to crate some accounts with positive balance, and do 8 L2Tx transfers from account A + // batch 2 to crate some accounts with positive balance, and do 8 L2Tx + // transfers from account A l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[1].Batch.ForgeL1TxsNum]) _, _, oL1UserTxs, oL1CoordTxs, oL2Txs, discardedL2Txs, err := txsel.GetL1L2TxSelection(tpc, l1UserTxs) @@ -720,7 +722,7 @@ func TestTransferManyFromSameAccount(t *testing.T) { assert.Equal(t, 3, len(oL1UserTxs)) require.Equal(t, 0, len(oL1CoordTxs)) assert.Equal(t, 7, len(oL2Txs)) - assert.Equal(t, 1, len(discardedL2Txs)) + assert.Equal(t, 4, len(discardedL2Txs)) err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), txsel.localAccountsDB.CurrentBatch()) @@ -803,8 +805,8 @@ func TestPoolL2TxInvalidNonces(t *testing.T) { require.NoError(t, err) require.Equal(t, 3, len(oL1UserTxs)) require.Equal(t, 0, len(oL1CoordTxs)) - require.Equal(t, 2, len(oL2Txs)) - require.Equal(t, 8, len(discardedL2Txs)) + require.Equal(t, 0, len(oL2Txs)) + require.Equal(t, 10, len(discardedL2Txs)) require.Equal(t, 0, len(accAuths)) err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), @@ -819,7 +821,7 @@ func TestPoolL2TxInvalidNonces(t *testing.T) { require.Equal(t, 0, len(oL1UserTxs)) require.Equal(t, 3, len(oL1CoordTxs)) - require.Equal(t, 6, len(oL2Txs)) + require.Equal(t, 8, len(oL2Txs)) require.Equal(t, 2, len(discardedL2Txs)) require.Equal(t, 3, len(accAuths)) @@ -843,3 +845,79 @@ func TestPoolL2TxInvalidNonces(t *testing.T) { txsel.localAccountsDB.CurrentBatch()) require.NoError(t, err) } + +func TestProcessL2Selection(t *testing.T) { + set := ` + Type: Blockchain + + CreateAccountDeposit(0) Coord: 0 + CreateAccountDeposit(0) A: 18 + CreateAccountDeposit(0) B: 0 + + > batchL1 // freeze L1User{3} + > batchL1 // forge L1User{3} + > block + ` + + chainID := uint16(0) + tc := til.NewContext(chainID, common.RollupConstMaxL1UserTx) + blocks, err := tc.GenerateBlocks(set) + assert.NoError(t, err) + + hermezContractAddr := ethCommon.HexToAddress("0xc344E203a046Da13b0B4467EB7B3629D0C99F6E6") + txsel := initTest(t, chainID, hermezContractAddr, tc.Users["Coord"]) + + // restart nonces of TilContext, as will be set by generating directly + // the PoolL2Txs for each specific batch with tc.GeneratePoolL2Txs + tc.RestartNonces() + + tpc := txprocessor.Config{ + NLevels: 16, + MaxFeeTx: 10, + MaxTx: 10, + MaxL1Tx: 10, + ChainID: chainID, + } + // batch1 to freeze L1UserTxs + l1UserTxs := []common.L1Tx{} + _, _, _, _, _, _, err = txsel.GetL1L2TxSelection(tpc, l1UserTxs) + require.NoError(t, err) + + // 8 transfers from the same account + batchPoolL2 := ` + Type: PoolL2 + PoolTransfer(0) A-B: 10 (126) + PoolTransfer(0) A-B: 10 (126) // not enough funds + PoolTransfer(0) A-B: 5 (126) // enough funds + ` + poolL2Txs, err := tc.GeneratePoolL2Txs(batchPoolL2) + require.NoError(t, err) + require.Equal(t, 3, len(poolL2Txs)) + + // add the PoolL2Txs to the l2DB + addL2Txs(t, txsel, poolL2Txs) + // batch 2 to crate some accounts with positive balance, and do 8 L2Tx transfers from account A + l1UserTxs = til.L1TxsToCommonL1Txs(tc.Queues[*blocks[0].Rollup.Batches[1].Batch.ForgeL1TxsNum]) + _, _, oL1UserTxs, oL1CoordTxs, oL2Txs, discardedL2Txs, err := + txsel.GetL1L2TxSelection(tpc, l1UserTxs) + require.NoError(t, err) + assert.Equal(t, 3, len(oL1UserTxs)) + require.Equal(t, 0, len(oL1CoordTxs)) + // only 1st L2Tx should be accepted, as: + // - 2nd will not be selected as has not enough funds + // - 3rd will not be selected as has Nonce=2, and the account Nonce==1 + // (due the 2nd txs not being accepted) + assert.Equal(t, 1, len(oL2Txs)) + assert.Equal(t, 2, len(discardedL2Txs)) + assert.Equal(t, common.Nonce(0), oL2Txs[0].Nonce) + assert.Equal(t, common.Nonce(1), discardedL2Txs[0].Nonce) + assert.Equal(t, common.Nonce(2), discardedL2Txs[1].Nonce) + assert.Equal(t, "Tx not selected due to not enough Balance at the sender. "+ + "Current sender account Balance: 7, Amount+Fee: 11", discardedL2Txs[0].Info) + assert.Equal(t, "Tx not selected due to not current Nonce. Tx.Nonce: 2, "+ + "Account.Nonce: 1", discardedL2Txs[1].Info) + + err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), + txsel.localAccountsDB.CurrentBatch()) + require.NoError(t, err) +}