* Synchronizer
* mend
Synchronizer main loop & reorg
* mend
Synchronizer main loop & reorg
* mend
Synchronizer main loop & reorg
* Update PR and apply small changes
Update PR and apply small changes:
- Remove arbitrary line jumps (for example after an `err:=` there are cases with extra line before error check, and there are cases without the extra jumpline. Another example is the empty lines between a comment and the line of comment that is explained)
- Fix some typo
- Fix value printing of `lastSavedBlock` instead of `latestBlockNum`
- Uncomment parameters of structs and use linter syntax to avoid unused checks
* Update Synchr after master-pull to last types to compile
Co-authored-by: Toni Ramírez <toni@iden3.com>
Co-authored-by: arnaucube <root@arnaucube.com>
- 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.
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
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
- 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
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.
* 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>