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

Lite fullnode Implementation #3031

Merged
merged 20 commits into from Aug 10, 2020

Conversation

tomatoishealthy
Copy link
Contributor

What does this PR do?

Lite Fullnode implementation

Why are these changes required?

add a Lite Fullnode tool

This PR has been tested by:

  • Unit Tests
  • Manual Testing

// now only has the snapshot block number
public static final String INFO_FILE_NAME = "info.properties";
// the block number that split between the snapshot and history
public static final String SPLIT_BLOCK_NUM = "split_block_num";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixed use of snake_case and camelCase keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming rule of constant in java is just this

@@ -112,6 +118,8 @@

public static final String NODE_RPC_MAX_HEADER_LIST_ISZE = "node.rpc.maxHeaderListSize";

public static final String NODE_OPEN_HISTORY_QUERY_WHEN_LITEFN = "node.openHistoryQueryWhenLiteFN";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too long and difficult to figure out the meaning.

@codecov-io
Copy link

Codecov Report

Merging #3031 into develop will increase coverage by 1.82%.
The diff coverage is 77.58%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #3031      +/-   ##
=============================================
+ Coverage      49.94%   51.76%   +1.82%     
- Complexity      6009     6210     +201     
=============================================
  Files            687      695       +8     
  Lines          37165    37719     +554     
  Branches        4041     4081      +40     
=============================================
+ Hits           18563    19527     +964     
+ Misses         17054    16604     -450     
- Partials        1548     1588      +40     
Impacted Files Coverage Δ Complexity Δ
...src/main/java/org/tron/core/db2/common/HashDB.java 56.25% <0.00%> (-8.04%) 5.00 <0.00> (ø)
common/src/main/java/org/tron/core/Constant.java 50.00% <ø> (ø) 1.00 <0.00> (ø)
...ava/org/tron/core/db2/common/ConcurrentHashDB.java 50.00% <0.00%> (-8.34%) 4.00 <0.00> (ø)
...mework/src/main/java/org/tron/core/db/Manager.java 59.83% <14.28%> (+2.77%) 127.00 <0.00> (+10.00)
.../src/main/java/org/tron/core/config/args/Args.java 69.54% <50.00%> (+0.40%) 83.00 <1.00> (+5.00)
...src/main/java/org/tron/tool/litefullnode/Util.java 60.00% <60.00%> (ø) 6.00 <6.00> (?)
...ava/org/tron/tool/litefullnode/db/RocksDBImpl.java 61.53% <61.53%> (ø) 7.00 <7.00> (?)
...a/org/tron/tool/litefullnode/LiteFullNodeTool.java 73.68% <73.68%> (ø) 47.00 <47.00> (?)
.../main/java/org/tron/core/db2/common/TxCacheDB.java 70.37% <78.37%> (+6.73%) 14.00 <2.00> (+4.00)
...c/main/java/org/tron/tool/litefullnode/DbTool.java 81.25% <81.25%> (ø) 13.00 <13.00> (?)
... and 138 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 978a643...98c65ae. Read the comment docs.

