Skip to content

Commit b3555dd

Browse files
Merge pull request #6277 from tronprotocol/release_v4.8.0
Merge release_v4.8.0 to master
2 parents e811def + 212a4ec commit b3555dd

File tree

337 files changed

+18523
-4217
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+18523
-4217
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333

3434
# Initializes the CodeQL tools for scanning.
3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@v2
36+
uses: github/codeql-action/init@v3
3737
with:
3838
languages: ${{ matrix.language }}
3939
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -46,7 +46,7 @@ jobs:
4646
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
4747
# If this step fails, then you should remove it and run the build manually (see below)
4848
- name: Autobuild
49-
uses: github/codeql-action/autobuild@v2
49+
uses: github/codeql-action/autobuild@v3
5050

5151
# ℹ️ Command-line programs to run using the OS shell.
5252
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -59,6 +59,6 @@ jobs:
5959
# ./location_of_script_within_repo/buildscript.sh
6060

6161
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v2
62+
uses: github/codeql-action/analyze@v3
6363
with:
6464
category: "/language:${{matrix.language}}"

.github/workflows/math-check.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Check Math Usage
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'release_**' ]
6+
pull_request:
7+
branches: [ 'develop', 'release_**' ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-math:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check for java.lang.Math usage
18+
id: check-math
19+
shell: bash
20+
run: |
21+
echo "Checking for java.lang.Math usage..."
22+
23+
touch math_usage.txt
24+
25+
while IFS= read -r file; do
26+
filename=$(basename "$file")
27+
if [[ "$filename" == "StrictMathWrapper.java" || "$filename" == "MathWrapper.java" ]]; then
28+
continue
29+
fi
30+
31+
perl -0777 -ne '
32+
s/"([^"\\]|\\.)*"//g;
33+
s/'\''([^'\''\\]|\\.)*'\''//g;
34+
s!/\*([^*]|\*[^/])*\*/!!g;
35+
s!//[^\n]*!!g;
36+
$hasMath = 0;
37+
$hasMath = 1 if /^[\s]*import[\s]+java\.lang\.Math\b/m;
38+
$hasMath = 1 if /\bjava\s*\.\s*lang\s*\.\s*Math\s*\./;
39+
$hasMath = 1 if /(?<![\w\.])(?<!Strict)Math\s*\./;
40+
print "$ARGV\n" if $hasMath;
41+
' "$file" >> math_usage.txt
42+
done < <(find . -type f -name "*.java")
43+
44+
sort -u math_usage.txt -o math_usage.txt
45+
46+
if [ -s math_usage.txt ]; then
47+
echo "❌ Error: Forbidden Math usage found in the following files:"
48+
cat math_usage.txt
49+
echo "math_found=true" >> $GITHUB_OUTPUT
50+
echo "Please use org.tron.common.math.StrictMathWrapper instead of direct Math usage."
51+
else
52+
echo "✅ No forbidden Math usage found"
53+
echo "math_found=false" >> $GITHUB_OUTPUT
54+
fi
55+
56+
- name: Upload findings
57+
if: steps.check-math.outputs.math_found == 'true'
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: math-usage-report
61+
path: math_usage.txt
62+
63+
- name: Create comment
64+
if: github.event_name == 'pull_request' && steps.check-math.outputs.math_found == 'true'
65+
uses: actions/github-script@v6
66+
with:
67+
script: |
68+
const fs = require('fs');
69+
const findings = fs.readFileSync('math_usage.txt', 'utf8');
70+
const body = `### ❌ Math Usage Detection Results
71+
72+
Found forbidden usage of \`java.lang.Math\` in the following files:
73+
74+
\`\`\`
75+
${findings}
76+
\`\`\`
77+
78+
**Please review if this usage is intended.**
79+
> [!CAUTION]
80+
> Note: You should use \`org.tron.common.math.StrictMathWrapper\`.
81+
> If you need to use \`java.lang.Math\`, please provide a justification.
82+
`;
83+
84+
await github.rest.issues.createComment({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: context.issue.number,
88+
body: body
89+
});
90+
91+
- name: Fail if Math usage found
92+
if: steps.check-math.outputs.math_found == 'true'
93+
run: exit 1

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Please make sure your submission meets the following code style:
151151
152152
### Commit Messages
153153
154-
Commit messages should follow the rule below, we provide a template corresponding instructions.
154+
Commit messages should follow the rule below, we provide a template with corresponding instructions.
155155
156156
Template:
157157
```
@@ -182,7 +182,7 @@ The subject contains a succinct description of the change:
182182
4. Do not end the subject line with a period.
183183
5. Avoid meaningless commits. It is recommended to use the git rebase command.
184184
185-
Message body use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
185+
Message body uses the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
186186
187187
Here is an example:
188188
```
@@ -217,7 +217,7 @@ If the purpose of this submission is to modify one issue, you need to refer to t
217217
218218
219219
### Special Situations And How To Deal With Them
220-
As a reviewer, you may find yourself in one of the sitations below. Here’s how to deal with those:
220+
As a reviewer, you may find yourself in one of the situations below. Here’s how to deal with those:
221221
222222
The author doesn’t follow up: ping them after a while (i.e. after a few days). If there is no further response, close the PR or complete the work yourself.
223223

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
## Table of Contents
4444

