Repository navigation
feat(e2e): Tron local node bootstrap and seeding [WPN-536] - #43722
ulissesferreira wants to merge 3 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (9 files, +2389 -0)
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
Builds ready [d20d219]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 8 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
d20d219 to
29f81a3
Compare
Builds ready [29f81a3]
⚡ Performance Benchmarks (Total: 🟢 13 pass · 🟡 11 warn · 🔴 0 fail)
Bundle size diffs
|
9746150 to
47e14ce
Compare
Builds ready [47e14ce]
⚡ Performance Benchmarks (Total: 🟢 12 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
47e14ce to
1486437
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 4 total unresolved issues (including 2 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1486437. Configure here.
Add java-tron private-network seeder, port allocation, smoke script, and unit tests for node state/seeding. Wire TronNode into withFixtures. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop JSON state loading, NFT placeholders, and afterLocalNodesStart hook from PR 1 so this branch only covers java-tron boot and inline balance maps.
1486437 to
5a9a731
Compare
Builds ready [5a9a731]
⚡ Performance Benchmarks (Total: 🟢 20 pass · 🟡 3 warn · 🔴 1 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
- Serialize the genesis-account seeding stages (TRC10, TRC20, staked) instead of running them concurrently, avoiding conflicting transactions from the same funding account - Fix TRC10 abbr exceeding Tron's 5-char limit by adding a dedicated abbr field separate from the longer display symbol - Fix triggerSmartContract signing with the funding account's key regardless of the owner address passed in - Wait for transaction execution (gettransactioninfobyid) instead of just broadcast acknowledgement (gettransactionbyid) - Re-check port availability right before spawning java-tron to fail fast instead of waiting out the full ready timeout
|
Builds ready [efcc1a9]
⚡ Performance Benchmarks (Total: 🟢 16 pass · 🟡 7 warn · 🔴 1 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Split this PR into a stacked set where each PR is under the 1,000 changed-line limit:\n\n1. #44138 — 664 lines — config/dependency foundations\n2. #44141 — 928 lines — Tron seeder asset helpers/tests\n3. #44140 — 994 lines — TronNode bootstrap\n4. #44139 — 113 lines — withFixtures wiring and smoke script\n\nThe tip of the stack matches the rebased #43722 content. |




Summary
Introduces a local java-tron private-network seeder for E2E tests: port allocation, node lifecycle, inline TRX/TRC10/TRC20 balance seeding, smart-contract deployment helpers, and a Tron-only smoke script.
Stack: PR 1 of 3 →
WPN-536b-tron-mocks→WPN-536c-tron-fixturesScope (this PR): node bootstrap + inline balance maps only. JSON state loading,
afterLocalNodesStart, and fixture helpers land in later stack PRs.Explainer — how the Tron node boots
java-tron bootstrap
TronNode.start()callsyarn java-tron-up install(via@metamask-previews/java-tron-up) to ensure the managed JRE + java-tron binary are present under.metamask/cache/java-tron-up/.java-tron-config.ts, picks ephemeral HTTP ports, and spawns the java-tron process.initialBalances(TRX in SUN), mints named TRC10/TRC20 balances, and optionally stakes TRX viafreezeBalanceV2(using hard-coded E2E private keys innode.ts).withFixturesgains alocalNodeOptions: { type: 'tron', options }branch that startsTronNodealongside Anvil when requested.Ports & profiles
test/e2e/seeder/ports.tsgetAvailablePorts, range checks) shared by local nodesTronNodeports option{ fullNodePort }— HTTP JSON-RPC for the private networkprofiles.tscreateTronPortfolioNodeOptions,createTronLowTrxOptions, etc.)Seeded contracts & assets
assets.tsGAS_FREE), named TRC20 (HTX,SEED,USDD,USDT)tron-seeder.ts,contracts/test-trc20.ts,smart-contracts.tsTestTRC20when tests request TRC20 balances; registers addresses in a contract registrySmoke script
yarn test:e2e:smoke:local-node-ports(test/e2e/scripts/smoke-local-node-ports.ts) starts two independent java-tron instances on distinct ports, fetches block height from each, and exits 0 — proving the bootstrap path works end-to-end without the extension.Test plan
yarn test:unit test/e2e/helpers/tron-seeder.test.ts test/e2e/helpers/tron-assets.test.tsyarn test:e2e:smoke:local-node-ports(requires java-tron-up download on first run)CHANGELOG entry: null
Made with Cursor