arnaucube
arnaucube/hermez-nodePublic Self-hosted repository

Commit history

18e9e437daa462cc980176744adda95e291d0204
a
Add HistoryDB SQL triggers (#125)
a_bennassar committed on Sep 17, 2020
8a21cd1
a
initial commit
arnaucube committed on Jul 24, 2020
a9c77e9
a
Add txselector base
arnaucube committed on Jul 24, 2020
e77599d
a
Add GHA with Tests & Lints
arnau committed on Jul 24, 2020
d71dfa7
a
Fix import paths
arnaucube committed on Jul 24, 2020
c22ea9e
a
Review changes and operator -> coordinator
a_bennassar committed on Jul 28, 2020
1d8f941
a
Initial dract of the common structs
a_bennassar committed on Jul 24, 2020
b9936f8
a
Definition of txpool interface
a_bennassar committed on Jul 28, 2020
014ceba
a
Update to follow DB spec
a_bennassar committed on Jul 31, 2020
638defd
a
Update Leaf to new spec (Sign+Ay)
arnaucube committed on Aug 5, 2020
16555b5
a
Add common> Idx parsers
arnaucube committed on Aug 4, 2020
37cefb0
a
Add initial structure of BatchBuilder
arnaucube committed on Aug 3, 2020
f3cfba1
a
Add StateDB & LocalStateDB
arnaucube committed on Aug 6, 2020
d8cb729
a
Integrate BatchBuilder with StateDB
arnaucube committed on Aug 7, 2020
350bac6
a
Integrate TxSelector with StateDB
arnaucube committed on Aug 13, 2020
60fa76b
a
Add BatchQueue implementation & minor updates
arnaucube committed on Aug 13, 2020
a1c339c
a
Implement StateDB Checkpoints & Resets system
arnaucube committed on Aug 17, 2020
205db8e
a
Update SQL schemas
a_bennassar committed on Aug 13, 2020
cb1b820
a
Add log system
arnaucube committed on Aug 18, 2020
fab3b86
a
Add tx generation lang interpreter
arnaucube committed on Aug 19, 2020
e2d4599
a
Import & adapt iden/go-iden3-core/eth/client
arnaucube committed on Aug 24, 2020
b33d18f
a
Add statedb ExitTree implementation
arnaucube committed on Aug 24, 2020
0d20047
A
Impl historyDB methods for sync main loop
Arnau B committed on Aug 25, 2020
3e7173b
A
Add usefull methods for reorg
Arnau B committed on Aug 21, 2020
c108739
A
Add sync interface
Arnau B committed on Aug 20, 2020
1cbf54a
a
Add mock EthClient for testing
arnaucube committed on Aug 31, 2020
c523b4a
E
Add ethclient full skeleton
Eduard S committed on Sep 3, 2020
003c353
E
Implement initial version of test.Client
Eduard S committed on Sep 7, 2020
bcd93fe
l
Add contracts & ethclient auction
laisolizq committed on Sep 9, 2020
d3ee6e4
T
L1Tx Codec
ToniRamirezM committed on Sep 9, 2020
a8f6488
E
Integrate test.Client in coordinator_test
Eduard S committed on Sep 15, 2020
c6c50f8
l
update contracts
laisolizq committed on Sep 15, 2020
de51a39
l
update ethclient auction
laisolizq committed on Sep 10, 2020
8600118
A
Implement L2DB
Arnau B committed on Sep 16, 2020
94e1f11
T
Smart Contracts Data Synchronization
ToniRamirezM committed on Sep 15, 2020
145f37b
l
Update ethclient auction & add wdelayer
laisolizq committed on Sep 21, 2020
729f37c
a
Update common.L1Tx parsers, add test checks
arnaucube committed on Sep 15, 2020
92fa8aa
A
Add GET histroy-transactions endpoint
Arnau B committed on Sep 21, 2020
85fe885
a
Add TxSelector L2Tx filtering logic
arnaucube committed on Sep 22, 2020
5d6f8cd
a
Idx to 6 bytes (48 bits)
arnaucube committed on Sep 22, 2020
06703ae
T
Helper methods for Synchronizer and TX refactor
ToniRamirezM committed on Sep 17, 2020
ac67769
l
Update ethclient wdelayer & add auction events
laisolizq committed on Sep 21, 2020
7a3407a
E
Add missing error handling
Eduard S committed on Sep 30, 2020
ca3ae28
E
Update test ethclient and coordinator
Eduard S committed on Sep 17, 2020
0fc4930
A
Connect price updater to historydb
Arnau B committed on Oct 1, 2020
f653ff8
l
Add codec functions
laisolizq committed on Oct 2, 2020
aef6da3
E
Add methods to get ERC20 constants
Eduard S committed on Oct 6, 2020
650911c
A
Avoid using pointers in common
Arnau B committed on Oct 7, 2020
5097939
E
Remove nolints
Eduard S committed on Oct 8, 2020
d100272
E
Update test ethclient, rename rollup var
Eduard S committed on Oct 8, 2020
cbc46db
l
Update ethclient rollup iteration 2
laisolizq committed on Oct 7, 2020
1c54bec
a
Add GeneratePoolL2Txs for a parsed set
arnaucube committed on Oct 7, 2020
182e3d3
l
Update ethclient rollup iteration 3
laisolizq committed on Oct 14, 2020
a405ab3
a
Fix PoolL2Tx.RqTxCompressedData
arnaucube committed on Oct 14, 2020
d7a1ba1
l
Add get token endpoint
laisolizq committed on Oct 15, 2020
63a4f3c
A
Updates request and load amounts
Alberto Elias committed on Oct 16, 2020
b2f0b2e
A
More realistic example amounts
Alberto Elias committed on Oct 15, 2020
ce283d4
l
Add get tokens endpoint
laisolizq committed on Oct 15, 2020
0437101
E
Simplify eth code
Eduard S committed on Oct 21, 2020
a2bda18
E
Implement CalcFeeAmount, Resolve #140
Eduard S committed on Oct 20, 2020
54562c0
E
Delete tmp folders from tests, Resolve #105
Eduard S committed on Oct 20, 2020
88ddbbc
l
Add config endpoint
laisolizq committed on Oct 19, 2020
f90de21
a
Fix test generated transactions L1Tx type
arnaucube committed on Oct 21, 2020
cfdea57
A
Implement tx pool endpoints
Arnau B committed on Oct 14, 2020
006bbf3
T
Coordinators methods for API
ToniRamirezM committed on Oct 21, 2020
f314498
E
Update missing parts, improve til, and more - Node - Updated configuration to initialize the interface to all the smart contracts - Common - Moved BlockData and BatchData types to common so that they can be shared among: historydb, til and synchronizer - Remove hash.go (it was never used) - Remove slot.go (it was never used) - Remove smartcontractparams.go (it was never used, and appropriate structs are defined in `eth/`) - Comment state / status method until requirements of this method are properly defined, and move it to Synchronizer - Synchronizer - Simplify `Sync` routine to only sync one block per call, and return useful information. - Use BlockData and BatchData from common - Check that events belong to the expected block hash - In L1Batch, query L1UserTxs from HistoryDB - Fill ERC20 token information - Test AddTokens with test.Client - HistryDB - Use BlockData and BatchData from common - Add `GetAllTokens` method - Uncomment and update GetL1UserTxs (with corresponding tests) - Til - Rename all instances of RegisterToken to AddToken (to follow the smart contract implementation naming) - Use BlockData and BatchData from common - Move testL1CoordinatorTxs and testL2Txs to a separate struct from BatchData in Context - Start Context with BatchNum = 1 (which the protocol defines to be the first batchNum) - In every Batch, set StateRoot and ExitRoot to a non-nil big.Int (zero). - In all L1Txs, if LoadAmount is not used, set it to 0; if Amount is not used, set it to 0; so that no *big.Int is nil. - In L1UserTx, don't set BatchNum, because when L1UserTxs are created and obtained by the synchronizer, the BatchNum is not known yet (it's a synchronizer job to set it) - In L1UserTxs, set `UserOrigin` and set `ToForgeL1TxsNum`.
Eduard S committed on Oct 9, 2020
827e917
a
Add fees subtraction on TxProcessors
arnaucube committed on Oct 23, 2020
1e71d7f
a
Update fees usage in Til
arnaucube committed on Oct 23, 2020
e76cc98
A
Impl account creation auth endpoints
Arnau B committed on Oct 21, 2020
ede6c33
A
Impl api get batch(es)
Arnau B committed on Oct 26, 2020
28c0164
A
Add apitypes to avoid parsing from/to DB
Arnau B committed on Oct 22, 2020
7c8f380
l
Ethclient: add readme & test env variables
laisolizq committed on Oct 23, 2020
2e67008
l
Ethclient remove ERC777
laisolizq committed on Oct 21, 2020
d4753c7
l
Add struct get state endpoint
laisolizq committed on Oct 23, 2020
82ee7c6
l
API Update tokens endpoint
laisolizq committed on Oct 26, 2020
bc34f34
a
Group ProcessTxs output
arnaucube committed on Oct 27, 2020
e090927
a
ProcessTxs return an array of created accounts
arnaucube committed on Oct 27, 2020
0ff3fb5
a
StateDB store Idxs with TokenID at the db-key
arnaucube committed on Oct 27, 2020
aaa71a6
E
Test L2Txs, ExitTree in synchronizer
Eduard S committed on Oct 27, 2020
558de27
T
API Coordinator Refactor
ToniRamirezM committed on Oct 27, 2020
b521a77
A
Refactor api txs
Arnau B committed on Oct 26, 2020
a329d89
l
API add bids endpoint
laisolizq committed on Oct 27, 2020
aa6cb6f
A
Imp api get full-batches
Arnau B committed on Oct 30, 2020
e0e3299
A
Insert ETH as HistoryDB token
Arnau B committed on Oct 29, 2020
cbeca0f
A
Refactor api exits
Arnau B committed on Oct 30, 2020
233ecc4
A
Refactor account creation auth endpoints
Arnau B committed on Oct 29, 2020
8c9d13f
E
Update fee tables
Eduard S committed on Nov 2, 2020
fe23361
l
API config refactor
laisolizq committed on Nov 3, 2020
2cf41d3
T
Check feeAmount overflow in API
ToniRamirezM committed on Nov 5, 2020
f90f14d
l
API add slots endpoints
laisolizq committed on Oct 29, 2020
5012b82
T
Account API
ToniRamirezM committed on Oct 29, 2020
b840ceb
l
ItemID to uint64 & check timestamp
laisolizq committed on Nov 4, 2020
22f0a45
A
Put api DBs into struct
Arnau B committed on Nov 6, 2020
1112ded
a
Update tx bytes parsers methods
arnaucube committed on Nov 6, 2020
fac8577
l
API add get state
laisolizq committed on Nov 6, 2020
cc6446e
A
Refactor api pagination
Arnau B committed on Nov 9, 2020
d2e9196
T
API State Metrics
ToniRamirezM committed on Nov 9, 2020
55a78fb
l
API State RecommendedFee
laisolizq committed on Nov 9, 2020
9edf9d2
l
API state endpoint test
laisolizq committed on Nov 10, 2020
43e9bee
a
Update Account Hash comp to match js version
arnaucube committed on Nov 9, 2020
def6f46
T
Swagger Review Swagger Review
ToniRamirezM committed on Nov 10, 2020
6919b56
E
Test synchronizer reorg
Eduard S committed on Nov 11, 2020
457ff94
E
Add Sync stats, and report them in DebugAPI
Eduard S committed on Nov 11, 2020
6c0d48f
l
Add til test l2db
laisolizq committed on Nov 11, 2020
1925110
T
HistoryDB TXs til test
ToniRamirezM committed on Nov 13, 2020
93d67ff
A
Integrate til into api
Arnau B committed on Nov 16, 2020
ce1218e
l
Add til api test first commit
laisolizq committed on Nov 12, 2020
b3b2347
l
Update ethclient & L1CoordinatorTx
laisolizq committed on Nov 20, 2020
f775af8
A
Improve swagger doc
Arnau B committed on Nov 18, 2020
86029ca
E
Check all errors in eth tests
Eduard S committed on Nov 23, 2020
ebecc5c
E
Redo coordinator structure, connect API to node - API: - Modify the constructor so that hardcoded rollup constants don't need to be passed (introduce a `Config` and use `configAPI` internally) - Common: - Update rollup constants with proper *big.Int when required - Add BidCoordinator and Slot structs used by the HistoryDB and Synchronizer. - Add helper methods to AuctionConstants - AuctionVariables: Add column `DefaultSlotSetBidSlotNum` (in the SQL table: `default_slot_set_bid_slot_num`), which indicates at which slotNum does the `DefaultSlotSetBid` specified starts applying. - Config: - Move coordinator exclusive configuration from the node config to the coordinator config - Coordinator: - Reorganize the code towards having the goroutines started and stopped from the coordinator itself instead of the node. - Remove all stop and stopped channels, and use context.Context and sync.WaitGroup instead. - Remove BatchInfo setters and assing variables directly - In ServerProof and ServerProofPool use context instead stop channel. - Use message passing to notify the coordinator about sync updates and reorgs - Introduce the Pipeline, which can be started and stopped by the Coordinator - Introduce the TxManager, which manages ethereum transactions (the TxManager is also in charge of making the forge call to the rollup smart contract). The TxManager keeps ethereum transactions and: 1. Waits for the transaction to be accepted 2. Waits for the transaction to be confirmed for N blocks - In forge logic, first prepare a batch and then wait for an available server proof to have all work ready once the proof server is ready. - Remove the `isForgeSequence` method which was querying the smart contract, and instead use notifications sent by the Synchronizer to figure out if it's forging time. - Update test (which is a minimal test to manually see if the coordinator starts) - HistoryDB: - Add method to get the number of batches in a slot (used to detect when a slot has passed the bid winner forging deadline) - Add method to get the best bid and associated coordinator of a slot (used to detect the forgerAddress that can forge the slot) - General: - Rename some instances of `currentBlock` to `lastBlock` to be more clear. - Node: - Connect the API to the node and call the methods to update cached state when the sync advances blocks. - Call methods to update Coordinator state when the sync advances blocks and finds reorgs. - Synchronizer: - Add Auction field in the Stats, which contain the current slot with info about highest bidder and other related info required to know who can forge in the current block. - Better organization of cached state: - On Sync, update the internal cached state - On Init or Reorg, load the state from HistoryDB into the internal cached state.
Eduard S committed on Nov 13, 2020
3b99953
a
Til use bigint for amount & loadamount values
arnaucube committed on Nov 24, 2020
ea7e254
l
Update L1 coordinator Txs
laisolizq committed on Nov 24, 2020
7ceaf4c
E
Update coordinator, call all api update functions - Common: - Rename Block.EthBlockNum to Block.Num to avoid unneeded repetition - API: - Add UpdateNetworkInfoBlock to update just block information, to be used when the node is not yet synchronized - Node: - Call API.UpdateMetrics and UpdateRecommendedFee in a loop, with configurable time intervals - Synchronizer: - When mapping events by TxHash, use an array to support the possibility of multiple calls of the same function happening in the same transaction (for example, a smart contract in a single transaction could call withdraw with delay twice, which would generate 2 withdraw events, and 2 deposit events). - In Stats, keep entire LastBlock instead of just the blockNum - In Stats, add lastL1BatchBlock - Test Stats and SCVars - Coordinator: - Enable writing the BatchInfo in every step of the pipeline to disk (with JSON text files) for debugging purposes. - Move the Pipeline functionality from the Coordinator to its own struct (Pipeline) - Implement shouldL1lL2Batch - In TxManager, implement logic to perform several attempts when doing ethereum node RPC calls before considering the error. (Both for calls to forgeBatch and transaction receipt) - In TxManager, reorganize the flow and note the specific points in which actions are made when err != nil - HistoryDB: - Implement GetLastL1BatchBlockNum: returns the blockNum of the latest forged l1Batch, to help the coordinator decide when to forge an L1Batch. - EthereumClient and test.Client: - Update EthBlockByNumber to return the last block when the passed number is -1.
Eduard S committed on Nov 20, 2020
8f1cf2f
A
Improve swagger doc
Arnau B committed on Nov 26, 2020
5991752
E
Wrap all errors with tracerr
Eduard S committed on Nov 30, 2020
ced4263
E
Use tracerr call traces in log
Eduard S committed on Nov 27, 2020
879af66
a
Rm unused ETHCLIENT_DIAL_URL
arnaucube committed on Nov 30, 2020
2d27254
A
Allow using til with instructions
Arnau B committed on Dec 2, 2020
d9121bf
l
Updates API to new changes
laisolizq committed on Dec 4, 2020
75c6d8f
l
Update ethclient
laisolizq committed on Nov 30, 2020
1803134
A
Update API mock server URL for swagger UI
Arnau B committed on Dec 3, 2020
3e3eb3f
E
Use a non-zero from address in eth calls
Eduard S committed on Dec 3, 2020
1370bcc
A
Rename load amount to deposit amount
Arnau B committed on Dec 4, 2020
445f26e
A
Fix time sensitive test
Arnau B committed on Dec 9, 2020
039c7b2
A
Fix hez addr format for exits
Arnau B committed on Dec 9, 2020
a50ddbe
A
Fix errors when fromItem is not provided
Arnau B committed on Dec 9, 2020
8750127
j
Update swagger.yml
jleebee committed on Dec 9, 2020
2d85a4d
E
Simplify prover client, use big.Int in Proof
Eduard S committed on Dec 10, 2020
f581871
E
Update node and coordinator, fix linters
Eduard S committed on Dec 9, 2020
d8050dd
l
Update prover & add test
laisolizq committed on Dec 7, 2020
4ad67a3
E
Update API with new buckets synchronization
Eduard S committed on Dec 10, 2020
d1ced80
A
Fix queries when no rows
Arnau B committed on Dec 15, 2020
c7b7a85
A
Add TxType before processing L2 tx
Arnau B committed on Dec 15, 2020
fcd6f56
E
Extend Coordinator tests
Eduard S committed on Dec 16, 2020
6a9b5ce
E
Add mock proof server
Eduard S committed on Dec 16, 2020
885f584
A
Fix format of the MTP for exit endpoint
Arnau B committed on Dec 16, 2020
8083e4f
E
Merge node (sync-only) and coord config
Eduard S committed on Dec 16, 2020
11722c6
a
Fix coordinator pipeline forgeBatch call
arnaucube committed on Dec 17, 2020
d871ebc
a
Effective amounts add missing checks
arnaucube committed on Dec 17, 2020
0bcf576
E
Upgrade contracts and parse init events
Eduard S committed on Dec 17, 2020
ac400ba
l
Fix historyDB GetBestBidCoordinator
laisolizq committed on Dec 18, 2020
bc29222
E
Run go-instrument-errors to wrap errors
Eduard S committed on Dec 18, 2020
b1a8384
A
Fix API nonces
Arnau B committed on Dec 19, 2020
a7394cd
a
TxSelector update txs processing logic
arnaucube committed on Dec 22, 2020
982a423
A
Add forged txs in batch endpoints response
Arnau B committed on Dec 23, 2020
6e7f860
a
Fix StateDB & Til Nonce increment
arnaucube committed on Dec 23, 2020
eea44b3
E
Get ChainID from ethereum node
Eduard S committed on Dec 23, 2020
086dc85
a
Parametrize ChainID
arnaucube committed on Dec 23, 2020
150597c
E
Add missing tracerr.Wrap
Eduard S committed on Dec 24, 2020
a0c8ace
E
Don't log errors when context done
Eduard S committed on Dec 23, 2020
35d598f
A
Fix next forgers api response
Arnau B committed on Dec 28, 2020
6058d3c
A
Fix next forgers when no bids
Arnau B committed on Dec 29, 2020
d3c703c
A
Include addrs in exit responses
Arnau B committed on Dec 29, 2020
6cd292b
a
Update ExitProofs-Siblings padding
arnaucube committed on Dec 29, 2020
ca5870e
A
empty array instead of 404
Arnau B committed on Dec 30, 2020
a32f75d
T
Added new metrics tests
ToniRamirezM committed on Dec 30, 2020
3e70551
T
Sanitize varchars that may not be UTF-8
ToniRamirezM committed on Jan 4, 2021
e2d243a
A
Add max txs limit to tx pool
Arnau B committed on Jan 4, 2021
622e01e
A
Swagger improvements
Arnau B committed on Jan 7, 2021
b4d8e68
T
Update buckets withdrawals on API
ToniRamirezM committed on Jan 11, 2021
0bb69c3
T
Remove bigints from API
ToniRamirezM committed on Jan 12, 2021
ce6a271
T
Remove big.Int from state API
ToniRamirezM committed on Jan 12, 2021
170da50
A
Add idx for txs that creat account, step1
Arnau B committed on Jan 13, 2021
50fc607
a
Add ZKInputs test to use ProofServer
arnaucube committed on Jan 13, 2021
c61a5aa
E
In pool l2tx, store effective in aux column
Eduard S committed on Jan 18, 2021
828b817
A
Stop using hardcoded bootcoordinator in api
Arnau B committed on Jan 14, 2021
5ff4222
a
Fix CoordIdxs fees duplicated Fix #483
arnaucube committed on Jan 19, 2021
b2f1a75
E
Update coordinator to work better under real net - cli / node - Update handler of SIGINT so that after 3 SIGINTs, the process terminates unconditionally - coordinator - Store stats without pointer - In all functions that send a variable via channel, check for context done to avoid deadlock (due to no process reading from the channel, which has no queue) when the node is stopped. - Abstract `canForge` so that it can be used outside of the `Coordinator` - In `canForge` check the blockNumber in current and next slot. - Update tests due to smart contract changes in slot handling, and minimum bid defaults - TxManager - Add consts, vars and stats to allow evaluating `canForge` - Add `canForge` method (not used yet) - Store batch and nonces status (last success and last pending) - Track nonces internally instead of relying on the ethereum node (this is required to work with ganache when there are pending txs) - Handle the (common) case of the receipt not being found after the tx is sent. - Don't start the main loop until we get an initial messae fo the stats and vars (so that in the loop the stats and vars are set to synchronizer values) - eth / ethereum client - Add necessary methods to create the auth object for transactions manually so that we can set the nonce, gas price, gas limit, etc manually - Update `RollupForgeBatch` to take an auth object as input (so that the coordinator can set parameters manually) - synchronizer - In stats, add `NextSlot`
Eduard S committed on Jan 15, 2021
7048260
E
Fix incorrect initial CurrentIdx in kvdb
Eduard S committed on Jan 28, 2021
d7c56af
E
Update README
Eduard S committed on Feb 1, 2021
4961033
E
Update go-merkletree dependency
Eduard S committed on Feb 1, 2021
845fea4
i
swap proof b vector
invocamanman committed on Feb 3, 2021
20efa9c
E
Fix eth events query and sync inconsistent state - kvdb - Fix path in Last when doing `setNew` - Only close if db != nil, and after closing, always set db to nil - This will avoid a panic in the case where the db is closed but there's an error soon after, and a future call tries to close again. This is because pebble.Close() will panic if the db is already closed. - Avoid calling pebble methods when a the Storage interface already implements that method (like Close). - statedb - In test, avoid calling KVDB method if the same method is available for the StateDB (like MakeCheckpoint, CurrentBatch). - eth - In *EventByBlock methods, take blockHash as input argument and use it when querying the event logs. Previously the blockHash was only taken from the logs results *only if* there was any log. This caused the following issue: if there was no logs, it was not possible to know if the result was from the expected block or an uncle block! By querying logs by blockHash we make sure that even if there are no logs, they are from the right block. - Note that now the function can either be called with a blockNum or blockHash, but not both at the same time. - sync - If there's an error during call to Sync call resetState, which internally resets the stateDB to avoid stale checkpoints (and a corresponding invalid increase in the StateDB batchNum). - During a Sync, after very batch processed, make sure that the StateDB currentBatch corresponds to the batchNum in the smart contract log/event.
Eduard S committed on Feb 5, 2021
6260dfe
E
Fix l2db reorg of forging l2txs
Eduard S committed on Feb 9, 2021
2bf3b84
A
Add semaphore for API queries to SQL
Arnau B committed on Feb 8, 2021
ac1fd9a
E
Fix txselector TransferToBJJ behaviour
Eduard S committed on Feb 11, 2021
c7e6267
E
Document how to build node
Eduard S committed on Feb 15, 2021
05104b0
E
Update coordinator to work better under real net - cli / node - Update handler of SIGINT so that after 3 SIGINTs, the process terminates unconditionally - coordinator - Store stats without pointer - In all functions that send a variable via channel, check for context done to avoid deadlock (due to no process reading from the channel, which has no queue) when the node is stopped. - Abstract `canForge` so that it can be used outside of the `Coordinator` - In `canForge` check the blockNumber in current and next slot. - Update tests due to smart contract changes in slot handling, and minimum bid defaults - TxManager - Add consts, vars and stats to allow evaluating `canForge` - Add `canForge` method (not used yet) - Store batch and nonces status (last success and last pending) - Track nonces internally instead of relying on the ethereum node (this is required to work with ganache when there are pending txs) - Handle the (common) case of the receipt not being found after the tx is sent. - Don't start the main loop until we get an initial messae fo the stats and vars (so that in the loop the stats and vars are set to synchronizer values) - When a tx fails, check and discard all the failed transactions before sending the message to stop the pipeline. This will avoid sending consecutive messages of stop the pipeline when multiple txs are detected to be failed consecutively. Also, future txs of the same pipeline after a discarded txs are discarded, and their nonces reused. - Robust handling of nonces: - If geth returns nonce is too low, increase it - If geth returns nonce too hight, decrease it - If geth returns underpriced, increase gas price - If geth returns replace underpriced, increase gas price - Add support for resending transactions after a timeout - Store `BatchInfos` in a queue - Pipeline - When an error is found, stop forging batches and send a message to the coordinator to stop the pipeline with information of the failed batch number so that in a restart, non-failed batches are not repated. - When doing a reset of the stateDB, if possible reset from the local checkpoint instead of resetting from the synchronizer. This allows resetting from a batch that is valid but not yet sent / synced. - Every time a pipeline is started, assign it a number from a counter. This allows the TxManager to ignore batches from stopped pipelines, via a message sent by the coordinator. - Avoid forging when we haven't reached the rollup genesis block number. - Add config parameter `StartSlotBlocksDelay`: StartSlotBlocksDelay is the number of blocks of delay to wait before starting the pipeline when we reach a slot in which we can forge. - When detecting a reorg, only reset the pipeline if the batch from which the pipeline started changed and wasn't sent by us. - Add config parameter `ScheduleBatchBlocksAheadCheck`: ScheduleBatchBlocksAheadCheck is the number of blocks ahead in which the forger address is checked to be allowed to forge (apart from checking the next block), used to decide when to stop scheduling new batches (by stopping the pipeline). For example, if we are at block 10 and ScheduleBatchBlocksAheadCheck is 5, eventhough at block 11 we canForge, the pipeline will be stopped if we can't forge at block 15. This value should be the expected number of blocks it takes between scheduling a batch and having it mined. - Add config parameter `SendBatchBlocksMarginCheck`: SendBatchBlocksMarginCheck is the number of margin blocks ahead in which the coordinator is also checked to be allowed to forge, apart from the next block; used to decide when to stop sending batches to the smart contract. For example, if we are at block 10 and SendBatchBlocksMarginCheck is 5, eventhough at block 11 we canForge, the batch will be discarded if we can't forge at block 15. - Add config parameter `TxResendTimeout`: TxResendTimeout is the timeout after which a non-mined ethereum transaction will be resent (reusing the nonce) with a newly calculated gas price - Add config parameter `MaxGasPrice`: MaxGasPrice is the maximum gas price allowed for ethereum transactions - Add config parameter `NoReuseNonce`: NoReuseNonce disables reusing nonces of pending transactions for new replacement transactions. This is useful for testing with Ganache. - Extend BatchInfo with more useful information for debugging - eth / ethereum client - Add necessary methods to create the auth object for transactions manually so that we can set the nonce, gas price, gas limit, etc manually - Update `RollupForgeBatch` to take an auth object as input (so that the coordinator can set parameters manually) - synchronizer - In stats, add `NextSlot` - In stats, store full last batch instead of just last batch number - Instead of calculating a nextSlot from scratch every time, update the current struct (only updating the forger info if we are Synced) - Afer every processed batch, check that the calculated StateDB MTRoot matches the StateRoot found in the forgeBatch event.
Eduard S committed on Feb 16, 2021
f0e79f3
E
Fix timers resetting in coordinator loops
Eduard S committed on Feb 16, 2021
264f01b
E
Fix sorting of l2txs nonces in TxSelector
Eduard S committed on Feb 17, 2021
af6f114
a
Duplicated error when caused by meddler
arnaubennassar committed on Feb 18, 2021
28f026f
E
Simplify historyDB test and make it faster
Eduard S committed on Feb 19, 2021
d6ec191
E
Remove unecessary slice indexing
Eduard S committed on Feb 19, 2021
c829eb9
a
Stop using stateDB in API
arnaubennassar committed on Feb 22, 2021
c83047f
D
remove redundant error check condition for tx manager
Danilo Pantani committed on Feb 22, 2021
35ea597
D
fix possible runtime error
Danilo Pantani committed on Feb 22, 2021
7286214
a
Add Prometheus initial setup
arnaucube committed on Feb 15, 2021
971b2c1
a
Diferentiate SQL connections by read write
arnaubennassar committed on Feb 23, 2021
ed9bfdf
E
Wait for serverProof before starting batch
Eduard S committed on Feb 24, 2021
df729b3
a
Fix ZKI Exit Balance2 accumulated Amounts
arnaucube committed on Feb 24, 2021
400ab14
a
Add API metric for time to forge L1 tx
arnaubennassar committed on Feb 25, 2021
4acfeb0
E
Reorg l2db before starting pipeline
Eduard S committed on Feb 25, 2021
3c68aa5
a
Add forge delay to api get state
arnaubennassar committed on Feb 26, 2021
54508b0
a
Update L1CoordinatorTxFromBytes to EIP712
arnaucube committed on Feb 28, 2021
56ffea2