4545
- [What’s TRON?](#whats-tron)
46-
- [Building the Source Code](#building-the-source)
46+
- [Building the Source Code](#building-the-source-code)
4747
- [Running java-tron](#running-java-tron)
4848
- [Community](#community)
4949
- [Contribution](#contribution)
5050
- [Resources](#resources)
5151
- [Integrity Check](#integrity-check)
5252
- [License](#license)
5353

54-
## What's TRON?
54+
# What's TRON?
5555

5656
TRON is a project dedicated to building the infrastructure for a truly decentralized Internet.
5757

@@ -61,7 +61,7 @@ TRON is a project dedicated to building the infrastructure for a truly decentral
6161

6262
TRON enables large-scale development and engagement. With over 2000 transactions per second (TPS), high concurrency, low latency, and massive data transmission. It is ideal for building decentralized entertainment applications. Free features and incentive systems allow developers to create premium app experiences for users.
6363

64-
# Building the source
64+
# Building the Source Code
6565

6666
Building java-tron requires `git` package and 64-bit version of `Oracle JDK 1.8` to be installed, other JDK versions are not supported yet. Make sure you operate on `Linux` and `MacOS` operating systems.
6767

@@ -91,18 +91,18 @@ Minimum:
9191

9292
- CPU with 8 cores
9393
- 16GB RAM
94-
- 2TB free storage space to sync the Mainnet
94+
- 3TB free storage space to sync the Mainnet
9595

9696
Recommended:
9797

9898
- CPU with 16+ cores(32+ cores for a super representative)
9999
- 32GB+ RAM(64GB+ for a super representative)
100-
- High Performance SSD with at least 2.5TB free space
100+
- High Performance SSD with at least 4TB free space
101101
- 100+ MB/s download Internet service
102102

103103
## Running a full node for mainnet
104104

105-
Full node has full historical data, it is the entry point into the TRON network , it can be used by other processes as a gateway into the TRON network via HTTP and GRPC endpoints. You can interact with the TRON network through full node:transfer assets, deploy contracts, interact with contracts and so on. `-c` parameter specifies a configuration file to run a full node:
105+
Full node has full historical data, it is the entry point into the TRON network, it can be used by other processes as a gateway into the TRON network via HTTP and GRPC endpoints. You can interact with the TRON network through full node:transfer assets, deploy contracts, interact with contracts and so on. `-c` parameter specifies a configuration file to run a full node:
106106

107107
```bash
108108
$ nohup java -Xms9G -Xmx9G -XX:ReservedCodeCacheSize=256m \

Tron protobuf protocol document.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ Contract and contract-related messages.
975975

976976
- message `VoteAssetContract`
977977

978-
`owner_address`: assress of contract owner.
978+
`owner_address`: address of contract owner.
979979

980980
`vote_address`: voted address of asset.
981981

@@ -1059,7 +1059,7 @@ Contract and contract-related messages.
10591059

10601060
`total_supply`: maximum of asset.
10611061

1062-
`frozen_supply`: frozen supplt of asset.
1062+
`frozen_supply`: frozen supply of asset.
10631063

10641064
`trx_num`: trx num defines token price.
10651065

@@ -1079,11 +1079,11 @@ Contract and contract-related messages.
10791079

10801080
`free_asset_net_limit`: free bandwidth limit each account owns when transfers asset.
10811081

1082-
`public_free_asset_net_limit`: free bandwidth limit for all acoounts.
1082+
`public_free_asset_net_limit`: free bandwidth limit for all accounts.
10831083

10841084
`public_free_asset_net_usage`: free bandwidth usage of all accounts.
10851085

1086-
`public_latest_free_net_time`: the latest bandwidth consumption time fo token transfer.
1086+
`public_latest_free_net_time`: the latest bandwidth consumption time for token transfer.
10871087

10881088
```java
10891089
message AssetIssueContract {
@@ -1131,7 +1131,7 @@ Contract and contract-related messages.
11311131

11321132
`owner_address`: owner address.
11331133

1134-
`to_address`: reveiver address.
1134+
`to_address`: receiver address.
11351135

11361136
`asset_name`: target asset name.
11371137

@@ -1461,7 +1461,7 @@ Contract and contract-related messages.
14611461
14621462
`owner_address`: address of owner.
14631463
1464-
`owner`: autuority to execute all contracts.
1464+
`owner`: authority to execute all contracts.
14651465
14661466
`witness`: used by SR for generating blocks.
14671467
@@ -1514,7 +1514,7 @@ Contract and contract-related messages.
15141514
15151515
`binding_signature`: signature to verify transaction.
15161516
1517-
`transparent_to_address`: transparent address of reveiver.
1517+
`transparent_to_address`: transparent address of receiver.
15181518
15191519
`to_amount`: amount to transparent to_address
15201520
@@ -1536,7 +1536,7 @@ Contract and contract-related messages.
15361536

15371537
### <span id="smartc">Smart Contract</span>
15381538

1539-
message `SmartContract` has mutiple attributes and nested message `ABI`
1539+
message `SmartContract` has multiple attributes and nested message `ABI`
15401540

15411541
- message `SmartContract`
15421542

@@ -1559,7 +1559,7 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
15591559

15601560
- message `Param`
15611561

1562-
`indexed`: `true` if the field is part of the log’s topics, `false` if it one of the log’s data segment.
1562+
`indexed`: `true` if the field is part of the log’s topics, `false` if it is one of the log’s data segment.
15631563

15641564
`name`: name of the parameter.
15651565

@@ -1757,7 +1757,7 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
17571757

17581758
`tree`: incremental merkle tree.
17591759

1760-
`filled`: this is a array, it contains the root of the subtree which can be combined with the param tree to be a new merkle tree.
1760+
`filled`: this is an array, it contains the root of the subtree which can be combined with the param tree to be a new merkle tree.
17611761

17621762
`cursor`: the node that can be combined to a subtree, when they are combined to a subtree, compute its root and put it into the filled.
17631763

@@ -1782,7 +1782,7 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
17821782

17831783
`vouchers`: this is an array, each items represents the merklevoucher of the outputpoint.
17841784

1785-
`paths`: his is an array each items represents the path of the outputpoint.
1785+
`paths`: this is an array each items represents the path of the outputpoint.
17861786

17871787
```java
17881788
message IncrementalMerkleVoucherInfo {
@@ -2124,13 +2124,13 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
21242124

21252125
- #### Node Information
21262126

2127-
Node information is separaed into several parts and implemented by nested messages.
2127+
Node information is separated into several parts and implemented by nested messages.
21282128

21292129

21302130

21312131
- message `NodeInfo`
21322132

2133-
`beginSyncNum`: beginning block height for synchornize.
2133+
`beginSyncNum`: beginning block height for synchronize.
21342134

21352135
`block`: head block id.
21362136

@@ -2154,13 +2154,13 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
21542154

21552155
- message `PeerInfo`:
21562156

2157-
`lastSyncBlock`: last block id for synchornize.
2157+
`lastSyncBlock`: last block id for synchronize.
21582158

21592159
`remainNum`: number of remaining blocks.
21602160

21612161
`lastBlockUpdateTime`: latest block update time .
21622162

2163-
`syncFlag`: is synchroniing or not.
2163+
`syncFlag`: is synchronizing or not.
21642164

21652165
`headBlockTimeWeBothHave`: timestamp of common head block.
21662166

@@ -2172,7 +2172,7 @@ message `SmartContract` has mutiple attributes and nested message `ABI`
21722172

21732173
`port`: listening port.
21742174

2175-
`nodeId`: ramdomly generated node ID
2175+
`nodeId`: randomly generated node ID
21762176

21772177
`connectTime`: connection time period from established.
21782178

actuator/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
description = "actuator – a series of transactions for blockchain."
22

33
dependencies {
4-
compile project(":chainbase")
5-
compile project(":protocol")
6-
compile project(":crypto")
4+
api project(":chainbase")
5+
api project(":protocol")
6+
api project(":crypto")
77
}
88

99
test {

0 commit comments

Comments
 (0)