Commit Graph

709 Commits

Author SHA1 Message Date
Eduard S
ca6a4a6013 Merge pull request #481 from hermeznetwork/feature/set-idx-new-accounts
Add idx for txs that create account
2021-01-14 10:22:10 +01:00
Eduard S
ec194d5066 Set l1tx.EffectiveFromIdx in TxProcessor and til 2021-01-13 18:20:47 +01:00
Arnau B
50fc607306 Add idx for txs that creat account, step1 2021-01-13 18:16:32 +01:00
arnau
84eff53691 Merge pull request #482 from hermeznetwork/feature/document
Document that /tmp should be mounted as tmpfs
2021-01-13 16:11:58 +01:00
arnau
6651df1e52 Merge pull request #480 from hermeznetwork/feature/testrealprover
Fix ChainID in zkInputs empty TxCmpData
2021-01-13 14:35:49 +01:00
arnaucube
a16ec1750e Abstract txs generation for ZKInputs tests
- TxProcessor move txCompressedDataEmpty inside the if of tp.zki!=nil
- Abstract generation of transactions for ZKInput tests to avoid code
repetition
  - used at txprocessor & test/zkproof tests
2021-01-13 14:29:37 +01:00
Eduard S
570926398c Document that /tmp should be mounted as tmpfs
Resolve #214
2021-01-13 13:27:55 +01:00
Eduard S
75f068baa8 Fix ChainID in zkInputs empty TxCmpData
Test TxProcessor zkInputs against a real proof server
2021-01-13 12:41:00 +01:00
Eduard S
5becadfa6e Merge pull request #479 from hermeznetwork/feature/log-outputs
Add opt to disable print logs but storing to file
2021-01-12 19:13:44 +01:00
arnaucube
dffc7e2f4e Add opt to disable print logs but storing to file
By default outputs contains "stdout", which prints the logs at the
output of the process. To add a log file as output, the path should be
added at the outputs array. To avoid printing the logs but storing them
on a file, can use []string{"pathtofile.log"}
2021-01-12 18:55:05 +01:00
a_bennassar
1550b69f26 Merge pull request #478 from hermeznetwork/feature/api-bid-big-int
Remove big.Int from state API
2021-01-12 18:52:38 +01:00
ToniRamirezM
170da500db Remove big.Int from state API 2021-01-12 18:37:56 +01:00
a_bennassar
a5643c16f6 Merge pull request #476 from hermeznetwork/feature/api-big-ints-removal
Remove bigints from API
2021-01-12 15:35:16 +01:00
Eduard S
dade77046b Merge pull request #475 from hermeznetwork/feature/zki-batchnum
Add ZKI tests Til last batches MinimumFlow0 &other
2021-01-12 13:14:53 +01:00
arnaucube
0bea7bcfea Add ZKI tests Til last batches MinimumFlow0 &other
- Add ZKI tests Til last batches MinimumFlow0
- Fix zki.CurrentNumBatch
- Fix StateDB BatchNum log
2021-01-12 13:10:42 +01:00
arnau
48ec769914 Merge pull request #474 from hermeznetwork/fix/coordinatorl1batch
Fix forging L1Batch too early
2021-01-12 13:10:10 +01:00
Eduard S
484fca12f8 Organize coordinator code, and rename some funcs 2021-01-12 12:57:44 +01:00
ToniRamirezM
ce6a271448 Remove bigints from API 2021-01-12 11:05:13 +01:00
Eduard S
101a954775 Fix forging L1Batch too early
When scheduling an L1Batch, make sure the previous L1Batch has been
synchronized.  Otherwise, an L1Batch will be forged that may not contain all
the L1UserTxs that are supposed to be included.
2021-01-11 16:16:05 +01:00
a_bennassar
65a1057980 Merge pull request #473 from hermeznetwork/feature/buckets-update
Update buckets withdrawals on API
2021-01-11 15:43:00 +01:00
ToniRamirezM
0bb69c3f3e Update buckets withdrawals on API 2021-01-11 15:21:50 +01:00
Eduard S
0a461fe60c Merge pull request #471 from hermeznetwork/feature/zki6-comp
ZKInput with L2Txs compatible with circom circuits
2021-01-11 12:20:48 +01:00
arnaucube
b59710a149 ZKInput with L2Txs compatible with circom circuits
- Til
  - update Til users BJJ key generation for better js tests
    compatibility
