Commit Graph

244 Commits

Author SHA1 Message Date
a_bennassar
b320069e75 Merge pull request #229 from hermeznetwork/feature/api-getstate
Add struct get state endpoint
2020-10-27 12:30:40 +01:00
laisolizq
82ee7c6aa7 Add struct get state endpoint 2020-10-27 12:27:04 +01:00
Eduard S
23160ce4eb Merge pull request #228 from hermeznetwork/feature/fees-to-coord
Add ProcessTxs send fees to Coordinator accounts
2020-10-27 10:32:26 +01:00
arnaucube
8f24aa93c9 Add ProcessTxs send fees to Coordinator accounts 2020-10-27 10:28:32 +01:00
a_bennassar
382bcfeee1 Merge pull request #227 from hermeznetwork/feature/integration6
Update Synchroinzer and tests
2020-10-26 16:28:48 +01:00
Eduard S
b5222303c2 Update Synchroinzer and tests
- Test L1UserTxs in Synchronizer
- Test Batches in Synchronizer
- Add last_idx in `TABLE batch` in HistoryDB
- Minor updates in til to satisfy blockchain constraints
2020-10-26 16:22:40 +01:00
Eduard S
2aa5598975 Merge pull request #223 from hermeznetwork/feature/eth-remove-ERC777
Feature/eth remove erc777
2020-10-26 16:20:41 +01:00
Eduard S
79b105b497 Update importers of eth, review eth/README.md 2020-10-26 16:09:40 +01:00
Eduard S
d17cc57e1d Merge pull request #226 from hermeznetwork/feature/api-batches
Feature/api batches
2020-10-26 15:47:30 +01:00
Arnau B
28c0164525 Impl api get batch(es) 2020-10-26 12:42:05 +01:00
Arnau B
7c8f380637 Add apitypes to avoid parsing from/to DB 2020-10-26 12:41:55 +01:00
Eduard S
0e5aad4767 Merge pull request #219 from hermeznetwork/feature/api-account-creation
Impl account creation auth endpoints
2020-10-26 11:22:32 +01:00
laisolizq
2e67008142 Ethclient: add readme & test env variables 2020-10-26 11:20:22 +01:00
laisolizq
d4753c7e1b Ethclient remove ERC777 2020-10-26 11:20:22 +01:00
Eduard S
b70001f92f Merge pull request #225 from hermeznetwork/feature/fees-update
Feature/fees update
2020-10-26 11:06:26 +01:00
arnaucube
1e71d7f19e Add fees subtraction on TxProcessors 2020-10-23 18:13:12 +02:00
arnaucube
e76cc98e4c Update fees usage in Til 2020-10-23 18:09:14 +02:00
Arnau B
ede6c33a18 Impl account creation auth endpoints 2020-10-23 13:05:20 +02:00
Eduard S
721e5e8bf0 Merge pull request #220 from hermeznetwork/test/fake-server
Add the ability to run the API forever when testing
2020-10-23 12:22:33 +02:00
Arnau B
9971f13646 Add the ability to run the API forever when testing 2020-10-23 11:51:53 +02:00
Eduard S
0cd7179f47 Merge pull request #222 from hermeznetwork/feature/txtransfertoethaddrbjj
Add TxTypeTransferToEthAddr&ToBJJ to StateDB & Til
2020-10-23 11:46:41 +02:00
arnaucube
0ac6c0ecbb Add TxTypeTransferToEthAddr&ToBJJ to StateDB & Til
Add TxTypeTransferToEthAddr&ToBJJ to StateDB & Til
resolves #203, resolves #209
2020-10-23 11:42:39 +02:00
arnau
bf3bc0d32c Merge pull request #221 from hermeznetwork/feature/til-update
In til, process L1UserTxs when defined, not in batch
2020-10-22 16:20:09 +02:00
Eduard S
4dbfedee49 In til, process L1UserTxs when defined, not in batch 2020-10-22 16:13:57 +02:00
arnau
23242fb945 Merge pull request #217 from hermeznetwork/feature/integration5
Update missing parts, improve til, and more
2020-10-22 15:29:51 +02:00
Eduard S
827e917fa0 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`.
2020-10-22 15:20:51 +02:00
Eduard S
24bca9e3b0 Merge pull request #216 from hermeznetwork/feature/batch-total-fee
Calulate total collected batch fee and fix merkleproof api format
2020-10-22 14:28:49 +02:00
a_bennassar
9d74a8e9bd Merge pull request #213 from hermeznetwork/feature/api-coordinators
Coordinators methods for API
2020-10-22 13:53:37 +02:00
ToniRamirezM
f314498a26 Coordinators methods for API 2020-10-22 13:29:38 +02:00
Arnau B
f77ea04c2e Calulate total collected batch fee and fix merkleproof api format 2020-10-22 12:59:15 +02:00
arnau
8047582de9 Merge pull request #205 from hermeznetwork/feature/api-tx-pool
Implement tx pool endpoints
2020-10-22 12:27:00 +02:00
arnaucube
34de6412cf Update Til with small fixes [...]
Update Til with small fixes:
- L2Tx TxID & Type correctness done after Idxs setted
- Added PoolL2Tx signature for Exit type

Common:
- Add common.TxID Marshalers test
2020-10-22 12:22:08 +02:00
Arnau B
006bbf3321 Implement tx pool endpoints 2020-10-21 16:34:54 +02:00
Eduard S
efed84f1e8 Merge pull request #215 from hermeznetwork/feature/til-update
Feature/til update
2020-10-21 15:52:07 +02:00
arnaucube
265bdf23e3 Rename Transakcio to Til for a easier usage
Rename Transakcio to Til for a easier usage, also change til.TestContext
to til.Context, and til.NewTestContext to til.NewContext.
2020-10-21 15:17:22 +02:00
arnaucube
cfdea57977 Fix test generated transactions L1Tx type 2020-10-21 14:59:39 +02:00
Eduard S
4ca2124cf9 Merge pull request #210 from hermeznetwork/feature/api-config-const
Add config endpoint
2020-10-21 13:30:00 +02:00
arnau
6a8b454368 Merge pull request #211 from hermeznetwork/feature/update-general
Feature/update general
2020-10-21 13:06:09 +02:00
laisolizq
3f6b9d9087 Merge pull request #212 from hermeznetwork/feature/ethclient-simplify
Simplify eth code
2020-10-21 12:39:32 +02:00
Eduard S
54562c0367 Implement CalcFeeAmount, Resolve #140 2020-10-21 12:25:15 +02:00
Eduard S
a2bda1890d Simplify eth code 2020-10-21 11:56:55 +02:00
arnau
edb466c996 Merge pull request #208 from hermeznetwork/feature/debugapi
Extend statedb and use prefixes, add debugapi
2020-10-21 11:39:42 +02:00
laisolizq
f90de219ac Add config endpoint 2020-10-20 19:12:02 +02:00
Eduard S
4d90cd9a02 Merge pull request #207 from hermeznetwork/feature/tkcio-l1queues
Add L1UserTxs queues system to Transakcio
2020-10-20 17:48:48 +02:00
arnaucube
e89f89102c Add L1 Queues system for tx generation in Trnskcio 2020-10-20 17:43:57 +02:00
Eduard S
44c70dfbcb Replace cp -r in StateDB by checkpoints, Resolve #93 2020-10-20 14:52:46 +02:00
Eduard S
88ddbbcddc Delete tmp folders from tests, Resolve #105 2020-10-20 13:13:10 +02:00
Eduard S
96ceb014bf Implement an eficient memory storage, Resolve #120 2020-10-20 13:13:05 +02:00
Eduard S
6afbda5302 Extend statedb and use prefixes, add debugapi
In statedb:
- Store all values using prefixes for keys to allow iteration
- Add methods MTGetRoot, GetAccounts

Implement debugapi, an http server with debugging endpoints:
- debugAPI.GET("sdb/batchnum", a.handleCurrentBatch)
- debugAPI.GET("sdb/mtroot", a.handleMTRoot)
- debugAPI.GET("sdb/accounts", a.handleAccounts)
- debugAPI.GET("sdb/accounts/:Idx", a.handleAccount)
2020-10-19 13:53:39 +02:00
a_bennassar
eb54162fb8 Merge pull request #204 from hermeznetwork/feature/api-gettokens
Add get tokens endpoint
2020-10-19 11:20:41 +02:00