Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
6b92f6d
feat(freezeV2): optimize unfreezeV2 processor
Oct 25, 2022
5401b67
Merge pull request #4730 from yanghang8612/feature/opt_new_tvm_freeze
yanghang8612 Oct 25, 2022
66ebc6b
feat(freezeV2): optimize freezeV2
Oct 25, 2022
9be79ab
feat(freezeV2): optimize account usage calculation
kongchi-ken Oct 25, 2022
20b3262
feat(freezeV2): optimize freezeV2
Oct 25, 2022
fee4413
Merge remote-tracking branch 'yanghang/feature/opt_new_tvm_freeze' in…
Oct 25, 2022
e78d596
feat(freezeV2): optimize freezeV2
Oct 25, 2022
85f5d10
feat(freezeV2): optimize freezeV2
Oct 25, 2022
dd5c8a3
Merge pull request #4732 from yanghang8612/feature/opt_new_tvm_freeze
yanghang8612 Oct 25, 2022
453f055
feat(freezeV2): optimize freezeV2 usage
Oct 26, 2022
5059dc5
Merge pull request #4736 from yanghang8612/feature/opt_new_tvm_freeze
yanghang8612 Oct 27, 2022
840646d
feat(freezeV2): optimize freezeV2 usage and windowsize
Oct 27, 2022
d6f40cd
feat(freezeV2): optimize origin and caller energy usage calculation
kongchi-ken Oct 27, 2022
ce0269b
chore(tvm,freezeV2): adjust delegate related logs
yanghang8612 Oct 28, 2022
1673847
fix(freezeV2): upgrade freezeV2
lxcmyf Oct 27, 2022
3a0864f
Merge pull request #4743 from lxcmyf/release_v4.6.0
zhang0125 Oct 28, 2022
2b8c772
Merge remote-tracking branch 'origin/release_v4.6.0' into feature/opt…
Oct 28, 2022
613cd1b
fix(tvm,freezeV2): do not set origin if caller == origin
yanghang8612 Oct 28, 2022
1c9e5f7
Merge remote-tracking branch 'yanghang/feature/opt_new_tvm_freeze' in…
Oct 28, 2022
8177eb3
feat(freezeV2): merge release
Oct 28, 2022
70d91c5
feat(freezeV2): merge release
Oct 28, 2022
3ec3d70
Merge remote-tracking branch 'yanghang/feature/opt_new_tvm_freeze' in…
Oct 28, 2022
897a24b
feat(freezeV2): optimize undelegate usage precision
Oct 28, 2022
bb98ec7
feat(freezeV2): optimize vmactuator energy consume time
Oct 28, 2022
da581e3
Merge pull request #4739 from yanghang8612/feature/opt_new_tvm_freeze
yanghang8612 Oct 28, 2022
24f141b
feat(freezeV2): optimize unfreeze vote
zhang0125 Oct 26, 2022
79a190a
Merge pull request #4741 from tronprotocol/feature/unfreeze_vote
zhang0125 Oct 29, 2022
1467ce7
feat(freezeV2): optimize unfreezeV2 votes update
Oct 31, 2022
8ff83b0
fix(freezeV2): fix freezeV2
lxcmyf Oct 31, 2022
da4d0dc
Merge pull request #4748 from lxcmyf/release_v4.6.0
zhang0125 Oct 31, 2022
4efc272
feat(freezeV2): optimize add all votes
Oct 31, 2022
710d33f
Merge remote-tracking branch 'origin/release_v4.6.0' into feature/new…
CodeNinjaEvan Oct 31, 2022
07ddb25
feat(freezeV2): set latest consume time
Oct 31, 2022
431c547
feat(freezeV2): optimize code format
Oct 31, 2022
9b3820e
Merge pull request #4750 from yanghang8612/feature/new_tvm_unfreeze_vote
yanghang8612 Oct 31, 2022
719f8b7
fix(tvm,freezeV2): do not set merged state for caller & deployer if t…
yanghang8612 Oct 31, 2022
db9210a
Merge pull request #4754 from yanghang8612/feature/opt_new_tvm_freeze
CodeNinjaEvan Nov 1, 2022
6ba9741
feat(freezeV2): new stake, add 3 interfaces
Nov 2, 2022
aea4724
Merge pull request #4761 from chaosuper12321/feature/stake_2.0
halibobo1205 Nov 2, 2022
fb6ee30
feat(freezeV2): new stake, add 1 interfaces
Nov 8, 2022
1f9e542
Merge pull request #4774 from chaosuper12321/feature/stake_2.0
zhang0125 Nov 9, 2022
4afd4c5
feat(freezeV2): add query api to get delegate max resource size
Nov 14, 2022
27cc33b
feat(net): tron system integrates libp2p module
xxo1shine Oct 27, 2022
c19da8d
Merge branch 'release_4.6.0' of https://github.com/tronprotocol/java-…
xxo1shine Nov 15, 2022
27ca245
feat(net): optimize p2p service shutdown logic
xxo1shine Nov 15, 2022
e91d78e
Merge pull request #4790 from chaosuper12321/feature/stake_2.0
zhang0125 Nov 15, 2022
ce4f290
feat(net): update p2p version to v0.1.4
xxo1shine Nov 15, 2022
6825412
feat(net): solve sonar problems
xxo1shine Nov 15, 2022
736a518
feat(net): remove unused code
xxo1shine Nov 15, 2022
4353450
modify the network parameter initialization value
xxo1shine Nov 16, 2022
84849b4
fix(freezeV2): sort frozenV2 list for getaccount interface
lxcmyf Nov 16, 2022
07df363
Merge pull request #4795 from lxcmyf/feature/stake_2.0
zhang0125 Nov 16, 2022
43159ca
Merge pull request #4791 from wubin01/p2p-integrated
xxo1shine Nov 17, 2022
62e9c1a
feat(freezeV2): Add bandwidth cost for delegating validation
Nov 17, 2022
48aa0ed
Merge pull request #4796 from chaosuper12321/feature/stake_2.0
zhang0125 Nov 18, 2022
429f433
fix(freezeV2): optimize stake2.0 code
lxcmyf Nov 18, 2022
9f9780d
feat(net): optimize the logic of generating hello message
xxo1shine Nov 21, 2022
a78c2bd
Merge pull request #4799 from wubin01/p2p-integrated
xxo1shine Nov 21, 2022
039c95c
Merge pull request #4802 from tronprotocol/master
lvs007 Nov 21, 2022
4ad5f0e
feat(net): modify hello message toString function
xxo1shine Nov 21, 2022
7bc6890
Merge pull request #4803 from wubin01/p2p-integrated
xxo1shine Nov 21, 2022
8ebf593
feat(net): enable the message forwarding function
xxo1shine Nov 22, 2022
4ed36a6
Merge pull request #4806 from wubin01/p2p-integrated
xxo1shine Nov 22, 2022
9b20432
Merge remote-tracking branch 'origin/release_4.6.0' into feature/stak…
lxcmyf Nov 22, 2022
3dd7415
Merge remote-tracking branch 'origin/release_4.6.0' into feature/stak…
lxcmyf Nov 22, 2022
d3d53d9
fix(net): solve p2p configuration initialization problem
xxo1shine Nov 22, 2022
f08a482
Merge pull request #4807 from wubin01/p2p-integrated
xxo1shine Nov 22, 2022
7c8fc3b
fix(net): solve p2p configuration initialization problem
xxo1shine Nov 22, 2022
874b8d2
Merge pull request #4808 from wubin01/p2p-integrated
xxo1shine Nov 22, 2022
eff6cda
Merge pull request #4798 from lxcmyf/feature/stake_2.0
zhang0125 Nov 22, 2022
4d07ef9
fix(git): fix build failure issue
zhang0125 Nov 16, 2022
d10cd1f
Merge pull request #4809 from tronprotocol/fix/git-properties
zhang0125 Nov 22, 2022
0d39815
fix(db): the operation of putting byte[0] should be reserved instead …
tomatoishealthy Nov 23, 2022
aee8665
fix(db): the operation of putting byte[0] should be reserved instead …
tomatoishealthy Nov 23, 2022
82c40b4
Merge pull request #4812 from guoquanwu/fix/db-recover-wrong-deletion…
tomatoishealthy Nov 23, 2022
217469d
feat(block): improve performance for transaction packing
halibobo1205 Nov 1, 2022
74ec816
feat(db): improve performance for db query
halibobo1205 Nov 1, 2022
5758b66
feat(db): improve performance for getting transaction hash
halibobo1205 Nov 15, 2022
8d0deec
Merge pull request #4669 from halibobo1205/fix/db_iterator
halibobo1205 Nov 30, 2022
31bb4d4
fix(db): remove trans-cache from checkpoint
zhang0125 Nov 23, 2022
b3f5fa9
fix(net): introduce a new libp2p dependency to fix the logging issue
jwrct Nov 30, 2022
4b7cb72
Merge pull request #4821 from chengtx01/libp2p_integrate
jwrct Nov 30, 2022
e54c324
Merge pull request #4740 from halibobo1205/feat/second_cache
halibobo1205 Nov 30, 2022
5c4e491
Merge pull request #4756 from halibobo1205/feat/pack_trx_opt
halibobo1205 Nov 30, 2022
b421d0b
Merge pull request #4792 from halibobo1205/feat/trx_hash_get_opt
halibobo1205 Nov 30, 2022
8f78620
Merge pull request #4815 from tronprotocol/fix/cache_store
zhang0125 Dec 1, 2022
0821f2e
feat(freezeV2): optimize delegate index
zhang0125 Nov 23, 2022
684ff4e
Merge pull request #4814 from tronprotocol/feature/optimize_delegate_…
zhang0125 Dec 1, 2022
241f947
fix(freezeV2): fix deflation or expansion problems caused by precision
lxcmyf Nov 23, 2022
e751a26
fix(freezeV2): deduct resource of old freezing first
lxcmyf Nov 23, 2022
1d80094
Merge pull request #4823 from lxcmyf/feature/stake_2.0
zhang0125 Dec 1, 2022
ab59a13
feat(freezeV2): add a lock option for delegate
zhang0125 Nov 15, 2022
0b5dec1
fix(freezeV2): add unit test for locked delegate
lxcmyf Dec 1, 2022
a0edb2e
feat(gradle): update dependency
forfreeday Dec 6, 2022
adc6b6b
Merge pull request #4828 from forfreeday/feature/update_gradle
forfreeday Dec 7, 2022
1ab528f
fix(freezeV2): optimize reviewed code
lxcmyf Dec 7, 2022
4f6c1c2
feat(freezeV2): optimize delegate resource storage
zhang0125 Dec 7, 2022
7bc7c9a
Merge remote-tracking branch 'origin/feature/delegate_lock' into feat…
lxcmyf Dec 8, 2022
fd35876
Merge remote-tracking branch 'origin/release_v4.7.0' into feature/sta…
lxcmyf Dec 8, 2022
415f229
Merge pull request #4832 from tronprotocol/feature/libp2p_integrate
xxo1shine Dec 12, 2022
4159b3a
feat(toolkit): add db conversion and data splitting extensions
halibobo1205 Nov 23, 2022
9c897cd
Merge pull request #4813 from halibobo1205/feat/toolkit
halibobo1205 Dec 12, 2022
4f9a7e9
feat(db): print db internal log
Nov 9, 2022
2898d48
refactor(db): remove useless revokingDB
Oct 17, 2022
e1d4cfd
refactor(db): optimize db lock
Oct 20, 2022
bff517d
feat(db): make snapshot flush speed configurable
Nov 2, 2022
77ab2bb
Merge remote-tracking branch 'origin/release_v4.7.0' into release_v4.7.0
lxcmyf Dec 13, 2022
2fe10e3
Merge pull request #4838 from lxcmyf/release_v4.7.0
zhang0125 Dec 13, 2022
7f925a0
docs(toolkit): optimize readme
halibobo1205 Dec 12, 2022
0705f24
Merge pull request #4836 from lurais/feature/rm_useless_revokingDB
halibobo1205 Dec 13, 2022
0d65eed
Merge pull request #4835 from lurais/feature/refactor_underlying_db_i…
halibobo1205 Dec 13, 2022
61ab5e7
Merge pull request #4834 from lurais/feature/configure_flush_batch_size
halibobo1205 Dec 13, 2022
4f6966a
Merge pull request #4833 from lurais/feature/print_leveldb_log
halibobo1205 Dec 13, 2022
7628510
fix(test): relieve JVM heap stress
halibobo1205 Dec 13, 2022
bd355cd
Merge pull request #4839 from halibobo1205/doc/toolkit_readme
halibobo1205 Dec 13, 2022
59ecf54
Merge pull request #4837 from halibobo1205/fix/thread_release
zhang0125 Dec 13, 2022
de45d6c
feat(version): change the block version
zhang0125 Dec 14, 2022
8029087
Merge pull request #4844 from tronprotocol/feature/version
zhang0125 Dec 14, 2022
2613092
feat(net): turn off log printing of transaction message
xxo1shine Dec 15, 2022
bee323a
Merge pull request #4848 from wubin01/log_optmize
xxo1shine Dec 15, 2022
22f8a7e
feat(db): optimize the default snapshot flush speed
Dec 16, 2022
1cb32fc
feat(toolkit): add db copy
halibobo1205 Dec 15, 2022
5ac8f53
fix(tvm,stakeV2): origin can not exist because of create* opcode and …
yanghang8612 Dec 19, 2022
a8c4def
Merge pull request #4849 from halibobo1205/feat/toolkit
halibobo1205 Dec 19, 2022
0dd1942
Merge pull request #4851 from lurais/feature/configure_flush_batch_size
halibobo1205 Dec 19, 2022
8274b7b
OTW
Dec 19, 2022
f3f0ae1
fix(db): fix exceptional for auto-stop
halibobo1205 Dec 19, 2022
d4ff6c2
feat(net): optimize network module close logic
xxo1shine Dec 19, 2022
da32da7
Merge pull request #4853 from halibobo1205/fix/auto_stop
halibobo1205 Dec 19, 2022
eb0065c
Merge pull request #4854 from wubin01/net
xxo1shine Dec 20, 2022
4014bf4
feat(freezeV2): merge stake 2.0 new features
Dec 20, 2022
846864c
feat(db): optimize the auto-stop logic
halibobo1205 Dec 20, 2022
1337d45
Merge pull request #4858 from halibobo1205/feat/auto_stop_opt
halibobo1205 Dec 20, 2022
5ddaa45
feat(freezeV2): merge stake 2.0 new features
Dec 20, 2022
6ada8a9
Merge remote-tracking branch 'yanghang/feature/tvm_stake_2.0' into fe…
Dec 21, 2022
8befb76
feat(freezeV2): merge stake 2.0 new features
Dec 21, 2022
9ad5bfd
feat(freezeV2): merge stake 2.0 new features
Dec 21, 2022
f99e9a6
feat(freezeV2): delegate resource account index cache
Dec 21, 2022
56242e9
feat(freezeV2): add tests
Dec 21, 2022
716ab53
func(proposal,chainid): optimize the return value of chainid
yanghang8612 Dec 21, 2022
0e58daf
Merge pull request #4863 from tronprotocol/feature/opimize_chainid
yanghang8612 Dec 22, 2022
a2d57d9
feat(freezeV2): remove unfreeze amount from transaction detail
zhang0125 Dec 23, 2022
0725866
func(inter-tx): add a new switch config to indicate if save featured …
yanghang8612 Dec 25, 2022
3ec907b
add stake2.0 new interfaces to rpc api on solidity
Dec 20, 2022
c3c896d
Merge pull request #4869 from tronprotocol/feature/optimize_unfreeze_v2
zhang0125 Dec 26, 2022
1c1ccf0
style: fix check style
yanghang8612 Dec 26, 2022
94f8426
feat(docker): update Dockerfile
forfreeday Dec 26, 2022
e2f0218
Merge pull request #4876 from forfreeday/feature/update_dockerfile
forfreeday Dec 26, 2022
0951832
Merge pull request #4857 from chaosuper12321/release_v4.7.0
zhang0125 Dec 27, 2022
5d9b2fb
feat(freezeV2): fix freezeV2 precompiled contracts
Dec 27, 2022
c1b6783
feat(freezeV2): add lock size in estimateConsumeBandWidthSize function
Dec 27, 2022
504db6b
Merge pull request #4879 from chaosuper12321/release_v4.7.0
zhang0125 Dec 27, 2022
3cfd401
Merge remote-tracking branch 'origin/release_v4.7.0' into feature/tvm…
Dec 27, 2022
86efac0
feat(DynamicEnergy): add proposals and parameters
kongchi-ken Dec 7, 2022
2c899fa
feat(DynamicEnergy): add calculations for DynamicEnergy
kongchi-ken Dec 20, 2022
17d11ee
feat(DynamicEnergy): add test for DynamicEnergy cycle updates
kongchi-ken Dec 20, 2022
d22df33
feat(DynamicEnergy): optimize ContractState storage
kongchi-ken Dec 21, 2022
6a43e10
feat(DynamicEnergy): optimize Program contextContractState update and…
kongchi-ken Dec 22, 2022
5a0696e
feat(DynamicEnergy): optimize proposal parameters and energy calculation
kongchi-ken Dec 22, 2022
01c25f3
feat(DynamicEnergy): optimize for review comments
kongchi-ken Dec 23, 2022
4145e58
feat(DynamicEnergy): add API for Dynamic Energy and optimize Contract…
kongchi-ken Dec 23, 2022
17bce84
feat(DynamicEnergy): optimize Dynamic Energy ContractState API
kongchi-ken Dec 23, 2022
a6fd14b
feat(estimateEnergy): add estimate energy API
kongchi-ken Dec 25, 2022
3d41f13
feat(estimateEnergy): use fee limit in tx to calc energy limit for co…
yanghang8612 Dec 25, 2022
f0f781f
feat(estimateEnergy): restrict max energy limit to setting in config
yanghang8612 Dec 25, 2022
d5aa3ed
feat(estimateEnergy): set real energy required, not fee limit
yanghang8612 Dec 25, 2022
e4fac13
feat(estimateEnergy): add estimate energy for solidity service
yanghang8612 Dec 25, 2022
ca15e63
feat(estimateEnergy): optimize the switch
yanghang8612 Dec 25, 2022
8364569
feat(DynamicEnergy): fix operations test
Dec 26, 2022
e80cc29
style: fix check style
yanghang8612 Dec 26, 2022
2cc467a
feat(DynamicEnergy): drop trigger_base parameter
yanghang8612 Dec 26, 2022
2c80b9d
feat(DynamicEnergy): optimize program result add energy_origin and en…
kongchi-ken Dec 26, 2022
92892a7
feat(DynamicEnergy): change factor decimal and limit it up to 100%
yanghang8612 Dec 27, 2022
0d76f95
feat(DynamicEnergy): optimize estimate energy response
kongchi-ken Dec 27, 2022
cd77191
feat(DynamicEnergy): optimize dynamic energy penalty in receipts
kongchi-ken Dec 27, 2022
849517e
fix(unit-test): catch up method test
yanghang8612 Dec 27, 2022
64fc6ed
feat(DynamicEnergy): optimize call energy penalty logic
kongchi-ken Dec 27, 2022
aee2411
feat(DynamicEnergy): optimize penalty calculation and Program result
kongchi-ken Dec 27, 2022
6577ddf
feat(DynamicEnergy): change the meanings of max factor and energy factor
yanghang8612 Dec 27, 2022
fa63529
feat(DynamicEnergy): rename decimal to precision factor
yanghang8612 Dec 27, 2022
c5e2b74
feat(DynamicEnergy): optimize estimate energy parameter path
kongchi-ken Dec 27, 2022
b7e29c8
feat(DynamicEnergy): fix energy usage not added bug
kongchi-ken Dec 27, 2022
7323171
feat(DynamicEnergy): optimize reset contract state factor
kongchi-ken Dec 27, 2022
f92cb38
feat(freezeV2): optimize total delegated resource
Dec 27, 2022
54bc129
style(json-rpc): optimize code
yanghang8612 Dec 28, 2022
3d3ffec
feat(DynamicEnergy): revert config-localtest changes
kongchi-ken Dec 28, 2022
ffa65ef
Merge pull request #4872 from yanghang8612/feature/tvm_stake_2.0
yanghang8612 Dec 28, 2022
789bfa4
Merge branch 'release_v4.7.0' into feature/tvm_dynamic_energy
yanghang8612 Dec 28, 2022
ec6f6c7
style(rpc): fix code smell
yanghang8612 Dec 28, 2022
3960853
Merge pull request #4873 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Dec 28, 2022
a053aad
feat(*): update jar repository
halibobo1205 Dec 27, 2022
fcf38d2
Merge pull request #4877 from halibobo1205/feat/dependency
halibobo1205 Dec 28, 2022
8585044
feat(DynamicEnergy): optimize ContractState threshold compare logic
kongchi-ken Dec 28, 2022
f349988
feat(DynamicEnergy): add estimate energy api on PBFT
kongchi-ken Dec 28, 2022
be2ce70
feat(DynamicEnergy): optimize VMConfig add DynamicEnergy committee pa…
kongchi-ken Dec 28, 2022
c005095
fix(freezeV2): refine resource usage recovery logic
lxcmyf Dec 28, 2022
fd76410
style(receipt): fix check style
yanghang8612 Dec 29, 2022
6a9c0e2
Merge pull request #4883 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Dec 29, 2022
72b075f
feat(DynamicEnergy): optimize the return result of estimate energy
kongchi-ken Dec 29, 2022
9300c4a
Merge pull request #4882 from lxcmyf/release_v4.7.0
zhang0125 Dec 29, 2022
eec8dd2
Merge branch 'release_v4.7.0' into feature/tvm_dynamic_energy
kongchi-ken Dec 29, 2022
d088370
Merge pull request #4884 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Dec 30, 2022
60e004e
feat(tvm_stake2.0): optimize delegatableResource calculate logic
kongchi-ken Dec 30, 2022
3bdf9dc
feat(tvm_stake2.0): fix the test cases for precompiled contract deleg…
kongchi-ken Dec 30, 2022
7c48dd7
chore(receipt): add some comments
yanghang8612 Dec 30, 2022
fc02846
Merge remote-tracking branch 'yang/feature/tvm_stake_2.0' into featur…
yanghang8612 Dec 30, 2022
660ab2b
style(receipt): fix code smell
yanghang8612 Dec 30, 2022
26b6889
Merge pull request #4885 from yanghang8612/feature/tvm_stake_2.0
CodeNinjaEvan Dec 30, 2022
02e8827
feat(DynamicEnergy): optimize call energy usage calculation and estim…
kongchi-ken Jan 2, 2023
5a0bcad
feat(DynamicEnergy): add proposal dependency
yanghang8612 Jan 2, 2023
783b058
feat(tvm): optimize total weight
Jan 2, 2023
635584a
Merge pull request #4887 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Jan 2, 2023
cacf53d
chore(prompt): add missing word for estimate energy switch
yanghang8612 Jan 3, 2023
1a001d7
chore(prompt): optimize the tip when estimate is on & constant is off
yanghang8612 Jan 3, 2023
918d3dd
feat(DynamicEnergy): add solidity and pbft estimateEnergy grpc api
kongchi-ken Jan 3, 2023
26ad990
Merge pull request #4888 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Jan 3, 2023
8298794
feat(DynamicEnergy): optimize program result penalty merge
kongchi-ken Jan 3, 2023
ceb3aef
chore(comment): remove fix me cause we have confirmed it needed
yanghang8612 Jan 3, 2023
0dfe97d
feat(net):optimize peer connect log
xxo1shine Jan 3, 2023
1536fdf
Merge pull request #4890 from wubin01/peer_log
xxo1shine Jan 3, 2023
772ede8
Merge pull request #4889 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Jan 3, 2023
8fbc7ef
feat(stake2.0): withdraw reward first
yanghang8612 Jan 3, 2023
f17cab4
Merge pull request #4891 from yanghang8612/feature/tvm_stake_2.0
yanghang8612 Jan 3, 2023
79c5e57
feat(db): optimize internal db log print
Dec 21, 2022
fb8b872
fix(freezeV2): optimize the accuracy of usage
lxcmyf Jan 4, 2023
0a94891
Merge pull request #4861 from lurais/feature/print_leveldb_log
halibobo1205 Jan 4, 2023
3eaa998
fix(block): fix block size estimation during block production
halibobo1205 Jan 4, 2023
8f57f4a
Merge pull request #4893 from tronprotocol/fix/compute_block_size
halibobo1205 Jan 4, 2023
edda4b2
feat(EstimateEnergy): optimize estimate search algorithm and add retry
kongchi-ken Jan 4, 2023
d10caae
feat(EstimateEnergy): optimize estimate energy search
kongchi-ken Jan 5, 2023
59aadbd
feat(EstimateEnergy): optimize the estimate energy search and add res…
kongchi-ken Jan 5, 2023
abedf53
feat(EstimateEnergy): refactor estimate energy function
kongchi-ken Jan 5, 2023
86bebba
feat(EstimateEnergy): refactor estimate energy function
kongchi-ken Jan 5, 2023
2d7bce1
Merge pull request #4895 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Jan 5, 2023
e78e908
Merge pull request #4892 from lxcmyf/release_v4.7.0
zhang0125 Jan 5, 2023
c4667da
fix(suicide): reset old tron power when suicide
yanghang8612 Jan 5, 2023
cc8d125
Merge pull request #4899 from yanghang8612/feature/tvm_stake_2.0
yanghang8612 Jan 6, 2023
370a86b
fix(resource): fix resource usage issue
zhang0125 Jan 6, 2023
bcf8cf7
Merge pull request #4900 from tronprotocol/ftx/resource_usage
zhang0125 Jan 6, 2023
35cc42f
fix(DynamicEnergy): fix eth_estimateGas index out of range
kongchi-ken Jan 7, 2023
0d68fa6
Merge pull request #4901 from yanghang8612/feature/tvm_dynamic_energy
yanghang8612 Jan 7, 2023
5a50ee6
feat(net): modify the default value of server ip
xxo1shine Jan 10, 2023
1dc0c28
Merge pull request #4905 from wubin01/server_ip
xxo1shine Jan 10, 2023
7c745c9
feat(shell): update start.sh
forfreeday Jan 12, 2023
3ae525c
feat(shell): update start.sh
forfreeday Jan 12, 2023
8332b8f
Merge pull request #4909 from forfreeday/feature/update_start.sh
forfreeday Jan 12, 2023
0d941a9
feat(shell): update start.sh
forfreeday Jan 12, 2023
56f042e
Merge pull request #4911 from forfreeday/feature/update_start.sh
forfreeday Jan 13, 2023
0cc1731
feat(net): optimize network connection parameters
xxo1shine Jan 13, 2023
ca436f1
Merge pull request #4912 from wubin01/net_parameter
xxo1shine Jan 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ shareddata.*

# protobuf generated classes
src/main/gen

src/main/java/org/tron/core/bftconsensus
src/test/java/org/tron/consensus2
src/main/java/META-INF/
Expand Down
14 changes: 14 additions & 0 deletions Tron protobuf protocol document.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,13 @@ Transaction and transaction-related messages.
ClearABIContract = 48;
UpdateBrokerageContract = 49;
ShieldedTransferContract = 51;
MarketSellAssetContract = 52;
MarketCancelOrderContract = 53;
FreezeBalanceV2Contract = 54;
UnfreezeBalanceV2Contract = 55;
WithdrawExpireUnfreezeContract = 56;
DelegateResourceContract = 57;
UnDelegateResourceContract = 58;
}
ContractType type = 1;
google.protobuf.Any parameter = 2;
Expand Down Expand Up @@ -873,6 +880,13 @@ Contract and contract-related messages.
ClearABIContract = 48;
UpdateBrokerageContract = 49;
ShieldedTransferContract = 51;
MarketSellAssetContract = 52;
MarketCancelOrderContract = 53;
FreezeBalanceV2Contract = 54;
UnfreezeBalanceV2Contract = 55;
WithdrawExpireUnfreezeContract = 56;
DelegateResourceContract = 57;
UnDelegateResourceContract = 58;
}
ContractType type = 1;
google.protobuf.Any parameter = 2;
Expand Down
1 change: 0 additions & 1 deletion actuator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies {

compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69'
compile 'com.github.tronprotocol:zksnark-java-sdk:master-SNAPSHOT'
compile group: 'commons-codec', name: 'commons-codec', version: '1.11'
compile 'org.reflections:reflections:0.9.11'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
package org.tron.core.actuator;

import static org.tron.core.actuator.ActuatorConstant.NOT_EXIST_STR;
import static org.tron.core.config.Parameter.ChainConstant.DELEGATE_PERIOD;
import static org.tron.core.config.Parameter.ChainConstant.TRX_PRECISION;

import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import java.util.Arrays;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.tron.common.utils.DecodeUtil;
import org.tron.common.utils.StringUtil;
import org.tron.core.capsule.AccountCapsule;
import org.tron.core.capsule.DelegatedResourceCapsule;
import org.tron.core.capsule.TransactionResultCapsule;
import org.tron.core.db.BandwidthProcessor;
import org.tron.core.db.EnergyProcessor;
import org.tron.core.exception.ContractExeException;
import org.tron.core.exception.ContractValidateException;
import org.tron.core.store.AccountStore;
import org.tron.core.store.DelegatedResourceAccountIndexStore;
import org.tron.core.store.DelegatedResourceStore;
import org.tron.core.store.DynamicPropertiesStore;
import org.tron.core.utils.TransactionUtil;
import org.tron.protos.Protocol.AccountType;
import org.tron.protos.Protocol.Transaction.Contract.ContractType;
import org.tron.protos.Protocol.Transaction.Result.code;
import org.tron.protos.contract.BalanceContract.DelegateResourceContract;

@Slf4j(topic = "actuator")
public class DelegateResourceActuator extends AbstractActuator {

public DelegateResourceActuator() {
super(ContractType.DelegateResourceContract, DelegateResourceContract.class);
}

@Override
public boolean execute(Object result) throws ContractExeException {
TransactionResultCapsule ret = (TransactionResultCapsule) result;
if (Objects.isNull(ret)) {
throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);
}

long fee = calcFee();
final DelegateResourceContract delegateResourceContract;
AccountStore accountStore = chainBaseManager.getAccountStore();
try {
delegateResourceContract = any.unpack(DelegateResourceContract.class);
} catch (InvalidProtocolBufferException e) {
logger.debug(e.getMessage(), e);
ret.setStatus(fee, code.FAILED);
throw new ContractExeException(e.getMessage());
}

AccountCapsule ownerCapsule = accountStore
.get(delegateResourceContract.getOwnerAddress().toByteArray());

long delegateBalance = delegateResourceContract.getBalance();
boolean lock = delegateResourceContract.getLock();
byte[] ownerAddress = delegateResourceContract.getOwnerAddress().toByteArray();
byte[] receiverAddress = delegateResourceContract.getReceiverAddress().toByteArray();

// delegate resource to receiver
switch (delegateResourceContract.getResource()) {
case BANDWIDTH:
delegateResource(ownerAddress, receiverAddress, true,
delegateBalance, lock);

ownerCapsule.addDelegatedFrozenV2BalanceForBandwidth(delegateBalance);
ownerCapsule.addFrozenBalanceForBandwidthV2(-delegateBalance);
break;
case ENERGY:
delegateResource(ownerAddress, receiverAddress, false,
delegateBalance, lock);

ownerCapsule.addDelegatedFrozenV2BalanceForEnergy(delegateBalance);
ownerCapsule.addFrozenBalanceForEnergyV2(-delegateBalance);
break;
default:
logger.debug("Resource Code Error.");
}

accountStore.put(ownerCapsule.createDbKey(), ownerCapsule);

ret.setStatus(fee, code.SUCESS);

return true;
}


@Override
public boolean validate() throws ContractValidateException {
if (this.any == null) {
throw new ContractValidateException(ActuatorConstant.CONTRACT_NOT_EXIST);
}
if (chainBaseManager == null) {
throw new ContractValidateException(ActuatorConstant.STORE_NOT_EXIST);
}
AccountStore accountStore = chainBaseManager.getAccountStore();
DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();
if (!any.is(DelegateResourceContract.class)) {
throw new ContractValidateException(
"contract type error,expected type [DelegateResourceContract],real type["
+ any.getClass() + "]");
}

if (!dynamicStore.supportDR()) {
throw new ContractValidateException("No support for resource delegate");
}

if (!dynamicStore.supportUnfreezeDelay()) {
throw new ContractValidateException("Not support Delegate resource transaction,"
+ " need to be opened by the committee");
}

final DelegateResourceContract delegateResourceContract;
try {
delegateResourceContract = this.any.unpack(DelegateResourceContract.class);
} catch (InvalidProtocolBufferException e) {
logger.debug(e.getMessage(), e);
throw new ContractValidateException(e.getMessage());
}
byte[] ownerAddress = delegateResourceContract.getOwnerAddress().toByteArray();
if (!DecodeUtil.addressValid(ownerAddress)) {
throw new ContractValidateException("Invalid address");
}

AccountCapsule ownerCapsule = accountStore.get(ownerAddress);
if (ownerCapsule == null) {
String readableOwnerAddress = StringUtil.createReadableString(ownerAddress);
throw new ContractValidateException(
ActuatorConstant.ACCOUNT_EXCEPTION_STR + readableOwnerAddress + NOT_EXIST_STR);
}

long delegateBalance = delegateResourceContract.getBalance();
if (delegateBalance < TRX_PRECISION) {
throw new ContractValidateException("delegateBalance must be more than 1TRX");
}

switch (delegateResourceContract.getResource()) {
case BANDWIDTH: {
BandwidthProcessor processor = new BandwidthProcessor(chainBaseManager);
processor.updateUsageForDelegated(ownerCapsule);

long accountNetUsage = ownerCapsule.getNetUsage();
if (null != this.getTx() && this.getTx().isTransactionCreate()) {
accountNetUsage += TransactionUtil.estimateConsumeBandWidthSize(ownerCapsule,
chainBaseManager);
}
long netUsage = (long) (accountNetUsage * TRX_PRECISION * ((double)
(dynamicStore.getTotalNetWeight()) / dynamicStore.getTotalNetLimit()));

long remainNetUsage = netUsage
- ownerCapsule.getFrozenBalance()
- ownerCapsule.getAcquiredDelegatedFrozenBalanceForBandwidth()
- ownerCapsule.getAcquiredDelegatedFrozenV2BalanceForBandwidth();

remainNetUsage = Math.max(0, remainNetUsage);

if (ownerCapsule.getFrozenV2BalanceForBandwidth() - remainNetUsage < delegateBalance) {
throw new ContractValidateException(
"delegateBalance must be less than available FreezeBandwidthV2 balance");
}
}
break;
case ENERGY: {
EnergyProcessor processor = new EnergyProcessor(dynamicStore, accountStore);
processor.updateUsage(ownerCapsule);

long energyUsage = (long) (ownerCapsule.getEnergyUsage() * TRX_PRECISION * ((double)
(dynamicStore.getTotalEnergyWeight()) / dynamicStore.getTotalEnergyCurrentLimit()));

long remainEnergyUsage = energyUsage
- ownerCapsule.getEnergyFrozenBalance()
- ownerCapsule.getAcquiredDelegatedFrozenBalanceForEnergy()
- ownerCapsule.getAcquiredDelegatedFrozenV2BalanceForEnergy();

remainEnergyUsage = Math.max(0, remainEnergyUsage);

if (ownerCapsule.getFrozenV2BalanceForEnergy() - remainEnergyUsage < delegateBalance) {
throw new ContractValidateException(
"delegateBalance must be less than available FreezeEnergyV2 balance");
}
}
break;
default:
throw new ContractValidateException(
"ResourceCode error, valid ResourceCode[BANDWIDTH、ENERGY]");
}

byte[] receiverAddress = delegateResourceContract.getReceiverAddress().toByteArray();

if (ArrayUtils.isEmpty(receiverAddress) || !DecodeUtil.addressValid(receiverAddress)) {
throw new ContractValidateException("Invalid receiverAddress");
}


if (Arrays.equals(receiverAddress, ownerAddress)) {
throw new ContractValidateException(
"receiverAddress must not be the same as ownerAddress");
}

AccountCapsule receiverCapsule = accountStore.get(receiverAddress);
if (receiverCapsule == null) {
String readableOwnerAddress = StringUtil.createReadableString(receiverAddress);
throw new ContractValidateException(
ActuatorConstant.ACCOUNT_EXCEPTION_STR
+ readableOwnerAddress + NOT_EXIST_STR);
}

if (receiverCapsule.getType() == AccountType.Contract) {
throw new ContractValidateException(
"Do not allow delegate resources to contract addresses");
}

return true;
}

@Override
public ByteString getOwnerAddress() throws InvalidProtocolBufferException {
return any.unpack(DelegateResourceContract.class).getOwnerAddress();
}

@Override
public long calcFee() {
return 0;
}

private void delegateResource(byte[] ownerAddress, byte[] receiverAddress, boolean isBandwidth,
long balance, boolean lock) {
AccountStore accountStore = chainBaseManager.getAccountStore();
DynamicPropertiesStore dynamicPropertiesStore = chainBaseManager.getDynamicPropertiesStore();
DelegatedResourceStore delegatedResourceStore = chainBaseManager.getDelegatedResourceStore();
DelegatedResourceAccountIndexStore delegatedResourceAccountIndexStore = chainBaseManager
.getDelegatedResourceAccountIndexStore();

// 1. unlock the expired delegate resource
long now = chainBaseManager.getDynamicPropertiesStore().getLatestBlockHeaderTimestamp();
delegatedResourceStore.unLockExpireResource(ownerAddress, receiverAddress, now);

//modify DelegatedResourceStore
byte[] key;
long expireTime = 0;
if (lock) {
expireTime = now + DELEGATE_PERIOD;
}
key = DelegatedResourceCapsule.createDbKeyV2(ownerAddress, receiverAddress, lock);
DelegatedResourceCapsule delegatedResourceCapsule = delegatedResourceStore.get(key);
if (delegatedResourceCapsule == null) {
delegatedResourceCapsule = new DelegatedResourceCapsule(ByteString.copyFrom(ownerAddress),
ByteString.copyFrom(receiverAddress));
}

if (isBandwidth) {
delegatedResourceCapsule.addFrozenBalanceForBandwidth(balance, expireTime);
} else {
delegatedResourceCapsule.addFrozenBalanceForEnergy(balance, expireTime);
}
delegatedResourceStore.put(key, delegatedResourceCapsule);

//modify DelegatedResourceAccountIndexStore
delegatedResourceAccountIndexStore.delegateV2(ownerAddress, receiverAddress,
dynamicPropertiesStore.getLatestBlockHeaderTimestamp());

//modify AccountStore for receiver
AccountCapsule receiverCapsule = accountStore.get(receiverAddress);
if (isBandwidth) {
receiverCapsule.addAcquiredDelegatedFrozenV2BalanceForBandwidth(balance);
} else {
receiverCapsule.addAcquiredDelegatedFrozenV2BalanceForEnergy(balance);
}
accountStore.put(receiverCapsule.createDbKey(), receiverCapsule);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ public boolean validate() throws ContractValidateException {
//If the receiver is included in the contract, the receiver will receive the resource.
if (!ArrayUtils.isEmpty(receiverAddress) && dynamicStore.supportDR()) {
if (Arrays.equals(receiverAddress, ownerAddress)) {
throw new ContractValidateException(
"receiverAddress must not be the same as ownerAddress");
throw new ContractValidateException("receiverAddress must not be the same as ownerAddress");
}

if (!DecodeUtil.addressValid(receiverAddress)) {
Expand All @@ -269,6 +268,11 @@ public boolean validate() throws ContractValidateException {

}

if (dynamicStore.supportUnfreezeDelay()) {
throw new ContractValidateException(
"freeze v2 is open, old freeze is closed");
}

return true;
}

Expand Down
Loading