- Common
  - PoolL2Tx to L2Tx use AuxToIdx in case that ToIdx is 0
  - Update ZKInputs parameter descriptions
- TxProcessor
  - Fix AccumulatedFees in case that there is no CoordIdx for that token
  - Fix zki.NewExit usage
  - Use same order for AccumulatedFees & FeeIdx & FeePlanTokens
  - Add Nonce usage to ExitLeafs
  - Update TestZKInput6 and check its compatibility with circom Hermez
circuits
2021-01-11 11:23:04 +01:00
arnau
b0e925fd71 Merge pull request #470 from hermeznetwork/feature/debug1
Add debug info in batch debug file
2021-01-08 18:13:26 +01:00
Eduard S
2ae936f2bd Merge pull request #469 from hermeznetwork/feature/swagger-imprvmnts
Swagger improvements
2021-01-08 17:57:26 +01:00
Arnau B
b4d8e68730 Swagger improvements 2021-01-08 15:47:44 +01:00
Eduard S
97908447b9 Add debug info in batch debug file
- Debug Batch File
    - Add details about why a batch is scheduled to be L1Batch or regular
    - Add timestamps in time and blockNumber of important events
    - Use a different naming for the files (batchNum + timestamp)
- Coordinator:
    - To make decisions and store debug info, always use the current block that
      is being mined, instead of the last mined block
2021-01-07 18:47:13 +01:00
Eduard S
423b67b707 Merge pull request #468 from hermeznetwork/fix/repeated-bids
Fix repeated items when coordinator is updated
2021-01-07 17:06:16 +01:00
Arnau B
c5e3fdad75 Fix repeated items when coordinator is updated 2021-01-07 16:30:36 +01:00
arnau
ef8a6d1397 Merge pull request #467 from hermeznetwork/feature/fixes2
Update node and apply some fixes
2021-01-07 16:13:42 +01:00
Eduard S
a79cb4edfd Update node and apply some fixes
- Node
	- Load Coordinator Fee Account from config
		- Sign the AccountCreationMsg to generate the
		  AccountCreationAuth
		- Resolve #465
	- Wait for synchronizer termination before stopping coordinator to avoid
	  getting stuck when closing in the following case:
		- The coordinator stops reading the synchronizer msg channel,
		  and the node gets stuck sending a message to that channel.
- Common
	- Move account creation auth signature code to common.
	- Update RollupConstInputSHAConstantBytes
- Coordinator
	- Set batch status in the debug file
	- Propagate SCVariables on reorg
	- Pipeline: Get SCVariables updates
		- Resolve #457
	- Fix off by 1 error in Pipeline.shouldL1L2Batch() (which shouldn't have
	  caused any problem, but it was not right)
- KVDB
	- Delete future checkpoints after reset
	- In `ResetFromSynchronizer`, remove all checkpoints first, and follow
	  the same logic as `reset()`.
- Cli
	- Add command to generate a BabyJubJub key pair (to be used for the
	  Coordinator Fee Account)
- Node
	- Adjust example config `Coordinator.L1BatchTimeoutPerc` to avoid
	  missing the L1Batch deadline with the following setup:
		- a block is mined every 2 seconds
		- single proof server that takes 2 seconds to calculate a proof
- TxProcessor
	- Close temporary pebble used for the exit tree after usage.
		- Resolve #463
2021-01-07 16:09:28 +01:00
Eduard S
580a18e7c6 Merge pull request #462 from hermeznetwork/feature/txselector2
Feature/txselector2
2021-01-05 17:42:16 +01:00
arnaucube
bf5ab12d0e Update Account.PublicKey to Account.BJJ
Update account.PublicKey to account.BJJ for naming consistency with the rest of the code
2021-01-05 15:34:50 +01:00
arnaucube
962b9e4712 Add checks to TxSelector & other:
- Upgrade go-merkletree version to include the last changes of Pebble
that fixes the cgo issues (which should fix #453), from:
c2b05f12d7
- TxSelector
	- Remove parameter batchNum for GetL2TxSelection & GetL1L2TxSelection
	- Add checks of ToBJJ & ToEthAddr when ToIdx>255
	- Avoid getting the sender account twice to get the TokenID of a l2tx
	- Add test to check that selected L2Txs are sorted by Nonce
	- Discard L2Tx that return error at ProcessL2Txs
- executed `go mod tidy`
2021-01-05 15:28:43 +01:00
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