Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RON-313] docs(README): update overview and contributions #158

Merged
merged 53 commits into from
Nov 14, 2022

Conversation

linh-1
Copy link
Contributor

@linh-1 linh-1 commented Oct 19, 2022

linh-1 and others added 30 commits August 10, 2022 16:41
…um wrapper (#90)

* feat(consortiumV2): implement Engine interface

just implement empty interface, function not yet

* fix(consortiumV2): remove consortium v2

* fix(consortiumV2): clean up consortium v2

* feat(consortiumV2): implement Consortium wrapper for v1

* feat(consortiumV2): implement SetGetSCValidatorsFn and SetGetFenixValidators

* feat(consortiumV2): implement Authorize

* fix(consortiumV2): Authorize params

* fix(consortiumV2): rename consortium to main for helping review
* feat(consortiumV2): implement Consortium v2 interface

* feat(consortiumV2): implement logic for Consortium wrapper to call v2 or v1
…#94)

* feat(consortiumV2): implement function to interacting with smart contract directly

* fix: missing new parameters

* fix: missing new parameters

* fix: invalid check consortium config nil

* fix: use signer hash instead of hash method
* feat: implement Snapshot methods

* feat: implement isMajorityFork method

* chore: implement isMajorityFork method

* fix: update loadSnapshot location

* fix: update store location

* chore: comment unused method

* chore: remove RecentForkHashes property
* feat: implement Consortium v2 verify method

* refactor: comment unused check in verifyCascadingFields

* refactor: use misc.VerifyGaslimit instead
)

* feat: implement Finalize and FinalizeAndAssemble methods

* fix: remove init contract

* fix: remove unused import

* fix: missing import
* fix: call smart contract through backend instead of ethapi

* feat: Add BlockContext to simulated backend to prevent cycle import while using it in consensus package

* refactor: move contract to common

* fix: case sensitive

* fix: case sensitive

* fix: remove NewFaker

* fix: case sensitive

* refactor: call opts with BlockNumber

* fix: add missing header

* fix: assign systemTxs to ReceivedTxs

* feat (dnk90): Add balance to system address instead of coinbase, if block number is within consortiumV2 fork

* update (dnk90): use IsConsortiumV2 function instead

* refactor: impl Backend interface

* fix: spelling mistake

* refactor: eliminate magic number

* refactor: call update validators

* fix: checkpoint time

* fix: replace manual calculation by IsOnConsortiumV2

Co-authored-by: kien Dang <kien.15@gmail.com>
* fix: Add updateValidators to `Finalize` method to make sure `updateValidators` transaction is processed in received sides

* fix: wrong validation when calling updateValidations
- Add `addNode` function to support adding new nodes
- Change NewContractIntegrator param from `*ConsortiumBackend` to `bind.ContractBackend` interface to make it more flexible (we can adapt different backends lately)
* fix: worker starts before getValidatorsSC is set

* fix: call `SetGetSCValidatorsFn` instead of `SetGetFenixValidators` in `Consortium.SetGetSCValidatorsFn`

* fix: pointer issue when validating current block is end of v1 or not
* feat: implement Seal method

* feat: implement CalcDifficulty and Delay methods

* chore: add switch condition for Delay and Author
* chore: Add signFnTx to contract integrator, add deploy validators to generated validators

* fix: change FinanlizeAssemble that returns receipts to apply changing receipts length during processing system contracts

* fix: change gas limit

* fix: Add check recent to v1/verifySeal

* chore: Add contract_test which contains deploy and addNode codes

* fix: applying v2 contract from v1
* fix: Implement `PoSA` interface methods to main Consortium in order to get system contracts in v2

* chore: Remove unnecessary line
- Remove redundant logs
- Remove systemcontracts package
- Move generated_contracts to consortium package
* fix: reorgs and incorrect nonce in consortium-v2

* chore: Remove getValidatorsFromLastCheckpoint, use snapshot instead
* feat: integrate smart contract

* chore: remove dposStaking config

* chore: change generated contract from PascalCase to snake_case

* chore: remove validators contract

* chore: remove contract tests

* chore: add comment to avoid misleading
We accept that the system transactions will not be in the pending state so it is
unnecessary to call FinalizeAndAssemble in non-validator node. Move this call to
be called only on validator node
…#125)

* chore: fix missing signTxFn, clear outdate recents, check missing tx in state_processor

* chore: check tx.To instead of tx
minh-bq and others added 21 commits September 16, 2022 15:58
As default, an empty block without applying any transactions in transaction pool
is committed for sealing. Later, if there is no pending transactions in pool,
that empty block is inserted. Otherwise, another block is committed.

As we currently pass block header as a pointer to FinalizeAndAssemble, that block
header can be edited twice because it goes through FinalizeAndAssemble twice.
This leads to system transactions' gas used is accumulated twice, later results
in the mismatch between local and remote block's gas used calculation. We fix
this issue by make a copy of block header before passing it to
FinalizeAndAssemble.
* fix: load snapshot v1

* fix: store snapshot with the key consortium-

* chore(snapshot): remove check condition at block 0 and fork

* Choose the correct consortium version of ecrecover to be used on block header

* Log slashing on finalize only, add some comments on snapshot

Co-authored-by: Bui Quang Minh <minhbui@axieinfinity.com>
* fix: unknown ancestor

* chore: remove unused log

* fix: remove line on comment

* fix: remove unnecessary comment
* Remove unused variables and functions

* Remove deadcode when checking system transactions
* feat: Implement log precompiled contract

* chore: minify consortiumLog's abi

* chore: Add consortium precompiled contracts to list

* chore: only allow log in debug mode (--vmdebug or `DEBUG` env is set to "true")

* chore: Remove redundant function which get method from abi and input
* feat: Implement `sortValidators` precompiled contract

* fix: add caller to the contract, since caller is the actual caller instead of sender from transaction

* chore: add testcase which simulates a call from a user who trigger system contract to call `sort` precompiled contract

* fix: incorrect get validators function should be `getValidatorCandidates` instead
* docs(contract): add comments

* docs(contract): update comment for GetValidators
…le signing issue (#143)

* feat: Implement verifyHeaders precompiled contract which detects double signing issue

* chore: Remove unnecessary log init

* chore: simplify unit test, add chainId and change Number to big.Int

* chore: clean up code

* nit: comment to hacky (`unpack`) function

* chore: Add condition signer must equal to coinbase to prevent user uses fake signature
* docs(v2consortium): add code comments

* docs(v2consortium): update Close comment

* docs(v2consortium): fix typo error
…tant (#141)

* docs(consortium-main): add code comment, remove unused ValidatorBytesLength constant

* docs(consortium-main): fix typo
* fix: align precompiled requirements

* test: update TestConsortiumValidatorSorting_Run2

* test: update compiled code

* chore(precompiled): update consortiumValidatorSorting comments
# Conflicts:
#	consensus/consortium/common/contract.go
#	consensus/consortium/generated_contracts/ronin_validator_set/ronin_validator_set.go
#	consensus/consortium/generated_contracts/slash_indicator/slash_indicator.go
#	consensus/consortium/v2/consortium.go
#	core/vm/consortium_precompiled_contracts.go
#	core/vm/consortium_precompiled_contracts_test.go
#	docker/chainnode/entrypoint.sh
#	genesis/devnet.json
#	miner/worker.go
@linh-1 linh-1 merged commit 7670f70 into consortium-v2 Nov 14, 2022
linh-1 added a commit that referenced this pull request Nov 15, 2022
@linh-1 linh-1 deleted the RON-313-update-readme branch November 15, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants