Commit Graph

18 Commits

Author SHA1 Message Date
Arnau B
bc5fa92898 Add bootCoord to coord table, get coord by forgerAddr 2020-12-23 11:03:21 +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
Arnau B
226c49f28f Fix inconsistency between api doc and code: hermezEthereumAddress => hezEthereumAddress 2020-12-16 12:29:46 +01:00
Arnau B
a50ddbe4e0 Fix hez addr format for exits 2020-12-09 14:04:15 +01:00
Eduard S
ced42634da Wrap all errors with tracerr 2020-11-30 12:58:36 +01:00
Eduard S
3b99953007 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.
2020-11-24 18:59:30 +01:00
laisolizq
43e9bee9db API state endpoint test 2020-11-10 13:47:18 +01:00
ToniRamirezM
b840ceb57a Account API 2020-11-06 09:30:32 +01:00
laisolizq
5012b82914 API add slots endpoints 2020-11-05 15:59:27 +01:00
laisolizq
aa6cb6f818 API add bids endpoint 2020-10-28 18:11:52 +01:00
Arnau B
28c0164525 Impl api get batch(es) 2020-10-26 12:42:05 +01:00
Arnau B
ede6c33a18 Impl account creation auth endpoints 2020-10-23 13:05:20 +02:00
ToniRamirezM
f314498a26 Coordinators methods for API 2020-10-22 13:29:38 +02:00
Arnau B
006bbf3321 Implement tx pool endpoints 2020-10-21 16:34:54 +02:00
laisolizq
043710112d Add get tokens endpoint 2020-10-19 10:14:18 +02:00
Arnau B
fe7d38843e Impls exit endpoints and change pagination to cursor 2020-10-14 10:06:28 +02:00
a_bennassar
49366e3fa4 Feature/null refactor (#173)
* WIP: rebase

* Make nullable fields use pointers
2020-10-06 10:34:49 +02:00
Arnau B
85fe885265 Add GET histroy-transactions endpoint 2020-09-22 13:21:28 +02:00