Update usage of `*babyjub.PublicKey` to `babyjub.PublicKeyComp`
- when the key is not defined, internally is used `babyjub.EmptyBJJComp`, which is a `[32]byte` of zeroes of type `babyjub.PublicKeyComp`
- the API continues returning `nil` when the key is not defined
// HezBJJ is used to scan/value *babyjub.PublicKey directly into strings that follow the BJJ public key hez fotmat (^hez:[A-Za-z0-9_-]{44}$) from/to sql DBs.
// It assumes that *babyjub.PublicKey are inserted/fetched to/from the DB using the default Scan/Value interface
// HezBJJ is used to scan/value *babyjub.PublicKeyComp directly into strings that follow the BJJ public key hez fotmat (^hez:[A-Za-z0-9_-]{44}$) from/to sql DBs.
// It assumes that *babyjub.PublicKeyComp are inserted/fetched to/from the DB using the default Scan/Value interface
typeHezBJJstring
// NewHezBJJ creates a HezBJJ from a *babyjub.PublicKey.
// NewHezBJJ creates a HezBJJ from a *babyjub.PublicKeyComp.
// Calling this method with a nil bjj causes panic
// Account is a struct that gives information of the holdings of an address and a specific token. Is the data structure that generates the Value stored in the leaf of the MerkleTree
typeAccountstruct{
IdxIdx`meddler:"idx"`
TokenIDTokenID`meddler:"token_id"`
BatchNumBatchNum`meddler:"batch_num"`
PublicKey*babyjub.PublicKey`meddler:"bjj"`
EthAddrethCommon.Address`meddler:"eth_addr"`
NonceNonce`meddler:"-"`// max of 40 bits used
Balance*big.Int`meddler:"-"`// max of 192 bits used
IdxIdx`meddler:"idx"`
TokenIDTokenID`meddler:"token_id"`
BatchNumBatchNum`meddler:"batch_num"`
PublicKeybabyjub.PublicKeyComp`meddler:"bjj"`
EthAddrethCommon.Address`meddler:"eth_addr"`
NonceNonce`meddler:"-"`// max of 40 bits used
Balance*big.Int`meddler:"-"`// max of 192 bits used
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
Positionint`meddler:"position"`
UserOriginbool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
FromIdxIdx`meddler:"from_idx,zeroisnull"`// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.DepositAmount (deposit)
ToIdxIdx`meddler:"to_idx"`// ToIdx is ignored in L1Tx/Deposit, but used in the L1Tx/DepositAndTransfer
TokenIDTokenID`meddler:"token_id"`
Amount*big.Int`meddler:"amount,bigint"`
TxIDTxID`meddler:"id"`
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
Positionint`meddler:"position"`
UserOriginbool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
FromIdxIdx`meddler:"from_idx,zeroisnull"`// FromIdx is used by L1Tx/Deposit to indicate the Idx receiver of the L1Tx.DepositAmount (deposit)
// PoolL2Tx is a struct that represents a L2Tx sent by an account to the
// coordinator that is waiting to be forged
typePoolL2Txstruct{
// Stored in DB: mandatory fileds
// TxID (12 bytes) for L2Tx is:
// bytes: | 1 | 6 | 5 |
// values: | type | FromIdx | Nonce |
TxIDTxID`meddler:"tx_id"`
FromIdxIdx`meddler:"from_idx"`
ToIdxIdx`meddler:"to_idx,zeroisnull"`
AuxToIdxIdx`meddler:"-"`// AuxToIdx is only used internally at the StateDB to avoid repeated computation when processing transactions (from Synchronizer, TxSelector, BatchBuilder)
TxIDTxID`meddler:"tx_id"`
FromIdxIdx`meddler:"from_idx"`
ToIdxIdx`meddler:"to_idx,zeroisnull"`
// AuxToIdx is only used internally at the StateDB to avoid repeated
// computation when processing transactions (from Synchronizer,
BatchNum*BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
BatchNum*common.BatchNum`meddler:"batch_num"`// batchNum in which this tx was forged. If the tx is L2, this must be != 0
EthBlockNumint64`meddler:"eth_block_num"`// Ethereum Block Number in which this L1Tx was added to the queue
// L1
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes
ToForgeL1TxsNum*int64`meddler:"to_forge_l1_txs_num"`// toForgeL1TxsNum in which the tx was forged / will be forged
UserOrigin*bool`meddler:"user_origin"`// true if the tx was originated by a user, false if it was aoriginated by a coordinator. Note that this differ from the spec for implementation simplification purpposes