arnaucube
arnaucube/hermez-nodePublic Self-hosted repository

Commit history

a50ddbe4e0d5103b3c57fa830e309caeb8d78d1c
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
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