Commit Graph

731 Commits

Author SHA1 Message Date
krlosMata
4d02308057 update zkInputs (#104)
* update zkInputs

* ZKInputs clean uncomment use nolint

Co-authored-by: arnaucube <root@arnaucube.com>
2020-09-04 09:49:23 +02:00
Eduard S
c940e6f4f1 Merge pull request #101 from hermeznetwork/feature/log0
Update log package with fields & file log
2020-09-02 11:05:09 +02:00
arnaucube
fdaf2c9ce2 Update log package with fields & file log
Update log package with fields & file log, and update constants in the
repository code to be MixedCase.

resolves #91, resolves #92, resolves #95
2020-09-02 10:56:48 +02:00
Eduard S
18d0658147 Merge pull request #87 from hermeznetwork/feature/test-ethclient
Add mock EthClient for testing
2020-09-01 15:48:00 +02:00
arnaucube
c523b4af70 Add mock EthClient for testing 2020-09-01 11:19:07 +02:00
Eduard S
ddb5604629 Merge pull request #89 from hermeznetwork/feature/golint
Add lint checks: gofmt, goimports, golint
2020-08-31 13:26:33 +02:00
arnaucube
cbbcb65c8c Add lint checks: gofmt, goimports, golint
- gofmt - Gofmt checks whether code was gofmt-ed. By default this tool runs
  with -s option to check for code simplification
- goimports - Goimports does everything that gofmt does. Additionally it checks
  unused imports
- golint - Golint differs from gofmt. Gofmt reformats Go source code, whereas
  golint prints out style mistakes
    - checks the uncommented exported functions & types

Update the code to fix the lint checks.
2020-08-31 12:32:05 +02:00
a_bennassar
3bd91ec736 Merge pull request #84 from hermeznetwork/feature/update-linters
Add linter checks to GHA & Fix code to pass lints
2020-08-28 10:10:30 +02:00
arnaucube
fd1e9c25ee Add linter checks to GHA & Fix code to pass lints
Add linter checks to GHA & Fix code to pass lints.
The linters added are:
- whitespace: Tool for detection of leading and trailing whitespace
- gosec: Inspects source code for security problems
- gci: Gci control golang package import order and make it always deterministic
- misspell: Finds commonly misspelled English words in comments
- gomnd: An analyzer to detect magic numbers

The file utils/utils.go is excluded from the checks of gomnd, as uses magic numbers through the code
2020-08-28 09:58:39 +02:00
a_bennassar
fe8431edfa Merge pull request #80 from hermeznetwork/feature/coordinator0
Feature/coordinator0
2020-08-27 13:08:26 +02:00
arnaucube
26dbb16618 Add Coordinator goroutines & channels processes
Add Coordinator goroutines & channels processes
- Add Coordinator goroutines & channels
- Add Coordinator test to debug batches
- Add MakeCheckpoint call after BatchBuilder BuildBatch process
- Update ethClient BlockByNumber to return hermez/common.Block instead of go-ethereum/core/types.Block
2020-08-27 10:56:08 +02:00
arnaucube
9309722dfc Update StateDB to new & ExitInfo struct & BatchNum
Update StateDB to new & ExitInfo struct & BatchNum
Also a small fix at txselector & log packages
2020-08-26 18:28:53 +02:00
Eduardo Antuña Díez
361af765ab Merge pull request #67 from hermeznetwork/feature/sql-sc-vars
Add sync interface
2020-08-26 15:36:52 +02:00
Arnau B
3e7173b1da Impl historyDB methods for sync main loop 2020-08-26 14:31:24 +02:00
a_bennassar
9c10826d49 Merge pull request #77 from hermeznetwork/feature/txs-tests
Feature/txs tests
2020-08-26 11:32:12 +02:00
arnaucube
be95de18fc Add StateDB txprocessor tests using txtest generators
Add StateDB tx processor tests using tx test generators:
- update statedb/ tx processors
- add statedb tx processors tests
2020-08-25 19:28:33 +02:00
arnaucube
e98b511436 Update tx testing generation:
Update tx testing generation:
- add new batch lexic to tx-test language
- add coordinatorL1Txs generation to tx-test
- add SetTest0 code to generate test L1&L2 transactions
2020-08-25 19:08:07 +02:00
Arnau B
c108739c24 Add usefull methods for reorg 2020-08-25 14:15:12 +02:00
Arnau B
1cbf54acc7 Add sync interface 2020-08-25 14:14:51 +02:00
a_bennassar
87a74c471a Merge pull request #75 from hermeznetwork/feature/exit-tree
Add statedb ExitTree implementation
2020-08-25 12:32:27 +02:00
arnaucube
0d2004721c Add statedb ExitTree implementation 2020-08-25 12:09:49 +02:00
a_bennassar
88906beabe Merge pull request #74 from hermeznetwork/feature/statedb-processtxs
Add abstraction method of processTxs to StateDB
2020-08-24 15:39:36 +02:00
arnaucube
b4044a2ef7 Add abstraction method of processTxs to StateDB
- Update GHA lint.yml increasing timeout time to avoid GHA Lint errors
- Update common.BatchNum & common.Idx & common.Nonce usage in StateDB
- Add abstraction method of processTxs to StateDB
    - Which will be used by Synchronizer & BatchBuilder
2020-08-24 13:06:51 +02:00
a_bennassar
118ebf70b7 Merge pull request #73 from hermeznetwork/feature/ethclient0
Import & adapt iden/go-iden3-core/eth/client
2020-08-24 11:29:31 +02:00
arnaucube
b33d18ff55 Import & adapt iden/go-iden3-core/eth/client 2020-08-24 11:19:39 +02:00
a_bennassar
c2bbca4af3 Merge pull request #72 from hermeznetwork/feature/pooll2tx-sig
Add PoolL2Tx verify signature needed methods
2020-08-24 11:13:38 +02:00
arnaucube
7fa658cc84 Add PoolL2Tx verify signature needed methods
Implements the hash to be signed from PoolL2Tx, compatible with javascript version.
Implements the signature verification for a given PoolL2Tx.
2020-08-24 09:46:25 +02:00
a_bennassar
869ab519a4 Merge pull request #69 from hermeznetwork/feature/txcompresseddata
Add TxCompressedData & V2 with some extra parsers for common
2020-08-21 16:36:05 +02:00
arnaucube
a28c81f4ae Add TxCompressedData & V2 with some extra parsers for common 2020-08-21 15:35:31 +02:00
a_bennassar
3f63cd7cd0 Merge pull request #66 from hermeznetwork/feature/statedb-cu
Unify StateDB MT{Create/Update}Account
2020-08-20 16:25:37 +02:00
arnaucube
12aa31e46b Unify StateDB MT{Create/Update}Account
Previously as the txprocessor.go methods were specific for the BatchBuilder,
the MTCreateAccount & CreateAccount and MTUpdateAccount & UpdateAccount were
also designed to be used by BatchBuilder and TxSelector depending on the
MerkleTree usage calling one kind of method or anotherone.

But now that this methods are being called directly by the StateDB (through the
methods in txprocessors.go), to allow also the methods usage from the
Synchronizer, there can not be the MT and no-MT methods separated, so this
commit unifies MTCreateAccount with CreateAccount, and MTUpdateAccount with
UpdateAccount, which internally will update the MerkleTree depending if the
specific StateDB in usage has the MerkleTree defined or not.
2020-08-20 15:53:16 +02:00
a_bennassar
82d5aae745 Merge pull request #64 from hermeznetwork/feature/testing-framework
Feature/testing framework language
2020-08-20 13:55:10 +02:00
arnaucube
cfa441e1ac Migrate TxProcessors from BatchBuilder to StateDB
Migrate TxProcessors from BatchBuilder to StateDB in order to be used by
BatchBuilder & Synchronizer
2020-08-20 12:06:28 +02:00
arnaucube
8eb42c011c Add tx L1&L2 test generation & keys for TestingFramework
Add test-lang Fee & ForceExit option
2020-08-20 11:57:44 +02:00
arnaucube
e2d4599690 Add tx generation lang interpreter 2020-08-19 15:58:20 +02:00
a_bennassar
6c0c528b17 Merge pull request #61 from hermeznetwork/feature/log
Add log system
2020-08-18 11:35:23 +02:00
arnaucube
fab3b865bb Add log system 2020-08-18 11:25:23 +02:00
arnau
5d4840ce5c Merge pull request #59 from hermeznetwork/feature/sql-tables4
Update SQL schemas
2020-08-17 16:55:54 +02:00
arnaucube
c702442287 Update Coordinator & BatchBuilder & TxSelector to new SQL schemas changes 2020-08-17 16:16:25 +02:00
a_bennassar
cb1b820256 Update SQL schemas 2020-08-17 16:16:17 +02:00
a_bennassar
bf1a648091 Merge pull request #57 from hermeznetwork/feature/statedb-checkpoints
Feature/statedb checkpoints
2020-08-17 15:55:59 +02:00
arnaucube
aa003063f6 Update BatchBuilder & TxSelector to new StateDB 2020-08-17 13:38:48 +02:00
arnaucube
205db8e4d3 Implement StateDB Checkpoints & Resets system 2020-08-17 11:27:33 +02:00
Toni Ramírez
db927ddd24 Add utils Float16-BigInt converters
* 16 bits fix encoding

* Types modification

* Rounding loss check

* Clean up a bit and add benchmarks

Unneded usage of big.Int has been removed

Conversion methods are now methods/constructors of Float16 to make the code
more idiomatic.

Co-authored-by: Toni Ramírez <toni@iden3.com>
Co-authored-by: arnaucube <root@arnaucube.com>
Co-authored-by: Eduard S <eduard@iden3.io>
2020-08-14 17:27:34 +02:00
Eduard S
58cf35f6ea Merge pull request #52 from hermeznetwork/feature/init-coordinator
Initial Coordinator (OpManager) structure
2020-08-14 17:25:21 +02:00
arnaucube
8390e4a784 Add initial structure Coordinator Forge Sequence 2020-08-14 14:06:28 +02:00
arnau
378b7be47d Merge pull request #53 from hermeznetwork/feature/updategha
Remove goarch 386 and go-version 1.13 from GHA
2020-08-14 11:07:25 +02:00
Eduard S
2e5ac8cfb6 Remove goarch 386 and go-version 1.13 from GHA 2020-08-14 09:59:25 +02:00
arnaucube
a1c339c918 Add BatchQueue implementation & minor updates 2020-08-13 18:25:50 +02:00
a_bennassar
9df30affc6 Merge pull request #50 from hermeznetwork/feature/txselector-int-statedb
Integrate TxSelector with StateDB
2020-08-13 13:15:18 +02:00