Commit Graph

645 Commits

Author SHA1 Message Date
Eduard S
ac400bad77 Upgrade contracts and parse init events 2020-12-18 11:19:02 +01:00
Eduard S
d649dd3395 Merge pull request #379 from hermeznetwork/feature/upd-effamounts
Effective amounts add missing check
2020-12-17 18:18:21 +01:00
arnaucube
0bcf57603c Effective amounts add missing checks 2020-12-17 17:51:23 +01:00
Eduard S
cae69acecb Merge pull request #373 from hermeznetwork/feature/txsel-coordidx
TxSelector add CoordIdxDB, SelectionConfig, abstract filtering
2020-12-17 17:02:51 +01:00
arnaucube
004f852b44 TxSelector add CoordIdxDB, SelectionConfig, abstract filtering
TxTypeToEthAddr & TxTypeToBJJ

- TxSelector
	- Add SelectionConfig for each batch
	- Add CoordIdxDB key-value where the CoordinatorIdxs are stored
	- Separated method for filtering TxTypeToEthAddr & TxTypeToBJJ
2020-12-17 16:46:23 +01:00
a_bennassar
6ac033bdd6 Merge pull request #372 from hermeznetwork/feature/fixtxsorder
Fix order of L1UserTxs
2020-12-17 15:54:05 +01:00
Eduard S
8a59296cb8 Fix order of L1UserTxs
When the synchronizer queries the unforged L1UserTxs, sort them by position

Swap the order of calls setL1UserTxEffectiveAmounts and addBatch in
AddBlockSCData because otherwise, for reasons I dont understand, the item_id of
the txs doesn't follow the position of the txs.
2020-12-17 15:48:01 +01:00
arnau
8838bd62f9 Merge pull request #371 from hermeznetwork/feature/fixpanic1
Fix panic caused by nil batchInfo.ServerProof
2020-12-17 15:12:03 +01:00
Eduard S
7f0d2dfd43 Fix panic caused by nil batchInfo.ServerProof 2020-12-17 13:50:04 +01:00
Eduard S
a3d0765644 Merge pull request #370 from hermeznetwork/fix/pipeline-call
Fix coordinator pipeline forgeBatch call
2020-12-17 13:20:29 +01:00
arnaucube
d871ebc9d6 Fix coordinator pipeline forgeBatch call 2020-12-17 13:15:31 +01:00
arnau
d781b41fed Merge pull request #365 from hermeznetwork/feature/nodecfg
Merge node (sync-only) and coord config
2020-12-17 11:08:10 +01:00
arnau
ca25bd14d2 Merge pull request #363 from hermeznetwork/feature/coordinator1
Make coordinator more robust agains failed forges
2020-12-17 11:06:45 +01:00
Eduard S
12fba96eee Merge pull request #366 from hermeznetwork/fix/api-exit-response
Fix format of the MTP for exit endpoint
2020-12-17 11:02:31 +01:00
arnau
f58cadb34e Merge pull request #362 from hermeznetwork/feature/updatetxs
Update txs constructors and helpers
2020-12-17 10:53:12 +01:00
arnau
c047f2ffe8 Merge pull request #360 from hermeznetwork/feature/integration26
Add mock proof server
2020-12-17 10:17:12 +01:00
Arnau B
8083e4fec3 Fix format of the MTP for exit endpoint 2020-12-16 20:09:17 +01:00
Eduard S
885f584fd2 Add mock proof server 2020-12-16 18:44:48 +01:00
arnau
6dd766be4d Merge pull request #359 from hermeznetwork/feature/integration25
Extend Coordinator tests
2020-12-16 18:07:44 +01:00
Eduard S
11722c60ba Merge node (sync-only) and coord config 2020-12-16 17:30:30 +01:00
Eduard S
f3505000dd Make coordinator more robust agains failed forges 2020-12-16 15:56:54 +01:00
Eduard S
7a30294688 Update txs constructors and helpers
For each tx, move the logic of setting the Type and TxID to separate functions,
so that they can be called when necessary.

In synchronizer, set all the required fields using the `SetID` and `SetType`
for l2txs when needed.  This is necessary because the `ProcessTxs()` works with
`common.PoolL2Tx`, which misses some fields from `common.L2Tx`, and because
`ProcessTxs()` needs the Type to be set, but at the same time `ProcessTxs()`
sets the Nonce, which is required for the `TxID`.
2020-12-16 15:25:55 +01:00
Eduard S
61255d730c Merge pull request #358 from hermeznetwork/fix/api-accounts
Fix inconsistency between api doc and code: hermezEthereumAddress => …
2020-12-16 13:46:16 +01:00
Eduard S
7277dc1eb4 Merge pull request #357 from hermeznetwork/feature/chec-effamount
Update StateDB computeEffectiveAmounts
2020-12-16 13:44:52 +01:00
Eduard S
b53cf10b35 Merge pull request #353 from hermeznetwork/fix/process-l2txs
Add TxType before processing L2 tx
2020-12-16 13:31:41 +01:00
Eduard S
6a9b5ce420 Extend Coordinator tests 2020-12-16 13:13:40 +01:00
Arnau B
226c49f28f Fix inconsistency between api doc and code: hermezEthereumAddress => hezEthereumAddress 2020-12-16 12:29:46 +01:00
Arnau B
fcd6f56cec Add TxType before processing L2 tx 2020-12-16 12:08:41 +01:00
arnaucube
0955016049 Update StateDB computeEffectiveAmounts
For the case of tx.EthAddr!=tx.FromIdx.EthAddr
2020-12-16 11:55:53 +01:00
Eduard S
8e1bfd150d Merge pull request #352 from hermeznetwork/fix/historydb-norows
Fix queries when no rows
2020-12-15 16:29:03 +01:00
Arnau B
c7b7a85b85 Fix queries when no rows 2020-12-15 16:15:42 +01:00
Eduard S
d15721d28a Merge pull request #350 from hermeznetwork/feature/zkinputs6
Update ZKInputs generation:
2020-12-15 15:44:31 +01:00
arnau
872fc6a37e Merge pull request #349 from hermeznetwork/feature/integration23
Make coordinator more responsive
2020-12-15 15:33:39 +01:00
Eduard S
a7351992cd Make coordinator more responsive
- API:
	- Replace `emergencyModeStaringTime` by `emercengyModeStartingBlock`
- Synchronizer:
	- Track emergency mode starting block
- cli/node
	- Add working coordinator config
- coordinator:
	- Retry handler for synchronizer stats in case of error (instead of
	  waiting for the next block to try again)
	- On init, trigger an initial call to the handler for synced block
	  before waiting for the synchronizer, to force the coordinator to start
	  its logic even if there's no new block right after the node has been
	  started (very useful for running in testnet where the frequency of
	  blocks is variable)
	- Merge Msg for synced block and updated vars into one: `MsgSyncBlock`.
2020-12-15 15:15:25 +01:00
arnaucube
593a477e6c ZKInputs generation ISFinalAccFee update
- Update IntermediateState FinalAccFee values to fit in the Circom circuit expected inputs
- Add ZKInputs generation test with transactions generated by Til
(TestZKInputs6)
- BatchBuilder: remove redundant MakeCheckpoint call
2020-12-15 11:49:09 +01:00
Eduard S
a165bda17d Merge pull request #346 from hermeznetwork/feature/zkinputs5
StateDB Exit & ForceExit correct processing & ZKI
2020-12-11 12:43:31 +01:00
arnaucube
a4584499a4 StateDB Exit & ForceExit correct processing & ZKI
- Update tx processor of Exit & ForceExit types
- Update ZKInputs generation related to Exit transactions
- Add TestZKInputs5 which adds tests generation of ZKInputs compatible
with Circom circuits including Exit (L2) & ForceExit (L1) transaction types
- Add StateDB test to check max DepositAmount case
2020-12-11 12:39:05 +01:00
arnau
398f69e633 Merge pull request #345 from hermeznetwork/feature/integration22
Update synchronizer and DB with last contracts updates
2020-12-11 12:37:50 +01:00
Eduard S
d1ced80e62 Update API with new buckets synchronization 2020-12-10 18:00:17 +01:00
Eduard S
20b8d0561f Update synchronizer and DB with last contracts updates
- API
	- When updating network info, handle cases where no batches exists and
	  where no forgers exists
- cli/node
	- Update `cfg.buidler.toml` config file to a working version
- common
	- Add new smart contract structs and extend some existing ones to
	  reflect updates regarding events from the smart contracts
- SQL
	- Add new tables and extend existing ones to reflect updates regarding
	  events from the smart contracts
- db/historydb
	- Add functions to insert new smart contract events data
	- Fix unclosed rows that led to inconsistent sql driver state (replace
	  NamedQuery by NamedExec).  This fixes the error:
	  `pq: unexpected Parse response 'C'`
- db/l2db
	- Close rows after usage
- eth
	- In Rollup event, introduce a new UpdateBucketsParameter when there's a
	  SafeMode event, with `SafeMode = true`
- synchronizer
	- synchronize new events
	- avoid calling `auction.CanForge` before the genesisBlock to avoid
	  getting a revert.
2020-12-10 17:45:17 +01:00
Eduard S
a7e4e8ff6c Merge pull request #341 from hermeznetwork/feature/zkinputs3-4
Fix process L1Tx for correct ZKInputs generation
2020-12-10 13:18:17 +01:00
Eduard S
30c494b547 Merge pull request #333 from hermeznetwork/feature/client-prover
Update prover & add test
2020-12-10 13:03:44 +01:00
arnaucube
e7c8328df1 Fix process L1Tx for correct ZKInputs generation
- StateDB fix process txs of type CreateAccountDepositTransfer & DepositTransfer
- Add TestZKInputs3 & TestZKInputs4 which:
    - have a compatible check in js version to check Circom circuits
compatibility
    - adds test of tx type of CreateAccountDepositTransfer &
DepositTransfer
2020-12-10 12:59:01 +01:00
Eduard S
f5818711dc Simplify prover client, use big.Int in Proof 2020-12-10 12:53:35 +01:00
Eduard S
a05cecca80 Merge pull request #339 from hermeznetwork/feature/missing-deposit-name
Update missing LoadAmount to DepositAmount
2020-12-10 12:15:38 +01:00
a_bennassar
dbb2e957a5 Merge pull request #340 from hermeznetwork/jleebee-patch-1
Update swagger.yml
2020-12-10 11:01:54 +01:00
jleebee
2d85a4d6b9 Update swagger.yml 2020-12-09 19:22:55 +01:00
arnaucube
9d0b278d50 Update missing LoadAmount to DepositAmount
Related to 445f26ec9f
2020-12-09 18:34:01 +01:00
Eduard S
d5c753030a Merge pull request #338 from hermeznetwork/feature/api-amounts
Add amount success and load amount success
2020-12-09 17:20:21 +01:00
Arnau B
e1d34e3796 Add amount success and load amount success 2020-12-09 16:39:18 +01:00