Repository navigation
executor: return the compiler errors of compileSourceCode - #13
Merged
Merged
Conversation
After a CompilationException the result has no byteCodeObjects (null), and the debug log called .size() on it: the NullPointerException turned the answer into "Internal error processing compileSourceCode" and the compiler's error list (line numbers and messages) never reached the node or its API clients. The log now counts a null list as 0, so the FAILURE status with the errors is returned. A unit test of the handler checks it, and the Build workflow now runs the handler tests (after the jars are uploaded). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnzinoBB
added a commit
to CreditsCommunity/node
that referenced
this pull request
Nov 3, 2026
With executor_ref (mixed executors), contracts.py compiles a source with two errors on the even nodes and prints what SmartContractCompile returns: the compiler's errors with their line numbers once the executor has CreditsCommunity/contract-executor#13. Reported only; nodes running the release executor are left out, as its failure makes the node reopen its executor connection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ContractExecutorHandler.compileSourceCodeleavesresult.byteCodeObjectsnull when the compiler throws aCompilationException, then logsresult.byteCodeObjects.size()(the arguments are evaluated whatever the log level). TheNullPointerExceptionescapes the handler, Thrift answers "Internal error processing compileSourceCode", and the compiler's error list never reaches the node or its API clients (SmartContractCompile).Change
CompilationExceptionbranch is otherwise unchanged: it returns statusFAILUREwithdefineFailureCode(e), whose message is the root-cause stack trace, starting withCompilationException: compilation errors in class <Name> :followed by one<line>:<message>line per error.byteCodeObjectsstays unset (the node'sSmartContractCompilereturns on a non-zero status before reading it).compileSourceCodeReturnsCompilationErrorsinContractExecutorHandlerTest(fails with the NPE before the fix, passes after; checked locally on JDK 17, the whole class 11/11).ContractExecutorHandlerTestafter the jars are uploaded (it ran no tests before;-DskipTestsstays on the package step so the jars and the comparison with build 1518 are unchanged).What the errors contain
InMemoryCompiler(vendoredcom.credits.client:general:1.2) builds eachCompilationException.ErrorfromDiagnostic.getLineNumber()andgetMessage(null)only: column numbers are dropped there, and the message carries no source position beyond the line. Adding columns would need a change to that vendored library (or the executor's own compiler wrapper), not done here.Behaviour of a successful compile, and of every contract execution, is unchanged.
🤖 Generated with Claude Code