From d598586d117b3f05ceae7637bb7bb9bd63b0ca6b Mon Sep 17 00:00:00 2001 From: abn2357 <165134544+abn2357@users.noreply.github.com> Date: Thu, 10 Sep 2026 14:31:21 +0800 Subject: [PATCH] docs: align deployment and CI docs with v4.8.2.2 --- docs/api/http/smart-contract/deploycontract.md | 4 ++-- docs/api/json-rpc/tx-build/buildTransaction.md | 2 +- docs/api/openapi.yaml | 10 +++++----- docs/api/openrpc.json | 6 +++--- docs/api/rpc/smart-contract/DeployContract.md | 4 ++++ docs/api/specs/json-rpc/buildTransaction.json | 2 +- docs/clients/wallet-cli/java/commands/contract.md | 2 +- docs/contracts/contract.md | 6 +++--- docs/developers/workflows.md | 15 +++++---------- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/docs/api/http/smart-contract/deploycontract.md b/docs/api/http/smart-contract/deploycontract.md index c8f0ab2af..ce779db60 100644 --- a/docs/api/http/smart-contract/deploycontract.md +++ b/docs/api/http/smart-contract/deploycontract.md @@ -11,7 +11,7 @@ Deploy a smart contract. Returns the unsigned deployment transaction. | Field | Type | Required | Description | |---|---|---|---| | `owner_address` | string | Yes | Deployer address | -| `name` | string | No | Contract name | +| `name` | string | No | Contract name; it must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding | | `abi` | json string | No | Contract ABI (JSON-array string) | | `bytecode` | string | Yes | Contract bytecode (hex) | | `parameter` | string | No | Constructor parameters (hex, appended to bytecode) | @@ -102,4 +102,4 @@ Response example (real Nile capture): | `consume_user_resource_percent` not in [0, 100] | `{"Error": "class org.tron.core.exception.ContractValidateException : percent must be >= 0 and <= 100"}` | | Other exceptions | `{"Error": " : "}` | -> Deployment-side errors (e.g. insufficient origin energy, oversized contract code, constructor revert) are only triggered during broadcast or block packing, not by this endpoint. +> Deployment-side errors (e.g. insufficient origin energy, oversized contract code or contract name, constructor revert) are only triggered during broadcast or block packing, not by this endpoint. diff --git a/docs/api/json-rpc/tx-build/buildTransaction.md b/docs/api/json-rpc/tx-build/buildTransaction.md index 41bad777e..8cee73670 100644 --- a/docs/api/json-rpc/tx-build/buildTransaction.md +++ b/docs/api/json-rpc/tx-build/buildTransaction.md @@ -24,7 +24,7 @@ Tron private extension. Constructs an **unsigned** Tron transaction; sign it and | `tokenId` | `0` | TRC-10 token id (used for `TransferAssetContract`) | | `tokenValue` | `0` | TRC-10 amount | | `abi` | `""` | ABI JSON string for contract deployment (e.g. `[{...}]`) | -| `name` | `""` | Contract name when deploying | +| `name` | `""` | Contract name when deploying; it must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding | | `consumeUserResourcePercent` | `0` | User-shared resource percentage (0–100) | | `originEnergyLimit` | `0` | Deployer's max energy per call | | `permissionId` | `0` | Multi-sig permission id | diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index 3d83d3dae..e0e7152b2 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -5,8 +5,8 @@ "description": "Machine-readable definition generated from java-tron source code, with human-facing metadata linked to the markdown API documentation." "x-java-tron-source": "repo": "tronprotocol/java-tron" - "commit": "f8ff7c76f45ab41d9bb76922329657506819701b" - "version": "GreatVoyage-v4.8.2" + "commit": "d5c3d1d1fd0cad12f09c4346d6ac937ab2cbb071" + "version": "GreatVoyage-v4.8.2.2" "servers": - "url": "https://nile.trongrid.io" @@ -13256,7 +13256,7 @@ "description": "Percentage of contract execution resource cost paid by the user." "name": "type": "string" - "description": "Name encoded as expected by java-tron." + "description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters." "origin_energy_limit": "type": "integer" "format": "int64" @@ -14261,7 +14261,7 @@ "description": "Contract parameter payload." "name": "type": "string" - "description": "Name encoded as expected by java-tron." + "description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters." "call_value": "type": "integer" "format": "int64" @@ -16669,7 +16669,7 @@ "description": "Percentage of contract execution resource cost paid by the user." "name": "type": "string" - "description": "Name encoded as expected by java-tron." + "description": "Contract name. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters." "origin_energy_limit": "oneOf": - diff --git a/docs/api/openrpc.json b/docs/api/openrpc.json index 61d391bb6..b783c504c 100644 --- a/docs/api/openrpc.json +++ b/docs/api/openrpc.json @@ -6,8 +6,8 @@ "description": "Machine-readable definition generated from java-tron source code, with human-facing metadata linked to the markdown API documentation.", "x-java-tron-source": { "repo": "tronprotocol/java-tron", - "commit": "f8ff7c76f45ab41d9bb76922329657506819701b", - "version": "GreatVoyage-v4.8.2" + "commit": "d5c3d1d1fd0cad12f09c4346d6ac937ab2cbb071", + "version": "GreatVoyage-v4.8.2.2" } }, "servers": [ @@ -2328,7 +2328,7 @@ }, "name": { "type": "string", - "description": "Name encoded as expected by java-tron." + "description": "Contract name for deployment. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters." }, "permissionId": { "type": "integer", diff --git a/docs/api/rpc/smart-contract/DeployContract.md b/docs/api/rpc/smart-contract/DeployContract.md index 1ed1749ce..51349b1cc 100644 --- a/docs/api/rpc/smart-contract/DeployContract.md +++ b/docs/api/rpc/smart-contract/DeployContract.md @@ -8,4 +8,8 @@ Deploy a smart contract. Returns an unsigned deployment transaction. rpc DeployContract (CreateSmartContract) returns (TransactionExtention) {} ``` +When constructing `CreateSmartContract`, ensure that `new_contract.name` is no more than 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters. For example, most Chinese characters use three bytes each in UTF-8. + +Leave `new_contract.code_hash` and `new_contract.trx_hash` empty. These fields are reserved for values set by the node; after the `VERSION_4_8_2_2` upgrade takes effect, deployment fails if either field is non-empty. + See the corresponding HTTP endpoint at [/wallet/deploycontract](../../http/smart-contract/deploycontract.md). diff --git a/docs/api/specs/json-rpc/buildTransaction.json b/docs/api/specs/json-rpc/buildTransaction.json index f61f6bbad..8196d725b 100644 --- a/docs/api/specs/json-rpc/buildTransaction.json +++ b/docs/api/specs/json-rpc/buildTransaction.json @@ -98,7 +98,7 @@ }, "name": { "type": "string", - "description": "Name encoded as expected by java-tron." + "description": "Contract name for deployment. It must not exceed 32 bytes. After the VERSION_4_8_2_2 upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters." }, "permissionId": { "type": "integer", diff --git a/docs/clients/wallet-cli/java/commands/contract.md b/docs/clients/wallet-cli/java/commands/contract.md index 11d684113..0ae88c624 100644 --- a/docs/clients/wallet-cli/java/commands/contract.md +++ b/docs/clients/wallet-cli/java/commands/contract.md @@ -9,7 +9,7 @@ Deploy, trigger, and inspect smart contracts. ``` - `OwnerAddress` — the address of the account that initiated the transaction, optional, default is the address of the login account. -- `contractName` — name of the smart contract. +- `contractName` — name of the smart contract, with a maximum length of 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters. - `ABI` — compile-generated ABI code. - `byteCode` — compile-generated byte code. - `constructor`, `params`, `isHex` — define the format of the bytecode, which determines the way to parse `byteCode` from parameters. diff --git a/docs/contracts/contract.md b/docs/contracts/contract.md index 8bd4a3efb..b94b6c0e3 100644 --- a/docs/contracts/contract.md +++ b/docs/contracts/contract.md @@ -71,10 +71,10 @@ message SmartContract { - `bytecode`: smart contract byte code - `call_value`: TRX transferred into smart contract while call the contract - `consume_user_resource_percent`: resource consumption percentage set by the developer -- `name`: smart contract name +- `name`: smart contract name. It must not exceed 32 bytes. After the `VERSION_4_8_2_2` upgrade takes effect, the limit is measured using UTF-8 encoding, not by the number of characters - `origin_energy_limit`: energy consumption of the developer limit in one call, must be greater than 0. For old contracts that were deployed without this parameter, the stored value is 0 but the runtime substitutes a default of 10,000,000 energy (`CREATOR_DEFAULT_ENERGY_LIMIT`); developers can use the `updateEnergyLimit` api to update this parameter (the new value must be greater than 0) -- `code_hash`: hash of the contract runtime bytecode -- `trx_hash`: root transaction id of the deployment. Populated only for contracts deployed via the `CREATE2` opcode; left empty for contracts deployed via the `CREATE` opcode or via gRPC `deployContract` +- `code_hash`: the hash of the deployed contract's runtime bytecode. The node calculates this field automatically, so callers constructing `CreateSmartContract` must leave it empty. After the `VERSION_4_8_2_2` upgrade takes effect, supplying a non-empty value causes deployment to fail +- `trx_hash`: for a contract created through the TVM `CREATE2` opcode, the node sets this field to the root transaction ID. It remains empty for contracts created through `CREATE` or the `DeployContract` API. Callers constructing `CreateSmartContract` must leave it empty; after the `VERSION_4_8_2_2` upgrade takes effect, supplying a non-empty value causes deployment execution to fail - `version`: smart contract version. When the network has activated the `ALLOW_TVM_COMPATIBLE_EVM` proposal, newly deployed contracts are stamped with version 1 so the runtime can gate EVM-compatible behavior to them, while older contracts (deployed before activation) keep version 0 and retain the original TVM semantics. As of writing this proposal is not active on mainnet, so all contracts on mainnet have version 0 Through other two grpc message types `CreateSmartContract` and `TriggerSmartContract` to create and use smart contract. diff --git a/docs/developers/workflows.md b/docs/developers/workflows.md index dd431d94c..a2c94dfaf 100644 --- a/docs/developers/workflows.md +++ b/docs/developers/workflows.md @@ -8,14 +8,13 @@ This page summarizes the GitHub Actions checks that contributors need to underst | --- | --- | --- | --- | | PR Check (`pr-check.yml`) | `develop`, `release_**` | Runs | Push to `master` or `release_**` | | PR Build (`pr-build.yml`) | `master`, `develop`, `release_**` | Skipped | Manual dispatch | -| Single-node integration (`integration-test-single-node.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch | -| Multi-node integration (`integration-test-multinode.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch | +| Single-node integration (smoke) (`integration-test-single-node.yml`) | `develop`, `release_**` | Skipped | Push to `master` or `release_**`; manual dispatch | | CodeQL (`codeql.yml`) | `develop` | Skipped | Push to `develop`, `master`, or `release_**`; weekly schedule | | Math usage (`math-check.yml`) | `develop`, `release_**` | Runs | Push to `master` or `release_**`; manual dispatch | | Reviewer assignment (`pr-reviewer.yml`) | `develop`, `release_**` | Runs | None | | Cancel PR workflows (`pr-cancel.yml`) | Any branch | Runs when an unmerged PR is closed | None | -PR Build, both integration-test workflows, and CodeQL are skipped when a pull request changes only documentation or certain repository-metadata files. If the same pull request includes any other file, the applicable workflows run normally. PR Check, Math usage, reviewer assignment, and cancellation do not have this path exclusion. +PR Build, the single-node integration (smoke) workflow, and CodeQL are skipped when a pull request changes only documentation or certain repository-metadata files. If the same pull request includes any other file, the applicable workflows run normally. PR Check, Math usage, reviewer assignment, and cancellation do not have this path exclusion. ## PR Validation and Code Checks @@ -48,12 +47,9 @@ The coverage gates require: ## Integration, Security, and Math Checks -The documented source version includes both full integration-test workflows: +The documented source version includes a single-node integration workflow that runs the smoke-test subset against one node. The full single-node suite and the multi-node integration workflow are not run by GitHub Actions. -- The single-node workflow runs the full test set against one node. -- The multi-node workflow runs the full test set against a three-witness stack. - -They run for applicable pull requests targeting `develop` or `release_**`, on pushes to `master` or `release_**`, and when started manually. +The smoke workflow runs for applicable pull requests targeting `develop` or `release_**`, on pushes to `master` or `release_**`, and when started manually. CodeQL runs on pull requests targeting `develop` only. It also runs on pushes to `develop`, `master`, and `release_**`, and on a weekly schedule. @@ -77,8 +73,7 @@ When a pull request is closed without being merged, java-tron attempts to cancel - PR Build - CodeQL -- Single-node integration tests -- Multi-node integration tests +- Single-node integration (smoke) ## Sonar Configuration