@tomatoishealthy tomatoishealthy merged commit 3d34e7d into tronprotocol:develop Aug 10, 2020
dpneko added a commit that referenced this pull request Aug 19, 2020
* develop:
  Add retry check for event query test case
  solving the sonor problem
  Add retry check for event query test case
  Add retry check for event query test case
  Add query reward test case for daily build
  Add query reward test case for daily build
  Update quickstart.md (#3337)
  Modify daily build test case
  Modify daily build test case
  simplify code with common functions
  optimize redundant code
  docker: update java-tron docker deploy (#3330)
  Lite fullnode Implementation (#3031)
  Updated readme.md for small spell fix.
  modify dex version

# Conflicts:
#	common/src/main/java/org/tron/common/parameter/CommonParameter.java
#	framework/src/main/resources/config.conf
tomatoishealthy added a commit that referenced this pull request Nov 2, 2020
* remove unused file

* sync the pbft commit data

* Update DelegationService.java

* Update HttpInterceptor.java

* Update RpcApiService.java

* Update BlockCapsule.java

* fix sonar error

* Update ActuatorConstant.java

* Update AssetIssueActuator.java

* Update UpdateBrokerageActuator.java

* Update UpdateSettingContractActuator.java

* format code

* fix testfile checkStyle

* remove shielded transaction committee config

* fix the code style

* add getcontractinfo interface

* fix conflict

* fix conflict

* feat: update market contract value

* implement proposal for set transaction ret for contract

* Implement reset transaction ret and fix ret to contract result

* Implement delete reset transaction ret and fix ret to contract result

* reset tx result when not wrapped in a block

* add the pbft commit data sync

* fix http conflict

* modify comment

* fix(test): fix config of test because of modification of market contract value

* fix checkstyle

* fix checkstyle

* fix the sonar error

* change proposal num

* refactor code

* refactor code

* add unit test

* remove unuse code

* add new implementation for reset result

* add uint test

* implement selfbalance and chainid

* refine chainid and selfbalance

* refactor code and remove unused file

* fix checkstyle problem

* fix unit test

* fix the pbft data sync

* revert delete code

* revert delete code

* reduce alt_bn128 precompile gas costs _1108

* fix the sonar error

* limit reset transaction only for smart contract transactions

* add allowContractCreationImprovement proposal for 4.1 release

* add allowTvmIstanbul proposal

* add contract processor interface

* deplay proposal 47

* modify dex version

* add iswitness/rewardbalance instruction

* add unit test for TVM Istanbul

* fix create2

* stake and unstake processor

* add opcode

* add withRewardProcessor

* add AllowTvmVote fork

* fix stake and unstake and withdrawReward processor

* add stake unstake withdrawReward in vm and program

* add suicideFreezeBalanceAndVote

* modify contractService to singleton

* fix withdrawRewardProcessor

* add trc10 instruction

* modify address validate

* Updated readme.md for small spell fix. 

Small spell fix in readme.

* debug for stake

* modify stack pop order

* modify trc10 commit repository

* debug for stake

* modify withdrawReward

* add log for trc10

* Lite fullnode Implementation (#3031)

* TIP128: finish split&checkpoint

* TIP128: finish the transactionCache initial logic

* TIP128: finish history merge into snapshot

* TIP128: add jcommander tool

* TIP128: bugfix: multi processes copy file problem

* TIP128: bugfix and refactor some code

* TIP128: add build logic

* TIP128: finish http&GRPC filter, also fix some bugs & unit test

* TIP128: fix some bugs & unit test

* TIP128: improve unit test coverage

* TIP128: fix sonar check, redirect log output

* TIP128: bugfix, set validContractProtoThreadNum default value

* TIP128: add filter in RpcApiServiceOnSolidity

* TIP128: optimize logs output

* TIP128: merge develop, mainly for pbft

* TIP128: optimize snapshot dbs list

* TIP128: optimize snapshot dbs list

* TIP128: remove unnecessary code

* TIP128: bugfix: using copy if creating hard link failed

* bugfix: adjust the order of the http filters

* docker: update java-tron docker deploy (#3330)

* optimize redundant code

* simplify code with common functions

* rename ISWITNESS as ISSRCANDIDATE

* modify accoding to review code

* add break in WITHDRAWREWARD

* modify accoding to review code

* fix suicide vote, delete voteCapsule

* debug suicide freeze

* move freeze and vote into stakeProcessor, move unfreeze into unstake

* fix stake and unstake

* remove never used code about repository

* add proposal allow_tvm_vote and allow_tvm_asset_issue

* modify accoding to review code

* fix suicide votes, delete delegation

* modify accoding to review code

* fix suicide freeze when obtainer equal zero or black hole or owner; remove useless validate in stake

* optimize according to sonar

* Modify daily build test case

* Modify daily build test case

* Update quickstart.md (#3337)

fix some spelling issue

* Add query reward test case for daily build

* Add query reward test case for daily build

* Add retry check for event query test case

* debug suicide; debug stake

* modify allowTvmVote to allowTvmStake and modify get time function

* modify condition order

* Add retry check for event query test case

* remove dup validation

* solving the sonor problem

* add IsSRCandidateTest/RewardBalanceTest/WithdrawRewardTest

* update initAllowTvmStake

* add unit test base

* Add retry check for event query test case

* remove proposal condition

* modify get time function

* add trc10 unit test

* add trc10 unit test and unstake test

* set metrics default

* Merge branch 'develop_upstream' into feature/monitor

# Conflicts:
#	common/src/main/java/org/tron/core/Constant.java
#	framework/build.gradle
#	framework/src/main/java/org/tron/core/config/args/Args.java
#	framework/src/main/resources/config.conf

* delete test

* fix checkstyle issue

* fix checkstyle issue

* fix checkstyle issue

* update test case IsSRCandidateTest/RewardBalanceTest/WithdrawRewardTest

* stake and suicide test

* update version for proposal istanbul, stake, asset issue

* update unstake

* fix merge develop into istanbul

* modify unstake unit test

* modify trc10 unit test

* fix merge develop into istanbul

* delete COMMITTEE_ALLOW_CONTRACT_CREATION_IMPROVEMENT

* modify trc10 and unstake unit test

* modify trc10 and unstake unit test

* enable change delegation

* refine sonar

* modify stakeTest and suicideTest

* fix check style

* fix checkStyle

* fix checkStyle

* refine transaction capsule test

* fix checkstyle

* disable create2 address test

* fix checkstyle

* fix checkstyle for TRC10Test/UnStakeTest/VMContractTestBase

* modify trc10 and unstake unit test for check style

* modify for sonar check

* fix sonar for stake unstake

* feat: add some debug log

* add filter

* add log

* fix: data from snapshot is old_time first

* suicide withdrawRewardToBalance add judgement of allowTvmStake

* typo: remove log

* fix: fix test

* fix checkstyle

* fix checkstyle

* modify timestamp to ms unit

* feat: add dex pbft api

* feat: add the shielded trc20 contract api

* add testcase in withdrawreward

* fix check style

* add log to stake

* checkstyle and try catch arithmeticException

* update http&rpc filter (#3376)

update http&rpc filter for shielded transaction

* support one node start more sr

* remove the div 10

* filter the not sr miner

* fix the test case

* replease miner method

* hardfork support all in one

* add needCheckFrozeTime for unstake and withdrawReward

* refactor name for needCheckFrozenTime

* Bugfix: fix event filter

* fix sonar check

* rm useless parameter

* rm useless test

* fix name parse error

* revert SR reward (#3440)

* log context when khaosDatabase throw npe and fix a unsafe-thread issue (#3450)

Co-authored-by: Matt <Matt>

* delete ALLOW_TVM_STAKE proposal

* fix sonar

* delete ALLOW_TVM_ASSET_ISSUE proposal

* fix name parse error

* fix dataword

* fix the node start error (#3473)

* fix the node start error

* fix the code error

Co-authored-by: hellomonkey-hash <arevalojoel1@outlook.com>
Co-authored-by: wubin01 <wb_bupt@163.com>
Co-authored-by: lvs007 <zy.liang.5@163.com>
Co-authored-by: EmirateGo <68578678+EmirateGo@users.noreply.github.com>
Co-authored-by: zk19862018 <39797046+zk19862018@users.noreply.github.com>
Co-authored-by: wangming <wm18840987261@163.com>
Co-authored-by: wenpinghou <skipjack8@live.com>
Co-authored-by: taihaofu <taihao.fu@gmail.com>
Co-authored-by: sean-liu55 <liushaohua9017@163.com>
Co-authored-by: Wenhua Zhang <zhangwenhua@tron.network>
Co-authored-by: Heng Zhang <zhangheng1536@gmail.com>
Co-authored-by: TracyHesiCecil <wenshuli9@163.com>
Co-authored-by: niuniublockchain <ruu7245153122@163.com>
Co-authored-by: chengtx01 <56535423+chengtx01@users.noreply.github.com>
Co-authored-by: jason.jiang <jason.jiang@tron.network>
Co-authored-by: neo hong <neo.hong@tron.network>
Co-authored-by: Timothy <57668523+timothyckw@users.noreply.github.com>
Co-authored-by: xiangdepeng <xiangdepeng@outlook.com>
Co-authored-by: Hei-jialun <69344879+Hei-jialun@users.noreply.github.com>
Co-authored-by: Benson0224 <61768920+Benson0224@users.noreply.github.com>
Co-authored-by: kaiserlinda <kaiserlinda@163.com>
Co-authored-by: paoerpaul <paoerpaul@163.com>
Co-authored-by: pangpangfeng <7577288@qq.com>
Co-authored-by: cest-bon-bon <69616584+cest-bon-bon@users.noreply.github.com>
Co-authored-by: wangzichichi <39043115+wangzichichi@users.noreply.github.com>
Co-authored-by: DisneyFairiesFly <DisneyFairiesFly@163.com>
Co-authored-by: chengtx01 <860712txcTXC>
Co-authored-by: timothyckw <timothychungkitwai@gmail.com>
Co-authored-by: 洪德祥 <1090664234@qq.com>
Co-authored-by: federico.zhen <federico.zhen@tron.network>
Co-authored-by: wayne.zhang <43207186+zhangwenhua-tron@users.noreply.github.com>
Co-authored-by: Matt <Matt>
Co-authored-by: yhrzpm <yrp1990@gmail.com>
Co-authored-by: renchenchang <dzhrcc@gmail.com>
Co-authored-by: renchengchang <37399454+renchenchang@users.noreply.github.com>
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.

None yet

4 participants