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
Eduard S
8267d007c9
Sync ForgerCommitment and use it in coord
...
Previously the coordinator was erroneously using Slot.BatchesLen to determine
when anyone can forge. The correct behaviour is implmenented with the boolean
flag `ForgerCommitment`, that is set to true only when there's a batch before
the deadline within a slot.
Delete Slot.BatchesLen, and the synchronization code of this value from the
Synchronizer, as this is not needed
2020-12-23 17:06:20 +01:00
Eduard S
cd6eb44c16
Merge pull request #413 from hermeznetwork/feature/parametrize-chainid
...
Parametrize ChainID
2020-12-23 16:35:39 +01:00
Eduard S
086dc85104
Get ChainID from ethereum node
2020-12-23 16:26:56 +01:00
arnaucube
150597c282
Parametrize ChainID
2020-12-23 15:23:48 +01:00
Eduard S
adc044001f
Merge pull request #412 from hermeznetwork/fix/sdb-nonce
...
Fix StateDB & Til Nonce increment
2020-12-23 12:47:40 +01:00
arnaucube
eea44b3990
Fix StateDB & Til Nonce increment
2020-12-23 12:32:41 +01:00
Eduard S
fb48ca4e58
Merge pull request #411 from hermeznetwork/feature/forged-txs-in-batchesapi
...
Add forged txs in batch endpoints response
2020-12-23 12:07:45 +01:00
Eduard S
4793a20727
Merge pull request #408 from hermeznetwork/feature/txsel-update-processinglogic
...
TxSelector update txs processing logic
2020-12-23 11:48:06 +01:00
arnaucube
982a423bf3
TxSelector update txs processing logic
2020-12-23 11:36:41 +01:00
Arnau B
6e7f860d61
Add forged txs in batch endpoints response
2020-12-23 11:26:23 +01:00
arnau
3cf615a769
Merge pull request #406 from hermeznetwork/feature/implforgebatchargs
...
Implement Pipeline.prepareForgeBatchArgs()
2020-12-23 11:22:28 +01:00
Eduard S
8d5b375625
Merge pull request #407 from hermeznetwork/fix/api-coordinator
...
Add bootCoord to coord table, get coord by forgerAddr
2020-12-23 11:10:23 +01:00
arnaucube
2583d35adf
Update ZKInputs for empty batches
...
- Add TestZKInputsEmpty circom test vectors
- Fix ZKInputsHash OldLastIdx bytearray
2020-12-23 11:09:43 +01:00
Arnau B
bc5fa92898
Add bootCoord to coord table, get coord by forgerAddr
2020-12-23 11:03:21 +01:00
Eduard S
cd1a193dcd
Merge pull request #405 from hermeznetwork/fix/api-nonce
...
Fix API nonces
2020-12-22 17:43:24 +01:00
Eduard S
a50bda3f59
Update packr dependency
...
Update packr to 2.8.1 which fixes this issue:
https://github.com/gobuffalo/packr/issues/261 which I encountered while running
a test with `-race`
2020-12-22 17:27:38 +01:00
Eduard S
6a990376b4
Implement Pipeline.prepareForgeBatchArgs()
...
- Implement Pipeline.prepareForgeBatchArgs()
- Add a minimal stress test for the coordinator (that also runs the
synchronizer)
- Update txprocessor.ProcessTxs() to return valid results for batches without
transactions
- Add the boilerplate for the corresponding test, leaving as TODO the
zkInput values
- Update prover client to use the same point format as proof server (projective)
- Update interface of TxSelector.GetCoordIdxs to also return the authorizations
to create accounts that go with the l1CoordinatorTxs.
2020-12-22 17:27:34 +01:00
arnau
c61c4f3376
Merge pull request #402 from hermeznetwork/feature/testpurger
...
Test purger, fix some nonces
2020-12-22 17:15:16 +01:00
Arnau B
a7394cdb2a
Fix API nonces
2020-12-22 16:36:51 +01:00
Eduard S
a8ac35059a
Test purger, fix some nonces
...
- Test all the purger functions
- Fix nonces set by til (previously til started with nonce 1 for pool l2txs,
but the correct implementation is to start with nonce 0)
- Rename L2DB.CheckNonces to L2DB.invalidateOldNoncesQuery
- Rename L2DB.checkNoncesQuery to L2DB.InvalidateOldNonces
Related https://github.com/hermeznetwork/hermez-node/issues/392 (Fix checkNoncesQuery)
Resolve https://github.com/hermeznetwork/hermez-node/issues/396
2020-12-22 12:00:12 +01:00
a_bennassar
8a2df8de0d
Merge pull request #390 from hermeznetwork/feature/bjj-comp
...
Feature/bjj comp
2020-12-22 11:44:19 +01:00
arnaucube
4b10549822
mv of babyjub.PublicKey to babyjub.PublicKeyComp
...
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
2020-12-22 11:29:47 +01:00
a_bennassar
0401ff6180
Merge pull request #385 from hermeznetwork/feature/integratepriceupdater
...
Update and integrate price updater
2020-12-21 09:56:07 +01:00
arnau
b9943182b8
Merge pull request #383 from hermeznetwork/feature/initvars
...
Use init SC vars and start block from events
2020-12-18 20:26:41 +01:00
Eduard S
92e34fb683
Merge pull request #387 from hermeznetwork/feature/fix-get-best-bid-coord
...
Fix historyDB GetBestBidCoordinator
2020-12-18 17:53:34 +01:00
laisolizq
bc29222341
Fix historyDB GetBestBidCoordinator
2020-12-18 17:47:41 +01:00
Eduard S
56fffdcee5
Update and integrate price updater
...
PriceUpdater:
- Pass context so that it can be canceled during an update loop
- Define APITypes to make it explicit which API we are using
2020-12-18 17:19:53 +01:00
Eduard S
b1a8384f27
Run go-instrument-errors to wrap errors
2020-12-18 13:39:42 +01:00