Skip to content

executor: keep contract constants in a strong map until the call ends - #3

Merged
EnzinoBB merged 3 commits into
build/reproducible-1518from
fix/contract-constants-map
Oct 13, 2026
Merged

EnzinoBB merged 3 commits into
build/reproducible-1518from
fix/contract-constants-map

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

SmartContractConstants kept the per-thread constants in a WeakHashMap keyed
by the boxed thread id, which nothing else references. A garbage collection
between initSmartContractConstants and the contract constructor cleared the
entry, and the deploy failed with "contract constants is null" on that node
only. Use a ConcurrentHashMap, and remove the entry when the limited-time
call ends: only a deploy's constructor takes it, so the weak map was also
what discarded the entries of ordinary calls.

Testing

  • Executor build on Actions (JDK 11.0.3).
  • Node testnet run 38374856915: the even nodes ran test/compatible-fixes (all phase-1 executor fixes, commit 9647fe4) and the odd nodes the release executor; 17 of 17 contract calls as expected, Counter and Ledger states equal on all 7 nodes.

Compatible: valid contracts behave as before. A build with commits on top of 1518 needs a higher executor_commit_max in the node's config.ini.

🤖 Generated with Claude Code

EnzinoBB and others added 3 commits October 13, 2026 10:49
SmartContractConstants kept the per-thread constants in a WeakHashMap keyed
by the boxed thread id, which nothing else references. A garbage collection
between initSmartContractConstants and the contract constructor cleared the
entry, and the deploy failed with "contract constants is null" on that node
only. Use a ConcurrentHashMap, and remove the entry when the limited-time
call ends: only a deploy's constructor takes it, so the weak map was also
what discarded the entries of ordinary calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With appendAssemblyId=false the attached assembly replaces the main
artifact file of sc-api-support, so within the reactor contract-executor
compiles against sc-api-support-<tag>-b<n>.jar instead of
sc-api-support-0.8.5.jar. That fat jar holds one module-info.class taken
either from sc-api-support or from sc-api-internal, and when it is the
latter javac fails with "module not found: com.credits.sc.api.support".
Keep the plain jar as the project artifact; the assembly is still built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6c38193)
@EnzinoBB
EnzinoBB merged commit ec326fd into build/reproducible-1518 Oct 13, 2026
2 checks passed
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.

1 participant