Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | build: ci: fix tests | Wei-Ning Huang | 2019-10-03 | 2 | -3/+7 |
| | |||||
* | core: update mainnet genesis | Wei-Ning Huang | 2019-09-19 | 1 | -1/+1 |
| | |||||
* | Revert "core: consider reset round when getting config state" | Wei-Ning Huang | 2019-09-17 | 3 | -35/+9 |
| | | | | This reverts commit 01cb8de88b0697879cc366e3ee962c9523dfcc14. | ||||
* | core: vm: fix DKG nacking threshold | Wei-Ning Huang | 2019-09-17 | 1 | -14/+18 |
| | | | | DKG nacking threshold should only be t + 1 instead of 2t + 1 | ||||
* | params: update testnet dMoment | Wei-Ning Huang | 2019-09-17 | 1 | -1/+1 |
| | |||||
* | core: vm: allow unstake empty staked node | Wei-Ning Huang | 2019-09-17 | 1 | -1/+1 |
| | |||||
* | core: vm: reject transaction for some gov methods if value > 0 | Wei-Ning Huang | 2019-09-17 | 1 | -0/+48 |
| | |||||
* | params: update mainnet config | Wei-Ning Huang | 2019-09-17 | 1 | -1/+1 |
| | |||||
* | core: add p2p whitelist for consortium | Jhih-Ming Huang | 2019-09-17 | 3 | -371/+842 |
| | |||||
* | core: vm: use correct notary set size when verifying CRS | Wei-Ning Huang | 2019-09-17 | 1 | -1/+1 |
| | |||||
* | params: update testnet config and dMoment | Wei-Ning Huang | 2019-09-17 | 2 | -2/+2 |
| | |||||
* | core: consider reset round when getting config state | Wei-Ning Huang | 2019-09-17 | 3 | -9/+35 |
| | | | | | | | | | | | | | | | | | | Previous config snapshot is determined as follows, for round n: Return the snapshot state of round (n - ConfigRoundShift) However this may cause the system to stuck at a particular round if the DKG for the next round continues to fail (maybe due to node failure). To fix this, instead of using the simple logic above, we consider the reset rounds as a normal round, and use the snapshot of the reset rounds as config. Thus we could gradually push out the broken nodes from nodeset. The snapshot is now determined as follows, for round n: If resetCount < ConfigRoundShift Return the snapshot state of round (n - ConfigRoundShift) Else Reutrn the stateshot state of (n + resetCount - ConfigRoundShift) | ||||
* | core: add GovUtil to unify governance state related access | Wei-Ning Huang | 2019-09-17 | 8 | -179/+227 |
| | | | | | Add GovUtil so we could use the same logic in everywhere that requires access to governance state, such as configuration and CRS. | ||||
* | import: switch consensus core to ↵ | Wei-Ning Huang | 2019-09-17 | 13 | -35/+35 |
| | | | | gitlab.com/tangerine-network/tangerine-consensus | ||||
* | params: update testnet dMoment | Wei-Ning Huang | 2019-09-17 | 1 | -1/+1 |
| | |||||
* | core: vm update oracle contract addresses | Wei-Ning Huang | 2019-09-17 | 1 | -2/+5 |
| | |||||
* | core: vm: update governance test suite name | Wei-Ning Huang | 2019-09-17 | 1 | -20/+20 |
| | |||||
* | core: vm: remove opRand and use oracle contract to get random number | Jhih-Ming Huang | 2019-09-17 | 7 | -34/+85 |
| | |||||
* | core: set block timestamp to second instead of millisecond | Wei-Ning Huang | 2019-09-17 | 2 | -2/+2 |
| | |||||
* | core: vm: add updateNodeInfo governance method | Wei-Ning Huang | 2019-09-17 | 3 | -86/+201 |
| | |||||
* | params: update testnet and remove DEXON testnets | Wei-Ning Huang | 2019-09-17 | 3 | -53/+1 |
| | |||||
* | Rebrand as tangerine-network/go-tangerine | Wei-Ning Huang | 2019-09-17 | 107 | -493/+493 |
| | |||||
* | core: vm: prevent replace duplicate nodeKey | Wei-Ning Huang | 2019-09-17 | 2 | -3/+24 |
| | |||||
* | core: vm: fix payFine function | Wei-Ning Huang | 2019-09-17 | 2 | -1/+11 |
| | |||||
* | core: vm: implement transferNodeOwnershipByFoundation (#399) | Wei-Ning Huang | 2019-06-15 | 3 | -0/+93 |
| | |||||
* | core, rawdb, dex: improve gov state for syncing (#393) | Sonic | 2019-06-15 | 4 | -3/+105 |
| | | | | * core, rawdb, dex: improve gov state for syncing | ||||
* | core: update mainnet genesis alloc | Wei-Ning Huang | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | core: update mainnet genesis alloc (#389) | Wei-Ning Huang | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | core: update mainnet genesis alloc (#384) | Wei-Ning Huang | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | core: vm: add sanity check for updateConfiguration (#383) | Wei-Ning Huang | 2019-06-15 | 1 | -0/+12 |
| | |||||
* | core: optimize verify header (#381) | Jimmy Hu | 2019-06-15 | 1 | -11/+76 |
| | |||||
* | core: only verify the last tsig of header chain (#380) | Jimmy Hu | 2019-06-15 | 1 | -6/+13 |
| | |||||
* | core: vm: fix node offset during transfer (#377) | Wei-Ning Huang | 2019-06-15 | 2 | -13/+9 |
| | |||||
* | core: mainnet genesis allocation (#375) | Wei-Ning Huang | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | core: vm: add withdrawable (#373) | Jimmy Hu | 2019-06-15 | 3 | -15/+66 |
| | |||||
* | core: vm: refine panic flow (#372) | Wei-Ning Huang | 2019-06-15 | 1 | -15/+7 |
| | | | | Move panic call to immediate location of the error to prevent accidententaly panic on other conditions. | ||||
* | core: update mainnet genesis allocation data and config (#369) | Wei-Ning Huang | 2019-06-15 | 2 | -2/+2 |
| | |||||
* | core: vm: clearDKG in resetDKG (#368) | Jimmy Hu | 2019-06-15 | 1 | -0/+8 |
| | |||||
* | core: vm: fix emitReported (#367) | Wei-Ning Huang | 2019-06-15 | 1 | -6/+15 |
| | |||||
* | core: vm: prevent setting owner to blackhole (#366) | Jimmy Hu | 2019-06-15 | 2 | -1/+19 |
| | | | | | | * core: vm: prevent setting owner to blackhole * core: vm: same for transferNodeOwner | ||||
* | core: implement DKG success (#362) | Jimmy Hu | 2019-06-15 | 4 | -32/+215 |
| | | | | | | | | * vendor: sync to latest core * core: implmenet dkg success * cmd: govtool: add DKGSuccess | ||||
* | core: add reset to dkg private key db (#355) | Jimmy Hu | 2019-06-15 | 1 | -8/+18 |
| | | | | | * vendor: sync to latest core * core: dkg private key db | ||||
* | core: vm: improve MPK reverse lookup performance | Wei-Ning Huang | 2019-06-15 | 3 | -82/+92 |
| | | | | | By storing array offset in the original DKGMasterPublicKeyProposed map, we can locate MPK by proposer ID easily. | ||||
* | travis, appveyor, Dockerfile: upgrade to Go 1.12 | Samuel Marks | 2019-06-15 | 1 | -1/+1 |
| | | | | Include serveral DEXON specific fixes. | ||||
* | core: fix genesis timestamp (#338) | Jimmy Hu | 2019-06-15 | 1 | -4/+4 |
| | |||||
* | core: update mainnet and testnet config and genesis alloc (#337) | Wei-Ning Huang | 2019-06-15 | 1 | -2/+4 |
| | |||||
* | core: vm: cache GPK to prevent DoS (#335) | Wei-Ning Huang | 2019-06-15 | 1 | -1/+18 |
| | | | | Cache GPK so one can not slow the chain down with the ProposeCRS method call. | ||||
* | core: add cache for DKG MPK and complaint (#334) | Wei-Ning Huang | 2019-06-15 | 2 | -36/+90 |
| | | | | | Since deserializing DKG related items are extremely slow (takes about 3 seconds for 100 items), we cache it in the governance interface. | ||||
* | core: vm: fineFailStopDKG if MPK not registered (#329) | Jimmy Hu | 2019-06-15 | 2 | -12/+29 |
| | | | | | * core: vm: fineFailStopDKG if MPK not registered * prevent on-chain randomness | ||||
* | core: vm: fix fineFailStopDKG (#328) | Jimmy Hu | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | dexcon: correctly fine DKGSet for not producing blocks (#325) | Wei-Ning Huang | 2019-06-15 | 1 | -19/+27 |
| | |||||
* | core: vm: implement node public key replacement (#324) | Wei-Ning Huang | 2019-06-15 | 3 | -1/+102 |
| | |||||
* | vendor: sync to latest core (#320) | Jimmy Hu | 2019-06-15 | 1 | -4/+4 |
| | | | | | | | | * vendor: sync to latest core * dex, core: fix conflict x | ||||
* | core: vm: clear DKG the right way (#319) | Jimmy Hu | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | core/vm: resetDKG if ttoo less qualified (#318) | Jimmy Hu | 2019-06-15 | 1 | -1/+9 |
| | |||||
* | core: vm: make fail stop fine value configurable (#312) | Wei-Ning Huang | 2019-06-15 | 3 | -55/+92 |
| | | | | A node is now quailified only if it has no pending fine and staked >= minstake. | ||||
* | dex: rebuild connection if dkg reset, core/vm: fix gov (#308) | Jimmy Hu | 2019-06-15 | 2 | -0/+16 |
| | | | | | * dex: rebuild connection if dkg reset * core: vm: fix governance contract | ||||
* | core: vm: update set size on node info change (#307) | Wei-Ning Huang | 2019-06-15 | 1 | -8/+4 |
| | | | | | | * core: vm: update set size on node info change * fix typo | ||||
* | core: merge notarySet and DKGSet (#265) | Jimmy Hu | 2019-06-15 | 4 | -96/+27 |
| | | | | | | | | * vendor: sync to latest core * core: merge notarySet and dkgSet * dex: optimize network traffic for finalized block | ||||
* | core: fix finalize logic (#302) | Jimmy Hu | 2019-06-13 | 1 | -4/+0 |
| | |||||
* | core: set extended round block reward to zero (#298) | Wei-Ning Huang | 2019-06-13 | 2 | -1/+66 |
| | | | | | To discourage DKG set from prolonging the round indefinitely, we set the block reward of the extended round to 0. The gas fee is send to the DEXON governance owner for safe keeping and later used by the foundation. | ||||
* | core: vm: fix DKG reset (#296) | Wei-Ning Huang | 2019-06-13 | 2 | -23/+26 |
| | |||||
* | core/vm: remove round from addDKG functions (#279) | Jimmy Hu | 2019-06-13 | 5 | -129/+93 |
| | | | | | | | | * vendor: sync to latest core * core/vm: remove addDKG functions * core: fix conflict | ||||
* | core: vm: deny duplicate public key from registering (#289) | Wei-Ning Huang | 2019-06-13 | 2 | -1/+20 |
| | |||||
* | core: vm: pay fine to governance owner and trigger set size recalculation (#288) | Wei-Ning Huang | 2019-06-13 | 1 | -1/+5 |
| | |||||
* | consensus: dexcon: disqualify dead node (#280) | Wei-Ning Huang | 2019-06-13 | 4 | -39/+230 |
| | | | | | | | | | | Since a qualified node might fail stopped, we need to remove them from qualified nodes to maintain network integrity. We do this by inspect the previous round to see if there are dead nodes. A dead node is a notary set node that does not propose any block in the previous round. We disqualify them by fining them so their staked value is 1 wei below minStake. This make them unqualified for being notary set in the follow on rounds. | ||||
* | core: check coinbase for empty block (#282) | Jimmy Hu | 2019-06-13 | 1 | -6/+13 |
| | |||||
* | core: vm: emit event when transfering owner (#277) | Wei-Ning Huang | 2019-06-13 | 3 | -0/+48 |
| | |||||
* | core: fix headerchain coinbase validation | Wei-Ning Huang | 2019-06-13 | 1 | -2/+7 |
| | | | | Coinbase address is the owner address of the node. | ||||
* | core: vm: automatically calculate notary set size (#276) | Wei-Ning Huang | 2019-06-13 | 4 | -15/+96 |
| | |||||
* | core: vm: add extra checks to prevent DKG spamming (#272) | Wei-Ning Huang | 2019-06-12 | 4 | -62/+177 |
| | | | | Add two maps to check the uniqueness of DKGMasterPublicKey and DKGComplaints to prevent malicious actors from spamming it. | ||||
* | core: vm: fix naming consistency | Wei-Ning Huang | 2019-06-12 | 2 | -11/+11 |
| | |||||
* | core: check reset of dkg types when adding (#268) | Jimmy Hu | 2019-06-12 | 1 | -0/+16 |
| | | | | | | * vendor: sync to latest core * core: check dkg reset | ||||
* | core: vm: reorder minGasPriceLoc | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: fill in genesis timstamp and remove dMoment from protocol handshake (#263) | Wei-Ning Huang | 2019-06-12 | 2 | -1/+14 |
| | | | | | | Fill in dmoment as genesis block timestamp. This allow us to remove dMoment check from protocol handshake since genesis block hash itself will protect us against different dMoment. | ||||
* | dex: implement recovery mechanism (#258) | Wei-Ning Huang | 2019-06-12 | 2 | -5/+5 |
| | | | | | | | | | * dex: implement recovery mechanism The DEXON recovery protocol allows us to use the Ethereum blockchain as a fallback consensus chain to coordinate recovery. * fix | ||||
* | core: vm: group min gas price with related state variables (#257) | Wei-Ning Huang | 2019-06-12 | 3 | -16/+16 |
| | |||||
* | core: vm: implement transfer node ownership (#255) | Wei-Ning Huang | 2019-06-12 | 3 | -9/+83 |
| | |||||
* | core: vm: create new oracle contract instance in each call (#251) | Wei-Ning Huang | 2019-06-12 | 3 | -6/+16 |
| | | | | | Since the VM might be called from different source (downloader, RPC, etc.). We need to make the call state separate. Modify the calling sequence so a new oracle contract instance is used on each run. | ||||
* | vendor: sync to latest core (#253) | Jimmy Hu | 2019-06-12 | 2 | -3/+56 |
| | |||||
* | core/vm: use core util to get threshold of tsig (#250) | Jimmy Hu | 2019-06-12 | 1 | -3/+4 |
| | |||||
* | params: update testnet config to 40 nodes | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | vendor: sync to latest core and fix conflict | Jimmy Hu | 2019-06-12 | 1 | -2/+2 |
| | |||||
* | core: touch verifierCache at 90% of round (#247) | Jimmy Hu | 2019-06-12 | 1 | -2/+35 |
| | |||||
* | app: new app test flow (#244) | bojie | 2019-06-12 | 6 | -65/+8 |
| | |||||
* | core: vm: remove delegation mechanism (#245) | Wei-Ning Huang | 2019-06-12 | 6 | -997/+263 |
| | | | | | | | | | | | | | The current delegation mechanism are prone to unstaking attack. i.e. a malicious attacker could unstake a small amount from a lot of node it staked before and make them unqualified, which leads to potential failure of the network. Since DEXON does not use consensus like DPoS, node is required to have at least MinStake in order to become a node. Voting mechanism is not required in our system since qualified node does not depends on the number of votes. Instead of managing the delegation mechanism in governance contract, we should let the owner manage the delegation and reward distribution mechanism on their own. | ||||
* | core: vm: expose CRSRound and DKGRound and fix consistency (#236) | Wei-Ning Huang | 2019-06-12 | 3 | -60/+118 |
| | |||||
* | app: refactor app run as single chain (#226) | bojie | 2019-06-12 | 1 | -146/+14 |
| | |||||
* | core: fix dkg | Jimmy Hu | 2019-06-12 | 1 | -12/+47 |
| | |||||
* | params: Change taipei to 40 nodes (#227) | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | dex: fill in correct coinbase address (#223) | Wei-Ning Huang | 2019-06-12 | 1 | -0/+9 |
| | | | Also remove app_test.go because of the refactor bojie@ is working on. | ||||
* | params: Update config (#224) | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | | | | | | * params: Update config * Update taipei to 30 nodes setup | ||||
* | core: vm: validate addDKGMasterPublicKey caller properly (#220) | Wei-Ning Huang | 2019-06-12 | 3 | -60/+59 |
| | | | | | | There are two keys in the system: one is the owner's key which is used for stake / unstake. The other is the node key which is used for DKG related operations. We need to allow them to be different so fund renmains safe even if the the node key is lost. | ||||
* | core: vm: flatten governance | Wei-Ning Huang | 2019-06-12 | 10 | -524/+523 |
| | |||||
* | core: sync to latest core (#214) | Jimmy Hu | 2019-06-12 | 3 | -7/+20 |
| | | | | | * vendor: sync to latest core * fix for single chain | ||||
* | params: add Yilan network (#207) | Mission Liao | 2019-06-12 | 3 | -0/+25 |
| | | | | | | * Add Yilan network * Fixup: remove dummy log | ||||
* | core: Fixed gas price (#205) | Jimmy Hu | 2019-06-12 | 6 | -2/+96 |
| | | | | | | | | | | * core/vm: update abi * core/vm: add MinGasPrice to gov * params: Add MinGasPrice to Config * dex: SuggestPrice from Governance * test: add minGasPrice to genesis.json * core: check underpriced tx * dex: verify with gas price | ||||
* | core: set oracle contract's code (#209) | Sonic | 2019-06-12 | 2 | -1/+6 |
| | | | So that other contract can call oracle contract. | ||||
* | fee: fix wrong gas used (#208) | bojie | 2019-06-12 | 1 | -0/+2 |
| | |||||
* | core: Remove K, Phi and NumChains from Governance (#198) | Jimmy Hu | 2019-06-12 | 5 | -174/+37 |
| | | | | | | * change default sync_core.sh * vendor: sync to latest core * core: Remove K, Phi and NumChain | ||||
* | copy testnet config to taipei | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core/vm: fix getConfigState (#203) | Jimmy Hu | 2019-06-12 | 1 | -4/+3 |
| | |||||
* | vm: reset DKG (#190) | Jimmy Hu | 2019-06-12 | 4 | -70/+562 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm: Update gov abi * vm: Add DKGResetCount to state helper * vm: add getter * vm: Add DKGReset event * vm: Add resetDKG method * vm: check resetDKG criteria * vm: Add new CRS * vm: add helper pop2DByteArray * vm: emit event * vm: Add CoreMock to GovernanceContract * vm: bug fix * add test for resetDKG * vm: Add test * fix test * Modify mock interface | ||||
* | transaction: use all transaction gas to reduce attack intention (#180) | bojie | 2019-06-12 | 1 | -1/+25 |
| | | | The ci test in /tests will use origin evm logic. | ||||
* | core/vm: modify Withdrawn event and add NodeRemoved event (#179) | Jimmy Hu | 2019-06-12 | 2 | -4/+31 |
| | | | | | | * core/vm: add delegatorAddr to withdrawn event * core/vm: update gov abi * core/vm: add NodeRemoved event | ||||
* | core: vm: refactor governance and add node info oracle (#174) | Wei-Ning Huang | 2019-06-12 | 5 | -682/+953 |
| | |||||
* | core: vm: Add amount to undelegate event (#176) | Jimmy Hu | 2019-06-12 | 2 | -4/+9 |
| | |||||
* | core: vm: more change to the randomness calculation (#175) | Wei-Ning Huang | 2019-06-12 | 1 | -5/+5 |
| | | | | To prevent attacker from sending TX through a intermediate contract. Always use the original tx sender's adddress and nonce. | ||||
* | core: vm: modify randomness calculation algorithm (#173) | Wei-Ning Huang | 2019-06-12 | 2 | -3/+7 |
| | | | | | | | | | | | | | | | | | | | | | | | | The original algorithm used for calculating algorithm is vulnerable to cross context re-entry attack. Example as follows: contract B { event Value(uint256 value); uint256 public value; function call() public { value = rand; emit Value(value); } } contract A { function randTwice(address bAddr) public { B b = B(bAddr); b.call.gas(100000)(); b.call.gas(100000)(); } } The two `b.call` will result in the same randomness value. This commit fix the issue by recording a called index used to store how many times opRand is called, and use it as argument to the Keccak call. | ||||
* | consensus: dexcon: snapshot round height when finalizing block (#170) | Wei-Ning Huang | 2019-06-12 | 3 | -106/+0 |
| | | | | Instead of having BP to send a tx to register the round height, just modify the state when finalizing block. | ||||
* | core, dex/downloader: polish headers verification and blocks insertion logic ↵ | Sonic | 2019-06-12 | 8 | -509/+614 |
| | | | | | | | | (#168) Refactor GenerateDexonChain function, move governance tx logic to the user of GenerateDexonChain (testchain_test.go) and move fake node set code to FakeDexcon. | ||||
* | travis: re-encrypt GCP credential file (#165) | bojie | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | params: update testnet genesis and dMoment | Wei-Ning Huang | 2019-06-12 | 1 | -2/+1 |
| | |||||
* | core, dex: use block hash as witness data (#160) | Sonic | 2019-06-12 | 5 | -50/+17 |
| | | | | | | | | | | Using only state root and receipt root as witness data can not protect other fields in block header, ex: bloom, difficulty, gas limit, gas used... So that everyone can manipulate these fields to create as many valid blocks at the same height as he want. Although this will not effect the state, one can spam us when syncing. Using block hash as witness data can solve this. | ||||
* | blockchain: add mutex lock to prevent fork (#159) | bojie | 2019-06-12 | 1 | -1/+6 |
| | |||||
* | core: sync to latest core (#158) | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | | | | | | * vendor: sync to latest core * param: Update config * core: update genesis alloc | ||||
* | app: fix reward bug with empty block (#155) | bojie | 2019-06-12 | 1 | -3/+2 |
| | | | | | | | | * app: fix reward bug with empty block * make block generation consistent * revert change to dmoment in genesis.json | ||||
* | app: remove pending block logic (#149) | bojie | 2019-06-12 | 6 | -296/+197 |
| | |||||
* | core: update taipei alloc | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | params: update genesis config | Wei-Ning Huang | 2019-06-12 | 3 | -16/+21 |
| | |||||
* | consensus: implement DEXON cryptoeconomics v4.0 (#145) | Wei-Ning Huang | 2019-06-12 | 5 | -57/+153 |
| | |||||
* | core: vm: add totalSupply and totalStaked in the governance contract (#144) | Wei-Ning Huang | 2019-06-12 | 4 | -35/+144 |
| | | | | | | | Add totalSupply and totalStaked in the governance contract for the preperation of DEXON cryptoeconomics 4.0. Also removed the unstaked variable in node info and improve tests for delegate/undeleate. | ||||
* | core: vm: move governance abi to a separate file (#143) | Wei-Ning Huang | 2019-06-12 | 2 | -1053/+1074 |
| | |||||
* | core: vm: emit events for more governance actions (#142) | Wei-Ning Huang | 2019-06-12 | 1 | -0/+145 |
| | |||||
* | core: update testnet genesis_alloc | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: update taipei network genesis alloc | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: fix corner case when initializing round height (#134) | Sonic | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | app: implement logic for prepare/verify correctly when chain number change ↵ | bojie | 2019-06-12 | 5 | -19/+122 |
| | | | | (#118) | ||||
* | core: vm: implement byzantine reporting mechanism (#128) | Wei-Ning Huang | 2019-06-12 | 2 | -48/+578 |
| | |||||
* | params: update taipei genesis config (#130) | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core, indexer, dex: fix DexconApp block deliver after synced (#122) | Sonic | 2019-06-12 | 1 | -5/+6 |
| | | | | | | | When starts a bp node to sync with the network, bc.chainLastHeight map may not be initialized yet. Just return error if we can not get chain last height when preparing payload and verify block. | ||||
* | core: fix vm wrong round height context (#124) | Sonic | 2019-06-12 | 1 | -0/+45 |
| | | | | Let roundHeightMap be corret whenever we starting a bp node. | ||||
* | core: update taipei testnet genesis config and alloc (#119) | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: vm: add missing unittests for nodes/delegators (#116) | Wei-Ning Huang | 2019-06-12 | 2 | -3/+13 |
| | |||||
* | params: update taipei testnet genesis and config (#113) | Wei-Ning Huang | 2019-06-12 | 2 | -3/+5 |
| | |||||
* | core/vm: Add fine to governance. (#107) | Jimmy Hu | 2019-06-12 | 2 | -132/+292 |
| | | | | | | | | * core/vm: Add Fined field to nodeInfo. * core/vm: Add PayFine to Governance * Not qualify if staked-fine < minStake() * Add test for fine * Update genesis hash | ||||
* | core: add database/sql support for more types (#102) | Meng-Ying Yang | 2019-06-12 | 2 | -8/+112 |
| | | | | | | | | | * core: types: add database/sql support for BlockNonce * common: add database/sql support with Big New Big type is declared to let big.Int support database/sql by implementing Scan() and Value() on new type. | ||||
* | vendor: sync DEXON core and fix conflicts/missings (#101) | Mission Liao | 2019-06-12 | 1 | -4/+6 |
| | | | | | | | Merging these commits in DEXON consensus core: - https://github.com/dexon-foundation/dexon-consensus/commit/dce509a13ef5873b9cae3c1cabdb97e219b6fb7d - https://github.com/dexon-foundation/dexon-consensus/commit/6d1c1aeea0d3e75d10cbb2712c68b4c422ba8ba6 - https://github.com/dexon-foundation/dexon-consensus/commit/c1ed57c4abaf1f4758e52f082bb7114ad00c8b39 | ||||
* | core/types: SigCache with a limited size (#98) | Jimmy Hu | 2019-06-12 | 2 | -21/+33 |
| | | | | | | * core/types: SigCache with a limited size * minor tweaks | ||||
* | core, dex, internal: block proposer syncing (first iteration) (#96) | Sonic | 2019-06-12 | 2 | -57/+2 |
| | | | | | | | | | | | | | | | | | | | | | | * dex, internal: block proposer syncing (first iteration) * core: find block from db if not in memory This fix handles stopping proposing and then restarting * core: no need to reorg when reset Dexon will not fork. This commit also fix when a block confirm but its parent is not in db yet, during restarting proposing. * dex: always accept NewBlockMsg, NewBlockHashesMsg We need to accept NewBlockMsg, NewBlockHashesMsg to sync current block with other peers in block proposer mode when syncing lattice data. It's a waste when the node is synced and start proposing. Todo: control msg processing on/off more granular, accept NewBlockMsg, NewBlockHashesMsg when syncing, but stop when synced. | ||||
* | core: vm: Add `MPKReady` to governance (#97) | Jimmy Hu | 2019-06-12 | 2 | -0/+174 |
| | | | | | | * core/vm: Add DKGMPKReady * param: update GenesisHash * vendor: sync to latest core | ||||
* | core/vm: fix nodes method in governance | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | dex: remove duplicate declaration of WitnessData (#92) | Wei-Ning Huang | 2019-06-12 | 2 | -7/+0 |
| | | | | Remove duplicate declaration of WitnessData and remove the TxHash field in witness data since it does not need to be witnessed. | ||||
* | core: vm: add undelegate fund lockup mechanism (#94) | Wei-Ning Huang | 2019-06-12 | 3 | -41/+236 |
| | | | | | Only allow a user to withdraw funds after a certain lockup period. This way, the fund of a bad actor could be confiscated before he could escape. | ||||
* | core: update genesis alloc | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | vendor: sync to latest core (#91) | Mission Liao | 2019-06-12 | 3 | -1/+108 |
| | | | | | | - Implement new methods in db to cache DKG private key. - Implement new methods in db to cache compaction chain tip. | ||||
* | cache: prune cache correctly (#88) | bojie | 2019-06-12 | 1 | -2/+1 |
| | |||||
* | core: governance interface should return correct DKG master public keys (#85) | Wei-Ning Huang | 2019-06-12 | 2 | -24/+21 |
| | |||||
* | core, dex: polish sync (#75) | Sonic | 2019-06-12 | 1 | -0/+3 |
| | | | | | | | | | | | | | | | - Broadcasting blocks at chain head event is not correct when the full node is not running in block proposer mode. Introduce NewFinalizedBlockEvent, this event is post by the full node which runs in block proposer mode when a block is witnessed and resulting in some blocks are considered finalized. - Non block proposer node will still broadcast blocks at the following moment (same as ethereum): 1. a sync with a peer is terminated successfully 2. a block passes the fetcher's header check during inserting blocks 3. a block is successfully inserted by fetcher - Don't trigger a sync when we are not behind other peers more than acceptable distance. Fetcher is able to cover this. | ||||
* | core, dex: Timeout for prepare payload (#72) | Jimmy Hu | 2019-06-12 | 2 | -8/+13 |
| | | | | | | * Timeout on prepare payload * Leave 2 CPU for others * Add hardLimit and softLimit to PreparePayload | ||||
* | app: add app test case and benchmark (#66) | bojie | 2019-06-12 | 3 | -13/+268 |
| | |||||
* | dex: verify header that imported from fetcher (#68) | Sonic | 2019-06-12 | 1 | -0/+4 |
| | |||||
* | Fix lint | Wei-Ning Huang | 2019-06-12 | 2 | -3/+3 |
| | |||||
* | core: Update genesis alloc. (#63) | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: panic if fork found when inserting header chain (#61) | Wei-Ning Huang | 2019-06-12 | 1 | -1/+6 |
| | |||||
* | tests: fix tests | Wei-Ning Huang | 2019-06-12 | 1 | -1/+10 |
| | |||||
* | dex: fix tests | Wei-Ning Huang | 2019-06-12 | 1 | -0/+2 |
| | |||||
* | core: fix tests | Wei-Ning Huang | 2019-06-12 | 2 | -4/+5 |
| | |||||
* | core: vm: fix power2 table calculation (#50) | Wei-Ning Huang | 2019-06-12 | 1 | -3/+3 |
| | |||||
* | core: commit states at snapshot height (#49) | Sonic | 2019-06-12 | 1 | -2/+7 |
| | |||||
* | core: add Taipei testnet (#47) | Wei-Ning Huang | 2019-06-12 | 1 | -1/+13 |
| | | | | Add a new testnet named Taipei. | ||||
* | core: various changes on tps tuning (#46) | Wei-Ning Huang | 2019-06-12 | 5 | -11/+14 |
| | |||||
* | core: increase tx pool size | Wei-Ning Huang | 2019-06-12 | 1 | -4/+4 |
| | |||||
* | core, dex, downloader: refactor governance | Sonic | 2019-06-12 | 2 | -25/+61 |
| | |||||
* | core, dex, dex/downloader: restore insertChain to upstream version | Sonic | 2019-06-12 | 2 | -20/+18 |
| | | | | | Also rename InsertChain2, insertChain2, InsertHeaderChain2, ValidateHeaderChain2 | ||||
* | dex: implement downloader for dex | Sonic | 2019-06-12 | 1 | -0/+5 |
| | | | | | | | | | | | We need governance state to verify block's signature (randomness), but in ethereum fast sync mode, eth downloader only downloads the whole state of pivot block, so we don't have governance state to verify the downloaded block that is before pivot block if we don't processing transaction. To avoid running transactions, dex downloader also downloads the governance state (merkle proof and storage) at snapshot height of each round, so that we can verify blocks in fast sync mode. | ||||
* | core: implement insert chain, headerchain logic | Sonic | 2019-06-12 | 3 | -0/+521 |
| | |||||
* | core: support extracting governance state from state trie | Sonic | 2019-06-12 | 3 | -0/+73 |
| | |||||
* | core: add global signature cache and improve concurrency (#42) | Wei-Ning Huang | 2019-06-12 | 4 | -53/+86 |
| | | | | | From the go trace result, the bottleneck hides in the lock of StoreTxCache. To improve this, we update the cache in a batched fassion. | ||||
* | core, dex: Batch process touchSender. Lower priority for tx. (#41) | Jimmy Hu | 2019-06-12 | 1 | -13/+19 |
| | | | | | | | * dex: Add a tx queue in broadcast * Modify queue parameter * Priority select all messages except tx * Batch process TouchSenders | ||||
* | dex: add BlockDB, which implements consensus core's blockdb.BlockDatabase (#36) | Sonic | 2019-06-12 | 2 | -0/+58 |
| | |||||
* | core: vm: change offset type to int256 | Wei-Ning Huang | 2019-06-12 | 1 | -2/+7 |
| | | | | | Since we use -1 to represent the offset of empty value, we should make the return type int256 instead of uint256. | ||||
* | governance: implement delegate/undelegate function and add tests (#33) | Wei-Ning Huang | 2019-06-12 | 4 | -111/+1152 |
| | | | | | Implement delegate/undelegate function to allow others to delegate it's fund to stake on a node. Also added governance contract tests. | ||||
* | core: blockchain: fix concurrent map read and write (#34) | Wei-Ning Huang | 2019-06-12 | 1 | -4/+7 |
| | |||||
* | core: more fix on light node synchronization (#32) | Wei-Ning Huang | 2019-06-12 | 3 | -67/+50 |
| | | | | | | Fix gas calculation in governance contract. Correctly register round height when processing pending blocks. We should register the mapping when we get the pending block instead of waiting for block confirmation. | ||||
* | core: vm: add minStake to governance contract variable (#31) | Wei-Ning Huang | 2019-06-12 | 2 | -1/+42 |
| | |||||
* | core: fix light node synchronization issue (#30) | Wei-Ning Huang | 2019-06-12 | 4 | -9/+18 |
| | | | | | InsertChain() need to record the correct roundHeight mapping in order to process snapshotRoundHeight() governance method correctly. | ||||
* | core: revert changes to StateProcessor.Process (#29) | Wei-Ning Huang | 2019-06-12 | 2 | -10/+10 |
| | |||||
* | app: add cache to reuse same tx address which has already recovered (#26) | BJ4 | 2019-06-12 | 3 | -3/+41 |
| | |||||
* | core: refactor validator and fix light node sync (#25) | Wei-Ning Huang | 2019-06-12 | 8 | -147/+92 |
| | | | | | | | | Remove custom Dexon validator by adding a new `ValidateWitnessData` method into the validator interface. This allow us to properly detect know blocks. This also allow other gdex "light" client to sync compaction chain. Also, setup a standalone RPC node for handling RPC reqeusts. | ||||
* | core: use storeRoundHeight to avoid type mismatch (#21) | Sonic | 2019-06-12 | 1 | -9/+6 |
| | | | No need to store round 0, it's already pushed in genesis block | ||||
* | dex, core: Fix make fail (#24) | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core, dex: Optimize sender calculation in block transactions. (#22) | Jimmy Hu | 2019-06-12 | 2 | -0/+34 |
| | | | | | | * Add Transactions.TouchSenders that calculates sender and update cache * Use TouchSenders to fill the caches | ||||
* | core: validate DKG set with correct nodeset in round-2 (#19) | Wei-Ning Huang | 2019-06-12 | 4 | -32/+63 |
| | | | | | * vendor: sync consensus core * core: validate DKG set with correct nodeset in round-2 | ||||
* | core: vm: Optimize evm (#13) | Jimmy Hu | 2019-06-12 | 5 | -18/+282 |
| | | | | | | | * core: vm: add an EVM benchmark * core: vm: optimize stack allocation and instruction for calculating 2^n * Add DEXONBet bench | ||||
* | core: push height of round 0 in genesis block (#17) | Sonic | 2019-06-12 | 2 | -8/+11 |
| | | | | | | | * core: push height of round 0 in genesis block * vm: fix governance dispatch method name mismatch with abi also rename RoundHeightLoc to roundHeightLoc | ||||
* | dex: return correct pending nonce (#14) | Wei-Ning Huang | 2019-06-12 | 1 | -2/+11 |
| | | | | We need to return the correct pending nonce (include those in the tx pool). Also, StateAndHeaderByNumber is also fixed to use pending block. | ||||
* | params: fix genesis block config and use testnet for test (#10) | Wei-Ning Huang | 2019-06-12 | 1 | -3/+3 |
| | |||||
* | core: fix staked calculation in genesis (#8) | Jimmy Hu | 2019-06-12 | 1 | -4/+0 |
| | |||||
* | core: vm: expose governance contract ABI (#5) | Wei-Ning Huang | 2019-06-12 | 1 | -2/+2 |
| | |||||
* | core: blockchain: fix NewBlockChainWithDexonValidator (#4) | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: genesis: make ToBlock() compatible with legacy ethereum code (#3) | Wei-Ning Huang | 2019-06-12 | 1 | -28/+36 |
| | | | | Make ToBlock() compatible with legacy ethereum code so we can run tests normally. | ||||
* | app: fix core test | BJ4 | 2019-06-12 | 7 | -37/+144 |
| | |||||
* | core: vm: governance: add node info | Wei-Ning Huang | 2019-06-12 | 6 | -10/+149 |
| | |||||
* | core: validate roundHeight mapping in governance contract | Wei-Ning Huang | 2019-06-12 | 5 | -4/+43 |
| | |||||
* | core: GenerateChainWithRoundChange for testing | Sonic | 2019-06-12 | 3 | -0/+598 |
| | |||||
* | app: lock by chain correctly and remove old core in vendor | BJ4 | 2019-06-12 | 1 | -46/+49 |
| | |||||
* | core: vm: governance: remove maxInterval | Wei-Ning Huang | 2019-06-12 | 1 | -32/+0 |
| | |||||
* | core: vm: add nodesLengh method for reading nodeSet size | Wei-Ning Huang | 2019-06-12 | 1 | -0/+20 |
| | |||||
* | Rename import due to dexon-consensus rename | Wei-Ning Huang | 2019-06-12 | 3 | -18/+18 |
| | |||||
* | dex: minor refactor | Wei-Ning Huang | 2019-06-12 | 1 | -6/+5 |
| | |||||
* | app: add lock to prevent concurrent map read write | Bojie Wu | 2019-06-12 | 1 | -0/+3 |
| | |||||
* | core: tx_pool: remove transactions on BlockConfirmed event | Wei-Ning Huang | 2019-06-12 | 4 | -41/+53 |
| | |||||
* | dex: add block gas limit into governance | Wei-Ning Huang | 2019-06-12 | 1 | -0/+35 |
| | |||||
* | app: using lock correctly to use map safely | Bojie Wu | 2019-06-12 | 1 | -56/+86 |
| | |||||
* | app: fix concurrent map read write issue and accept fail transaction when ↵ | Bojie Wu | 2019-06-12 | 1 | -1/+7 |
| | | | | round change | ||||
* | core: fix blockReward serialization | Wei-Ning Huang | 2019-06-12 | 2 | -37/+28 |
| | |||||
* | app: add cache mechanism to increase performance | Bojie Wu | 2019-06-12 | 3 | -152/+136 |
| | |||||
* | core: set correct balance for governance contract | Wei-Ning Huang | 2019-06-12 | 2 | -1/+7 |
| | |||||
* | dex: return round in get block rpc output | Wei-Ning Huang | 2019-06-12 | 2 | -4/+5 |
| | |||||
* | app: fix concurrent read write issue with map | Bojie Wu | 2019-06-12 | 1 | -0/+6 |
| | |||||
* | dex: remove uneeded info from block header | Wei-Ning Huang | 2019-06-12 | 3 | -90/+87 |
| | |||||
* | core: types: fix header marshal json | Sonic | 2019-06-12 | 2 | -34/+72 |
| | |||||
* | vendor: sync consensus core and fix conflict | Wei-Ning Huang | 2019-06-12 | 1 | -7/+8 |
| | |||||
* | app: correct process pending block logic | Bojie Wu | 2019-06-12 | 1 | -126/+111 |
| | |||||
* | dex: fix missing randomness assignment | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | dex: fix DKG round switching | Wei-Ning Huang | 2019-06-12 | 1 | -6/+18 |
| | |||||
* | dex: fix round switching and initialize dMoment correctly | Wei-Ning Huang | 2019-06-12 | 1 | -1/+2 |
| | |||||
* | dex: misc fixes | Wei-Ning Huang | 2019-06-12 | 1 | -3/+3 |
| | |||||
* | app: check nonce and balance in prepare payload | Bojie Wu | 2019-06-12 | 2 | -5/+3 |
| | |||||
* | core: included Dexcon metadata in block | Wei-Ning Huang | 2019-06-12 | 1 | -2/+3 |
| | |||||
* | Remove reference of Rinkeby and Goerli network. | Wei-Ning Huang | 2019-06-12 | 2 | -26/+1 |
| | | | | We do not need ethereum Rinkeby and Goerli network in our system, remove it. | ||||
* | core: populate genesisAlloc in source code with DEXON genesis data | Wei-Ning Huang | 2019-06-12 | 3 | -15/+46 |
| | |||||
* | dex: use RLP to encode contract payload data | Wei-Ning Huang | 2019-06-12 | 1 | -6/+6 |
| | |||||
* | app: implement verify block logic | Bojie Wu | 2019-06-12 | 2 | -1/+51 |
| | |||||
* | consensus: dexcon: fetch config from state | Wei-Ning Huang | 2019-06-12 | 1 | -19/+22 |
| | |||||
* | core: vm: add blockReward to governance | Wei-Ning Huang | 2019-06-12 | 2 | -4/+39 |
| | |||||
* | dex: fix public key parsing due to changes in consensus core | Wei-Ning Huang | 2019-06-12 | 1 | -1/+4 |
| | |||||
* | core: set governance owner in genesis | Wei-Ning Huang | 2019-06-12 | 1 | -1/+3 |
| | |||||
* | params: load blockReward from genesis JSON file | Wei-Ning Huang | 2019-06-12 | 1 | -0/+1 |
| | |||||
* | app: fixup message format | Wei-Ning Huang | 2019-06-12 | 1 | -3/+3 |
| | |||||
* | app: implement new insert blocks logic | Bojie Wu | 2019-06-12 | 3 | -18/+246 |
| | |||||
* | test: create account storage for governance contract | Wei-Ning Huang | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core/dex: fix governance contract implementation | Wei-Ning Huang | 2019-06-12 | 1 | -19/+13 |
| | |||||
* | core: vm: implement RAND opcode support | Wei-Ning Huang | 2019-06-12 | 9 | -0/+45 |
| | | | | | | DEXON has a built-in on chain random oracle that allow one to retrieve a random variable. Add a new opcode `RAND` to load the random variable onto the stack. | ||||
* | dex/core: misc bug fixes | Wei-Ning Huang | 2019-06-12 | 2 | -2/+3 |
| | |||||
* | app: correct dexon application logic | Bojie Wu | 2019-06-12 | 2 | -48/+37 |
| | |||||
* | core: fix nil map initialization | Wei-Ning Huang | 2019-06-12 | 1 | -0/+7 |
| | |||||
* | app: init map | Bojie Wu | 2019-06-12 | 1 | -15/+17 |
| | |||||
* | core: setup stake in order so genesis block is deterministic | Wei-Ning Huang | 2019-06-12 | 1 | -1/+26 |
| | |||||
* | core: vm: modify dkg threshold | Jimmy Hu | 2019-06-12 | 1 | -1/+1 |
| | |||||
* | core: vm: add GovernanceStateHelper test | Wei-Ning Huang | 2019-06-12 | 2 | -0/+98 |
| | |||||
* | core: populate genesis CRS in genesis state | Wei-Ning Huang | 2019-06-12 | 1 | -0/+5 |
| | |||||
* | dex: bug fix to allow running geth without crashing | Wei-Ning Huang | 2019-06-12 | 2 | -9/+1 |
| | |||||
* | dex: implement sendTx related governance methods | Wei-Ning Huang | 2019-06-12 | 1 | -0/+5 |
| | |||||
* | core: vm: validate if mpk, complaint, finalize is in DKG set | Wei-Ning Huang | 2019-06-12 | 1 | -36/+62 |
| | |||||
* | core: vm: allow other people to stake for a node | Wei-Ning Huang | 2019-06-12 | 1 | -6/+0 |
| | |||||
* | dex: implement some governance interface functions | Wei-Ning Huang | 2019-06-12 | 1 | -213/+342 |
| | |||||
* | dex: governance: implement governance interface | Wei-Ning Huang | 2019-06-12 | 2 | -11/+23 |
| | |||||
* | app: implement new interface method | Bojie Wu | 2019-06-12 | 1 | -0/+56 |
| |