Commit Graph

775 Commits

Author SHA1 Message Date
Eduard S
6fa4a2e799 Merge pull request #450 from hermeznetwork/feature/l2db-maxtxs
Add max txs limit to tx pool
2021-01-05 12:42:22 +01:00
a_bennassar
44b0b8f778 Merge pull request #451 from hermeznetwork/feature/varchar-utf8
Sanitize varchars that may not be UTF-8
2021-01-05 12:33:08 +01:00
Arnau B
622e01e9af Add max txs limit to tx pool 2021-01-04 18:38:25 +01:00
Eduard S
6bd10fc009 Merge pull request #448 from hermeznetwork/feature/txselector0
Feature/txselector0
2021-01-04 16:56:38 +01:00
arnaucube
135144636a TxSelector Coord fees & Nonces checks & other
- Add missing Fees to CoordAccounts after processing PoolL2Txs
- Add Nonces checks for L2Txs (txs with incorrect nonces not included
in the selection)
- Add missing MakeCheckpoint() at the LocalAccountsDB once the
selection is done
- Add TxSelector test of full flow using Til.SetBlockchainMinimumFlow0
checking balances & parameters
2021-01-04 16:52:18 +01:00
arnaucube
48bdec1397 Fix TxProcessor TokenID use &updates at Til&Common
- Til
  - tests that were using `til.SetBlockchainMinimumFlow0` have been
updated, as now the L1CoordinatorTxs are placed simulating TxSelector
creation (when needed, not before)
  - Add `EthSk` to `tc.User` to allow to sign `AccoutCreationAuths` at
the tests flows
- TxProcessor
  - for L2Txs get TokenID from tx.FromIdx Account.TokenID instead than
  - update tests vectors for new values
from tx.TokenID (which not always is set)
- Common
  - move TxIDsFromL2Txs & TxIDsFromPoolL2Txs from `coordinator` to
`common` to allow usage from other packages
2021-01-04 15:28:04 +01:00
ToniRamirezM
e2d243a9b5 Sanitize varchars that may not be UTF-8 2021-01-04 13:06:53 +01:00
a_bennassar
926943cb71 Merge pull request #447 from hermeznetwork/feature/change-queries
Change queries that produced undesired meddler logs
2021-01-04 10:31:21 +01:00
a_bennassar
bc88987917 Merge pull request #445 from hermeznetwork/feature/configmeddlerdebug
Add config flag to enable/disable meddler logs
2021-01-04 10:25:05 +01:00
a_bennassar
65abdd408a Merge pull request #442 from hermeznetwork/feature/new-metrics-tests
Added new metrics tests
2021-01-04 10:23:17 +01:00
Eduard S
6c1c1fa80c Merge pull request #444 from hermeznetwork/feature/txsel-coordidxs-upd
Update TxSelector to return CoordIdxs used & other
2020-12-31 13:24:20 +01:00
arnaucube
79b3de7178 Update TxSelector to return CoordIdxs used & other
- StateDB
  - Update GetIdxByEthAddrBJJ to return ErrToIdxNotFound when idx not found, so can be checked at upper levels
- TxSelector
  - rm CoordIdxsDB that is no longer needed (also related methods)
  - add `getCoordIdx` method to get the Coordinator Idx for a given TokenID
  - Update coordinator account creation related to new TokenIDs from L2Txs
  - Reorganize GetL1L2TxSelection
  - return CoordIdxs used in the selection
- Update go-merkletree version which avoids marshaling Siblings to json
with 'null' value in case of empty array
2020-12-31 13:16:41 +01:00
ToniRamirezM
3e70551ac5 Added new metrics tests 2020-12-31 12:29:49 +01:00
Eduard S
f5d81ca8f8 Add config flag to enable/disable meddler logs
- In config, add Debug.MeddlerLogs to enable meddler debug logs.  This only
  affects the node started via cli, tests swill ran with `meddler.Debug = true`
- Remove unused ethereum client functions and config parameters
- Document all the config parameters
2020-12-31 11:00:05 +01:00
arnau
5c037e0a8f Merge pull request #441 from hermeznetwork/feature/configcircuits
Add circuit configuration to node config
2020-12-31 10:55:52 +01:00
Eduard S
18c854fbaa Add circuit configuration to node config
- Remove MaxL1CoordTxs parameter from the TxSelector because this parameter
  doesn't exist
- Use ChainID in l1tx byte encoding
- Pass txprocessor configuration to batch builder via an existing parameter
2020-12-31 10:44:19 +01:00
arnau
a9804dcc2b Merge pull request #439 from hermeznetwork/feature/cliwipesql
Add cli command to wipe the SQL DB
2020-12-31 10:38:47 +01:00
Eduard S
e5fc403451 Add cli command to wipe the SQL DB
- Refactor the migrations code so that packr is only called (via an init
  function in `db/utils.go`).
- When loading the migrations, make sure there is at least one migration,
  otherwise panic (this would happen if the node is built incorrectly)
2020-12-31 10:34:32 +01:00
arnau
2e51860c37 Merge pull request #437 from hermeznetwork/feature/ethprivkey
Load ethereum private key
2020-12-31 10:33:44 +01:00
ToniRamirezM
64b214061c Change queries that produced undesired meddler logs 2020-12-30 19:12:53 +01:00
Eduard S
fedbacaade Merge pull request #440 from hermeznetwork/fix/api-empty-arrays
empty array instead of 404
2020-12-30 13:56:03 +01:00
Arnau B
a32f75db78 empty array instead of 404 2020-12-30 12:41:53 +01:00
a_bennassar
c2dd982d26 Merge pull request #436 from hermeznetwork/feature/exit-proof-siblings
Update ExitProofs-Siblings padding
2020-12-30 11:13:22 +01:00
Eduard S
42791181a1 Load ethereum private key
Load an ethereum keystore when the node is started in coordinator mode.  The
private key corresponding to the forger address must be imported into the
keystore before running the node in coordinator mode.  You can see an examples
in `cli/node/load-sk-example.sh`.
2020-12-30 10:48:14 +01:00
arnaucube
ca5870e3ba Update ExitProofs-Siblings padding 2020-12-30 10:44:34 +01:00
Eduard S
88f924e9dd Merge pull request #435 from hermeznetwork/feature/addrs-in-exit-endpoints
Include addrs in exit responses
2020-12-29 18:01:46 +01:00
Eduard S
6e2cde8a31 Merge pull request #434 from hermeznetwork/fix/next-forgers-null
Fix next forgers when no bids
2020-12-29 17:59:18 +01:00
Arnau B
6cd292b937 Include addrs in exit responses 2020-12-29 17:35:20 +01:00
Eduard S
8c6dc6e3f8 Merge pull request #433 from hermeznetwork/feature/kvdb
Abstract KVDB from StateDB
2020-12-29 17:21:01 +01:00
Arnau B
d3c703ca75 Fix next forgers when no bids 2020-12-29 16:55:26 +01:00
arnaucube
68bfbff269 Abstract KVDB from StateDB
- KVDB contains the Checkpoint & Resets system
- StateDB uses KVDB and adds all the StateDB related methods
2020-12-29 16:48:01 +01:00
Eduard S
890b94a41a Merge pull request #428 from hermeznetwork/fix/api-next-forgers
Fix next forgers api response
2020-12-29 15:32:02 +01:00
Arnau B
6058d3c41a Fix next forgers api response 2020-12-29 15:17:55 +01:00
a_bennassar
57cb6ac31f Merge pull request #429 from hermeznetwork/feature/maybefixitemid
Fix item_id order in forged l1UserTxs
2020-12-29 15:15:54 +01:00
Eduard S
02c2ee155a Fix item_id order in forged l1UserTxs
Also, make sure that all SQL queries that return slices are sorted
2020-12-29 12:28:53 +01:00
Eduard S
88cd43efbd Merge pull request #427 from hermeznetwork/feature/abstr-txprocessor
Abstract TxProcessor from StateDB
2020-12-29 11:18:57 +01:00
arnaucube
0cf1ed217b Abstract TxProcessor from StateDB
- Abstract TxProcessor from StateDB
- Upgrade to last version of go-merkletree for the key-value DB usage
2020-12-29 11:14:38 +01:00
Eduard S
025b56c8c3 Merge pull request #425 from hermeznetwork/fix/zki-ntx
Fix ZKI NTx for MaxTx
2020-12-28 12:17:51 +01:00
Eduard S
e69970cd41 Merge pull request #424 from hermeznetwork/feature/acccreationauth-js-comp
AccountCreationAuth compatible with js implementation
2020-12-28 11:48:38 +01:00
arnaucube
cf199fd832 Fix ZKI NTx for MaxTx
On the Circuits uses the name `nTx` (and on the tests `maxTx`), but
Contracts `maxTx`. On Go we had both variables, but really only used
one, now at Go we use `MaxTx` to refer to the maximum number of
transactions.
2020-12-28 11:26:47 +01:00
arnaucube
ca010275e1 AccountCreationAuth compatible with js implementation 2020-12-28 11:16:00 +01:00
arnau
cbcd387f98 Merge pull request #423 from hermeznetwork/feature/integration27
Delete old checkpoints in stateDB automatically & Don't log errors when context done
2020-12-28 11:15:00 +01:00
Eduard S
a0c8ace38d Add missing tracerr.Wrap 2020-12-24 13:39:27 +01:00
Eduard S
2205fcadbc Delete old checkpoints in stateDB automatically
Introduce a constructor parameter for the StateDB called `keep`, which tells
how many checkpoints to keep.  When doing a new checkpoint, if the number of
existing checkpoints exeeds `keep`, the oldest ones will be deleted.
2020-12-24 13:35:47 +01:00
Eduard S
1b55296006 Merge pull request #420 from hermeznetwork/feature/txsel-accauths
TxSel return of AccCreatAuths from the selection
2020-12-24 11:07:02 +01:00
Eduard S
6a2b9474e3 Merge pull request #416 from hermeznetwork/feature/update-accountcreationauth
Update AccountCreationAuth & fix auth.HashToSign
2020-12-24 10:50:18 +01:00
arnaucube
8615a462ab Update AccountCreationAuth & fix auth.HashToSign
- Fix AccountCreationAuth.HashToSign (was using `[]byte("0x...")`, which
uses the bytes of the string. Now uses the bytearray of the compressed
BJJ public key (compatible with js implementation))
- Update AccountCreationAuth to last specification (add to hash
parameters ChainID & HermezAddress)
- Add missing test to AccountCreationAuth
2020-12-24 10:41:35 +01:00
arnaucube
6413011294 TxSel return of AccCreatAuths from the selection
Add return of AccountCreationAuths at the TxSelector, which is 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.
2020-12-24 10:34:41 +01:00
arnau
e787651ba3 Merge pull request #414 from hermeznetwork/feature/syncforgercommitment
Sync ForgerCommitment and use it in coord
2020-12-24 10:31:58 +01:00
Eduard S
35d598f564 Don't log errors when context done 2020-12-23 17:33:41 +01:00