@ -21,10 +21,9 @@ import (
type ZKMetadata struct {
type ZKMetadata struct {
// Circuit parameters
// Circuit parameters
// absolute maximum of L1 or L2 transactions allowed
// absolute maximum of L1 or L2 transactions allowed
NTx uint32
// merkle tree depth
NLevels uint32
MaxLevels uint32
MaxLevels uint32
// merkle tree depth
NLevels uint32
// absolute maximum of L1 transaction allowed
// absolute maximum of L1 transaction allowed
MaxL1Tx uint32
MaxL1Tx uint32
// total txs allowed
// total txs allowed
@ -75,66 +74,66 @@ type ZKInputs struct {
// transaction L1-L2
// transaction L1-L2
// TxCompressedData
// TxCompressedData
TxCompressedData [ ] * big . Int ` json:"txCompressedData" ` // big.Int (max 251 bits), len: [n Tx]
TxCompressedData [ ] * big . Int ` json:"txCompressedData" ` // big.Int (max 251 bits), len: [max Tx]
// TxCompressedDataV2, only used in L2Txs, in L1Txs is set to 0
// TxCompressedDataV2, only used in L2Txs, in L1Txs is set to 0
TxCompressedDataV2 [ ] * big . Int ` json:"txCompressedDataV2" ` // big.Int (max 193 bits), len: [n Tx]
TxCompressedDataV2 [ ] * big . Int ` json:"txCompressedDataV2" ` // big.Int (max 193 bits), len: [max Tx]
// MaxNumBatch is the maximum allowed batch number when the transaction
// MaxNumBatch is the maximum allowed batch number when the transaction
// can be processed
// can be processed
MaxNumBatch [ ] * big . Int ` json:"maxNumBatch" ` // uint32
MaxNumBatch [ ] * big . Int ` json:"maxNumBatch" ` // uint32
// FromIdx
// FromIdx
FromIdx [ ] * big . Int ` json:"fromIdx" ` // uint64 (max nLevels bits), len: [n Tx]
FromIdx [ ] * big . Int ` json:"fromIdx" ` // uint64 (max nLevels bits), len: [max Tx]
// AuxFromIdx is the Idx of the new created account which is consequence of a L1CreateAccountTx
// AuxFromIdx is the Idx of the new created account which is consequence of a L1CreateAccountTx
AuxFromIdx [ ] * big . Int ` json:"auxFromIdx" ` // uint64 (max nLevels bits), len: [n Tx]
AuxFromIdx [ ] * big . Int ` json:"auxFromIdx" ` // uint64 (max nLevels bits), len: [max Tx]
// ToIdx
// ToIdx
ToIdx [ ] * big . Int ` json:"toIdx" ` // uint64 (max nLevels bits), len: [n Tx]
ToIdx [ ] * big . Int ` json:"toIdx" ` // uint64 (max nLevels bits), len: [max Tx]
// AuxToIdx is the Idx of the Tx that has 'toIdx==0', is the
// AuxToIdx is the Idx of the Tx that has 'toIdx==0', is the
// coordinator who will find which Idx corresponds to the 'toBJJAy' or
// coordinator who will find which Idx corresponds to the 'toBJJAy' or
// 'toEthAddr'
// 'toEthAddr'
AuxToIdx [ ] * big . Int ` json:"auxToIdx" ` // uint64 (max nLevels bits), len: [n Tx]
AuxToIdx [ ] * big . Int ` json:"auxToIdx" ` // uint64 (max nLevels bits), len: [max Tx]
// ToBJJAy
// ToBJJAy
ToBJJAy [ ] * big . Int ` json:"toBjjAy" ` // big.Int, len: [n Tx]
ToBJJAy [ ] * big . Int ` json:"toBjjAy" ` // big.Int, len: [max Tx]
// ToEthAddr
// ToEthAddr
ToEthAddr [ ] * big . Int ` json:"toEthAddr" ` // ethCommon.Address, len: [n Tx]
ToEthAddr [ ] * big . Int ` json:"toEthAddr" ` // ethCommon.Address, len: [max Tx]
// OnChain determines if is L1 (1/true) or L2 (0/false)
// OnChain determines if is L1 (1/true) or L2 (0/false)
OnChain [ ] * big . Int ` json:"onChain" ` // bool, len: [n Tx]
OnChain [ ] * big . Int ` json:"onChain" ` // bool, len: [max Tx]
//
//
// Txs/L1Txs
// Txs/L1Txs
//
//
// NewAccount boolean (0/1) flag set 'true' when L1 tx creates a new account (fromIdx==0)
// NewAccount boolean (0/1) flag set 'true' when L1 tx creates a new account (fromIdx==0)
NewAccount [ ] * big . Int ` json:"newAccount" ` // bool, len: [n Tx]
NewAccount [ ] * big . Int ` json:"newAccount" ` // bool, len: [max Tx]
// DepositAmountF encoded as float16
// DepositAmountF encoded as float16
DepositAmountF [ ] * big . Int ` json:"loadAmountF" ` // uint16, len: [n Tx]
DepositAmountF [ ] * big . Int ` json:"loadAmountF" ` // uint16, len: [max Tx]
// FromEthAddr
// FromEthAddr
FromEthAddr [ ] * big . Int ` json:"fromEthAddr" ` // ethCommon.Address, len: [n Tx]
FromEthAddr [ ] * big . Int ` json:"fromEthAddr" ` // ethCommon.Address, len: [max Tx]
// FromBJJCompressed boolean encoded where each value is a *big.Int
// FromBJJCompressed boolean encoded where each value is a *big.Int
FromBJJCompressed [ ] [ 256 ] * big . Int ` json:"fromBjjCompressed" ` // bool array, len: [n Tx][256]
FromBJJCompressed [ ] [ 256 ] * big . Int ` json:"fromBjjCompressed" ` // bool array, len: [max Tx][256]
//
//
// Txs/L2Txs
// Txs/L2Txs
//
//
// RqOffset relative transaction position to be linked. Used to perform atomic transactions.
// RqOffset relative transaction position to be linked. Used to perform atomic transactions.
RqOffset [ ] * big . Int ` json:"rqOffset" ` // uint8 (max 3 bits), len: [n Tx]
RqOffset [ ] * big . Int ` json:"rqOffset" ` // uint8 (max 3 bits), len: [max Tx]
// transaction L2 request data
// transaction L2 request data
// RqTxCompressedDataV2
// RqTxCompressedDataV2
RqTxCompressedDataV2 [ ] * big . Int ` json:"rqTxCompressedDataV2" ` // big.Int (max 251 bits), len: [n Tx]
RqTxCompressedDataV2 [ ] * big . Int ` json:"rqTxCompressedDataV2" ` // big.Int (max 251 bits), len: [max Tx]
// RqToEthAddr
// RqToEthAddr
RqToEthAddr [ ] * big . Int ` json:"rqToEthAddr" ` // ethCommon.Address, len: [n Tx]
RqToEthAddr [ ] * big . Int ` json:"rqToEthAddr" ` // ethCommon.Address, len: [max Tx]
// RqToBJJAy
// RqToBJJAy
RqToBJJAy [ ] * big . Int ` json:"rqToBjjAy" ` // big.Int, len: [n Tx]
RqToBJJAy [ ] * big . Int ` json:"rqToBjjAy" ` // big.Int, len: [max Tx]
// transaction L2 signature
// transaction L2 signature
// S
// S
S [ ] * big . Int ` json:"s" ` // big.Int, len: [n Tx]
S [ ] * big . Int ` json:"s" ` // big.Int, len: [max Tx]
// R8x
// R8x
R8x [ ] * big . Int ` json:"r8x" ` // big.Int, len: [n Tx]
R8x [ ] * big . Int ` json:"r8x" ` // big.Int, len: [max Tx]
// R8y
// R8y
R8y [ ] * big . Int ` json:"r8y" ` // big.Int, len: [n Tx]
R8y [ ] * big . Int ` json:"r8y" ` // big.Int, len: [max Tx]
//
//
// State MerkleTree Leafs transitions
// State MerkleTree Leafs transitions
@ -143,33 +142,33 @@ type ZKInputs struct {
// state 1, value of the sender (from) account leaf. The values at the
// state 1, value of the sender (from) account leaf. The values at the
// moment pre-smtprocessor of the update (before updating the Sender
// moment pre-smtprocessor of the update (before updating the Sender
// leaf).
// leaf).
TokenID1 [ ] * big . Int ` json:"tokenID1" ` // uint32, len: [n Tx]
Nonce1 [ ] * big . Int ` json:"nonce1" ` // uint64 (max 40 bits), len: [n Tx]
Sign1 [ ] * big . Int ` json:"sign1" ` // bool, len: [n Tx]
Ay1 [ ] * big . Int ` json:"ay1" ` // big.Int, len: [n Tx]
Balance1 [ ] * big . Int ` json:"balance1" ` // big.Int (max 192 bits), len: [n Tx]
EthAddr1 [ ] * big . Int ` json:"ethAddr1" ` // ethCommon.Address, len: [n Tx]
Siblings1 [ ] [ ] * big . Int ` json:"siblings1" ` // big.Int, len: [n Tx][nLevels + 1]
TokenID1 [ ] * big . Int ` json:"tokenID1" ` // uint32, len: [max Tx]
Nonce1 [ ] * big . Int ` json:"nonce1" ` // uint64 (max 40 bits), len: [max Tx]
Sign1 [ ] * big . Int ` json:"sign1" ` // bool, len: [max Tx]
Ay1 [ ] * big . Int ` json:"ay1" ` // big.Int, len: [max Tx]
Balance1 [ ] * big . Int ` json:"balance1" ` // big.Int (max 192 bits), len: [max Tx]
EthAddr1 [ ] * big . Int ` json:"ethAddr1" ` // ethCommon.Address, len: [max Tx]
Siblings1 [ ] [ ] * big . Int ` json:"siblings1" ` // big.Int, len: [max Tx][nLevels + 1]
// Required for inserts and deletes, values of the CircomProcessorProof (smt insert proof)
// Required for inserts and deletes, values of the CircomProcessorProof (smt insert proof)
IsOld0_1 [ ] * big . Int ` json:"isOld0_1" ` // bool, len: [n Tx]
OldKey1 [ ] * big . Int ` json:"oldKey1" ` // uint64 (max 40 bits), len: [n Tx]
OldValue1 [ ] * big . Int ` json:"oldValue1" ` // Hash, len: [n Tx]
IsOld0_1 [ ] * big . Int ` json:"isOld0_1" ` // bool, len: [max Tx]
OldKey1 [ ] * big . Int ` json:"oldKey1" ` // uint64 (max 40 bits), len: [max Tx]
OldValue1 [ ] * big . Int ` json:"oldValue1" ` // Hash, len: [max Tx]
// state 2, value of the receiver (to) account leaf
// state 2, value of the receiver (to) account leaf
// if Tx is an Exit, state 2 is used for the Exit Merkle Proof
// if Tx is an Exit, state 2 is used for the Exit Merkle Proof
TokenID2 [ ] * big . Int ` json:"tokenID2" ` // uint32, len: [n Tx]
Nonce2 [ ] * big . Int ` json:"nonce2" ` // uint64 (max 40 bits), len: [n Tx]
Sign2 [ ] * big . Int ` json:"sign2" ` // bool, len: [n Tx]
Ay2 [ ] * big . Int ` json:"ay2" ` // big.Int, len: [n Tx]
Balance2 [ ] * big . Int ` json:"balance2" ` // big.Int (max 192 bits), len: [n Tx]
EthAddr2 [ ] * big . Int ` json:"ethAddr2" ` // ethCommon.Address, len: [n Tx]
Siblings2 [ ] [ ] * big . Int ` json:"siblings2" ` // big.Int, len: [n Tx][nLevels + 1]
TokenID2 [ ] * big . Int ` json:"tokenID2" ` // uint32, len: [max Tx]
Nonce2 [ ] * big . Int ` json:"nonce2" ` // uint64 (max 40 bits), len: [max Tx]
Sign2 [ ] * big . Int ` json:"sign2" ` // bool, len: [max Tx]
Ay2 [ ] * big . Int ` json:"ay2" ` // big.Int, len: [max Tx]
Balance2 [ ] * big . Int ` json:"balance2" ` // big.Int (max 192 bits), len: [max Tx]
EthAddr2 [ ] * big . Int ` json:"ethAddr2" ` // ethCommon.Address, len: [max Tx]
Siblings2 [ ] [ ] * big . Int ` json:"siblings2" ` // big.Int, len: [max Tx][nLevels + 1]
// newExit determines if an exit transaction has to create a new leaf in the exit tree
// newExit determines if an exit transaction has to create a new leaf in the exit tree
NewExit [ ] * big . Int ` json:"newExit" ` // bool, len: [n Tx]
NewExit [ ] * big . Int ` json:"newExit" ` // bool, len: [max Tx]
// Required for inserts and deletes, values of the CircomProcessorProof (smt insert proof)
// Required for inserts and deletes, values of the CircomProcessorProof (smt insert proof)
IsOld0_2 [ ] * big . Int ` json:"isOld0_2" ` // bool, len: [n Tx]
OldKey2 [ ] * big . Int ` json:"oldKey2" ` // uint64 (max 40 bits), len: [n Tx]
OldValue2 [ ] * big . Int ` json:"oldValue2" ` // Hash, len: [n Tx]
IsOld0_2 [ ] * big . Int ` json:"isOld0_2" ` // bool, len: [max Tx]
OldKey2 [ ] * big . Int ` json:"oldKey2" ` // uint64 (max 40 bits), len: [max Tx]
OldValue2 [ ] * big . Int ` json:"oldValue2" ` // Hash, len: [max Tx]
// state 3, value of the account leaf receiver of the Fees
// state 3, value of the account leaf receiver of the Fees
// fee tx
// fee tx
@ -189,29 +188,29 @@ type ZKInputs struct {
// Intermediate States to parallelize witness computation
// Intermediate States to parallelize witness computation
// Note: the Intermediate States (IS) of the last transaction does not
// Note: the Intermediate States (IS) of the last transaction does not
// exist. Meaning that transaction 3 (4th) will fill the parameters
// exist. Meaning that transaction 3 (4th) will fill the parameters
// FromIdx[3] and ISOnChain[3], but last transaction (n Tx-1) will fill
// FromIdx[n Tx-1] but will not fill ISOnChain. That's why IS have
// length of nTx-1, while the other parameters have length of n Tx.
// FromIdx[3] and ISOnChain[3], but last transaction (max Tx-1) will fill
// FromIdx[max Tx-1] but will not fill ISOnChain. That's why IS have
// length of maxTx-1, while the other parameters have length of max Tx.
// Last transaction does not need intermediate state since its output
// Last transaction does not need intermediate state since its output
// will not be used.
// will not be used.
// decode-tx
// decode-tx
// ISOnChain indicates if tx is L1 (true (1)) or L2 (false (0))
// ISOnChain indicates if tx is L1 (true (1)) or L2 (false (0))
ISOnChain [ ] * big . Int ` json:"imOnChain" ` // bool, len: [n Tx - 1]
ISOnChain [ ] * big . Int ` json:"imOnChain" ` // bool, len: [max Tx - 1]
// ISOutIdx current index account for each Tx
// ISOutIdx current index account for each Tx
// Contains the index of the created account in case that the tx is of
// Contains the index of the created account in case that the tx is of
// account creation type.
// account creation type.
ISOutIdx [ ] * big . Int ` json:"imOutIdx" ` // uint64 (max nLevels bits), len: [n Tx - 1]
ISOutIdx [ ] * big . Int ` json:"imOutIdx" ` // uint64 (max nLevels bits), len: [max Tx - 1]
// rollup-tx
// rollup-tx
// ISStateRoot root at the moment of the Tx (once processed), the state
// ISStateRoot root at the moment of the Tx (once processed), the state
// root value once the Tx is processed into the state tree
// root value once the Tx is processed into the state tree
ISStateRoot [ ] * big . Int ` json:"imStateRoot" ` // Hash, len: [n Tx - 1]
ISStateRoot [ ] * big . Int ` json:"imStateRoot" ` // Hash, len: [max Tx - 1]
// ISExitTree root at the moment (once processed) of the Tx the value
// ISExitTree root at the moment (once processed) of the Tx the value
// once the Tx is processed into the exit tree
// once the Tx is processed into the exit tree
ISExitRoot [ ] * big . Int ` json:"imExitRoot" ` // Hash, len: [n Tx - 1]
ISExitRoot [ ] * big . Int ` json:"imExitRoot" ` // Hash, len: [max Tx - 1]
// ISAccFeeOut accumulated fees once the Tx is processed. Contains the
// ISAccFeeOut accumulated fees once the Tx is processed. Contains the
// array of FeeAccount Balances at each moment of each Tx processed.
// array of FeeAccount Balances at each moment of each Tx processed.
ISAccFeeOut [ ] [ ] * big . Int ` json:"imAccFeeOut" ` // big.Int, len: [n Tx - 1][maxFeeIdxs]
ISAccFeeOut [ ] [ ] * big . Int ` json:"imAccFeeOut" ` // big.Int, len: [max Tx - 1][maxFeeIdxs]
// fee-tx:
// fee-tx:
// ISStateRootFee root at the moment of the Tx (once processed), the
// ISStateRootFee root at the moment of the Tx (once processed), the
// state root value once the Tx is processed into the state tree
// state root value once the Tx is processed into the state tree
@ -282,9 +281,8 @@ func (z ZKInputs) MarshalJSON() ([]byte, error) {
}
}
// NewZKInputs returns a pointer to an initialized struct of ZKInputs
// NewZKInputs returns a pointer to an initialized struct of ZKInputs
func NewZKInputs ( chainID uint16 , n Tx, maxL1Tx , max Tx , maxFeeIdxs , nLevels uint32 , currentNumBatch * big . Int ) * ZKInputs {
func NewZKInputs ( chainID uint16 , max Tx, maxL1Tx , maxFeeIdxs , nLevels uint32 , currentNumBatch * big . Int ) * ZKInputs {
zki := & ZKInputs { }
zki := & ZKInputs { }
zki . Metadata . NTx = nTx
zki . Metadata . MaxFeeIdxs = maxFeeIdxs
zki . Metadata . MaxFeeIdxs = maxFeeIdxs
zki . Metadata . MaxLevels = uint32 ( 48 ) //nolint:gomnd
zki . Metadata . MaxLevels = uint32 ( 48 ) //nolint:gomnd
zki . Metadata . NLevels = nLevels
zki . Metadata . NLevels = nLevels
@ -301,22 +299,22 @@ func NewZKInputs(chainID uint16, nTx, maxL1Tx, maxTx, maxFeeIdxs, nLevels uint32
zki . FeePlanTokens = newSlice ( maxFeeIdxs )
zki . FeePlanTokens = newSlice ( maxFeeIdxs )
// Txs
// Txs
zki . TxCompressedData = newSlice ( n Tx)
zki . TxCompressedDataV2 = newSlice ( n Tx)
zki . MaxNumBatch = newSlice ( n Tx)
zki . FromIdx = newSlice ( n Tx)
zki . AuxFromIdx = newSlice ( n Tx)
zki . ToIdx = newSlice ( n Tx)
zki . AuxToIdx = newSlice ( n Tx)
zki . ToBJJAy = newSlice ( n Tx)
zki . ToEthAddr = newSlice ( n Tx)
zki . OnChain = newSlice ( n Tx)
zki . NewAccount = newSlice ( n Tx)
zki . TxCompressedData = newSlice ( max Tx)
zki . TxCompressedDataV2 = newSlice ( max Tx)
zki . MaxNumBatch = newSlice ( max Tx)
zki . FromIdx = newSlice ( max Tx)
zki . AuxFromIdx = newSlice ( max Tx)
zki . ToIdx = newSlice ( max Tx)
zki . AuxToIdx = newSlice ( max Tx)
zki . ToBJJAy = newSlice ( max Tx)
zki . ToEthAddr = newSlice ( max Tx)
zki . OnChain = newSlice ( max Tx)
zki . NewAccount = newSlice ( max Tx)
// L1
// L1
zki . DepositAmountF = newSlice ( n Tx)
zki . FromEthAddr = newSlice ( n Tx)
zki . FromBJJCompressed = make ( [ ] [ 256 ] * big . Int , n Tx)
zki . DepositAmountF = newSlice ( max Tx)
zki . FromEthAddr = newSlice ( max Tx)
zki . FromBJJCompressed = make ( [ ] [ 256 ] * big . Int , max Tx)
for i := 0 ; i < len ( zki . FromBJJCompressed ) ; i ++ {
for i := 0 ; i < len ( zki . FromBJJCompressed ) ; i ++ {
// zki.FromBJJCompressed[i] = newSlice(256)
// zki.FromBJJCompressed[i] = newSlice(256)
for j := 0 ; j < 256 ; j ++ {
for j := 0 ; j < 256 ; j ++ {
@ -325,43 +323,43 @@ func NewZKInputs(chainID uint16, nTx, maxL1Tx, maxTx, maxFeeIdxs, nLevels uint32
}
}
// L2
// L2
zki . RqOffset = newSlice ( n Tx)
zki . RqTxCompressedDataV2 = newSlice ( n Tx)
zki . RqToEthAddr = newSlice ( n Tx)
zki . RqToBJJAy = newSlice ( n Tx)
zki . S = newSlice ( n Tx)
zki . R8x = newSlice ( n Tx)
zki . R8y = newSlice ( n Tx)
zki . RqOffset = newSlice ( max Tx)
zki . RqTxCompressedDataV2 = newSlice ( max Tx)
zki . RqToEthAddr = newSlice ( max Tx)
zki . RqToBJJAy = newSlice ( max Tx)
zki . S = newSlice ( max Tx)
zki . R8x = newSlice ( max Tx)
zki . R8y = newSlice ( max Tx)
// State MerkleTree Leafs transitions
// State MerkleTree Leafs transitions
zki . TokenID1 = newSlice ( n Tx)
zki . Nonce1 = newSlice ( n Tx)
zki . Sign1 = newSlice ( n Tx)
zki . Ay1 = newSlice ( n Tx)
zki . Balance1 = newSlice ( n Tx)
zki . EthAddr1 = newSlice ( n Tx)
zki . Siblings1 = make ( [ ] [ ] * big . Int , n Tx)
zki . TokenID1 = newSlice ( max Tx)
zki . Nonce1 = newSlice ( max Tx)
zki . Sign1 = newSlice ( max Tx)
zki . Ay1 = newSlice ( max Tx)
zki . Balance1 = newSlice ( max Tx)
zki . EthAddr1 = newSlice ( max Tx)
zki . Siblings1 = make ( [ ] [ ] * big . Int , max Tx)
for i := 0 ; i < len ( zki . Siblings1 ) ; i ++ {
for i := 0 ; i < len ( zki . Siblings1 ) ; i ++ {
zki . Siblings1 [ i ] = newSlice ( nLevels + 1 )
zki . Siblings1 [ i ] = newSlice ( nLevels + 1 )
}
}
zki . IsOld0_1 = newSlice ( n Tx)
zki . OldKey1 = newSlice ( n Tx)
zki . OldValue1 = newSlice ( n Tx)
zki . TokenID2 = newSlice ( n Tx)
zki . Nonce2 = newSlice ( n Tx)
zki . Sign2 = newSlice ( n Tx)
zki . Ay2 = newSlice ( n Tx)
zki . Balance2 = newSlice ( n Tx)
zki . EthAddr2 = newSlice ( n Tx)
zki . Siblings2 = make ( [ ] [ ] * big . Int , n Tx)
zki . IsOld0_1 = newSlice ( max Tx)
zki . OldKey1 = newSlice ( max Tx)
zki . OldValue1 = newSlice ( max Tx)
zki . TokenID2 = newSlice ( max Tx)
zki . Nonce2 = newSlice ( max Tx)
zki . Sign2 = newSlice ( max Tx)
zki . Ay2 = newSlice ( max Tx)
zki . Balance2 = newSlice ( max Tx)
zki . EthAddr2 = newSlice ( max Tx)
zki . Siblings2 = make ( [ ] [ ] * big . Int , max Tx)
for i := 0 ; i < len ( zki . Siblings2 ) ; i ++ {
for i := 0 ; i < len ( zki . Siblings2 ) ; i ++ {
zki . Siblings2 [ i ] = newSlice ( nLevels + 1 )
zki . Siblings2 [ i ] = newSlice ( nLevels + 1 )
}
}
zki . NewExit = newSlice ( n Tx)
zki . IsOld0_2 = newSlice ( n Tx)
zki . OldKey2 = newSlice ( n Tx)
zki . OldValue2 = newSlice ( n Tx)
zki . NewExit = newSlice ( max Tx)
zki . IsOld0_2 = newSlice ( max Tx)
zki . OldKey2 = newSlice ( max Tx)
zki . OldValue2 = newSlice ( max Tx)
zki . TokenID3 = newSlice ( maxFeeIdxs )
zki . TokenID3 = newSlice ( maxFeeIdxs )
zki . Nonce3 = newSlice ( maxFeeIdxs )
zki . Nonce3 = newSlice ( maxFeeIdxs )
@ -375,11 +373,11 @@ func NewZKInputs(chainID uint16, nTx, maxL1Tx, maxTx, maxFeeIdxs, nLevels uint32
}
}
// Intermediate States
// Intermediate States
zki . ISOnChain = newSlice ( n Tx - 1 )
zki . ISOutIdx = newSlice ( n Tx - 1 )
zki . ISStateRoot = newSlice ( n Tx - 1 )
zki . ISExitRoot = newSlice ( n Tx - 1 )
zki . ISAccFeeOut = make ( [ ] [ ] * big . Int , n Tx- 1 )
zki . ISOnChain = newSlice ( max Tx - 1 )
zki . ISOutIdx = newSlice ( max Tx - 1 )
zki . ISStateRoot = newSlice ( max Tx - 1 )
zki . ISExitRoot = newSlice ( max Tx - 1 )
zki . ISAccFeeOut = make ( [ ] [ ] * big . Int , max Tx- 1 )
for i := 0 ; i < len ( zki . ISAccFeeOut ) ; i ++ {
for i := 0 ; i < len ( zki . ISAccFeeOut ) ; i ++ {
zki . ISAccFeeOut [ i ] = newSlice ( maxFeeIdxs )
zki . ISAccFeeOut [ i ] = newSlice ( maxFeeIdxs )
}
}