NodeCrypto Help

Errors and Resource Limits

Script diagnostics fall into two categories: Static (Compile-Time) Errors detected when editing and saving the node, and Runtime Errors raised during workflow execution.

Static Errors (Compile-Time)

Static errors block saving in the Properties modal and report the exact line:column. If a saved workflow fails static checking when opened (e.g., an unsupported script version), the node fails at runtime with SCRIPT_COMPILE_ERROR.

Syntax Diagnostics

Diagnostic CodeMeaning & Resolution
SCRIPT_SYNTAX_SOURCE_TOO_LARGEScript source exceeds 64 KiB. Factor repeated logic into functions or loops.
SCRIPT_SYNTAX_TAB_INDENTTab character used in indentation; indent with 4 spaces per level.
SCRIPT_SYNTAX_INDENT_UNITIndentation is not a multiple of 4 spaces.
SCRIPT_SYNTAX_INDENT_TOO_DEEPIndentation increased by more than one 4-space level at once.
SCRIPT_SYNTAX_UNEXPECTED_INDENTIndented line where no block was opened.
SCRIPT_SYNTAX_EXPECTED_INDENTMissing indented block after a colon (:).
SCRIPT_SYNTAX_BLOCK_SAME_LINEBlock body written on the same line after :; place the body on the next line indented by 4 spaces.
SCRIPT_SYNTAX_SEMICOLONSemicolon (;) used to join statements; write one statement per line.
SCRIPT_SYNTAX_LINE_CONTINUATIONBackslash (\) line continuation used; wrap multi-line expressions in parentheses instead.
SCRIPT_SYNTAX_UNCLOSED_BRACKETUnclosed parenthesis ( or bracket [.
SCRIPT_SYNTAX_UNMATCHED_BRACKETClosing parenthesis or bracket with no matching opener.
SCRIPT_SYNTAX_BRACECurly braces { } used outside an f-string (dicts and sets are not supported).
SCRIPT_SYNTAX_UNKNOWN_CHARUnrecognized character outside string literals and comments.
SCRIPT_SYNTAX_RESERVED_NAMEIdentifier starts with a reserved double underscore (__).
SCRIPT_SYNTAX_FLOATFloating-point literal used; only integers are supported.
SCRIPT_SYNTAX_INVALID_NUMBERMalformed integer literal.
SCRIPT_SYNTAX_SINGLE_QUOTESingle-quoted string used; use double quotes ("...").
SCRIPT_SYNTAX_UNTERMINATED_STRINGString or byte literal is missing its closing quote.
SCRIPT_SYNTAX_BAD_ESCAPEUnsupported escape sequence (only \\, \", \n, \r, \t, and \uNNNN are allowed).
SCRIPT_SYNTAX_HEX_INVALID_CHARh"..." literal contains non-hex characters (or a 0x prefix).
SCRIPT_SYNTAX_HEX_ODD_DIGITSh"..." literal has an odd number of hex digits.
SCRIPT_SYNTAX_BIN_INVALID_CHARb"..." literal contains characters other than 0, 1, and space (use h"..." for hex or s"..." for UTF-8 text).
SCRIPT_SYNTAX_BIN_BIT_COUNTb"..." literal bit count is not a multiple of 8.
SCRIPT_SYNTAX_LITERAL_PREFIX_SPACEWhitespace between literal prefix (h/b/s/f) and opening quote.
SCRIPT_SYNTAX_LITERAL_MIXED_KINDAdjacent concatenation mixed different literal kinds; join them with + instead.
SCRIPT_SYNTAX_LITERAL_CONCAT_OUTSIDE_PARENAdjacent literal concatenation outside parentheses; wrap in (...) or use +.
SCRIPT_SYNTAX_FSTRING_BRACEUnescaped single } in f-string; write }} for a literal brace.
SCRIPT_SYNTAX_FSTRING_FIELDMalformed f-string interpolation field (quotes, braces, and backslashes cannot appear inside the expression).
SCRIPT_SYNTAX_FSTRING_EMPTYEmpty interpolation field {} in f-string.
SCRIPT_SYNTAX_UNEXPECTED_TOKENUnexpected token in statement or expression.
SCRIPT_SYNTAX_UNSUPPORTEDUnsupported Python construct (import, class, while, lambda, try, print, etc.).
SCRIPT_SYNTAX_UNSUPPORTED_OPERATORUnsupported operator (** or /); use pow(base, exp, mod) or //.
SCRIPT_SYNTAX_ATTRIBUTEAttribute access or method call (.); call built-in functions directly.
SCRIPT_SYNTAX_COMPREHENSIONList comprehension used; use a for loop with += [item].
SCRIPT_SYNTAX_CHAINED_COMPARISONChained comparison (a < b < c); write (a < b) and (b < c).
SCRIPT_SYNTAX_CALL_TARGETAttempted to call a non-identifier expression.
SCRIPT_SYNTAX_POSITIONAL_AFTER_KEYWORDPositional argument follows a keyword argument.
SCRIPT_SYNTAX_EXPR_STATEMENTNon-call expression used as a standalone statement.
SCRIPT_SYNTAX_DANGLING_ELSEelif or else without a matching if.
SCRIPT_SYNTAX_NESTED_DEFFunction defined inside another block; define all functions at the top level.
SCRIPT_SYNTAX_ANNOTATION_NO_VALUEType annotation without an initializer (write x: int = 0).
SCRIPT_SYNTAX_UNPACK_RHSRight-hand side of tuple unpacking is neither a tuple nor a function call.
SCRIPT_SYNTAX_TUPLE_CONTEXTTuple used outside a return statement or unpacking assignment.
SCRIPT_SYNTAX_TUPLE_ARITYtuple[...] return type annotation has fewer than 2 element types.
SCRIPT_SYNTAX_PARAM_TYPEFunction parameter is missing its type annotation.
SCRIPT_SYNTAX_PARAM_DEFAULTDefault parameter value specified on a user-defined function.
SCRIPT_SYNTAX_UNKNOWN_TYPEUnknown type name in annotation (use int, bool, bytes, string, or list[...]).
SCRIPT_SYNTAX_NESTED_LISTNested list type annotation list[list[...]] is not supported.

Name, Type, and Flow Diagnostics

Diagnostic CodeMeaning & Resolution
SCRIPT_TYPE_MISMATCHType mismatch in assignment, condition, operator operand, or function argument.
SCRIPT_OUTPUT_TYPE_MISMATCHValue assigned to an output port variable does not match the port's declared data type.
SCRIPT_OUTPUT_UNASSIGNEDAn output port variable is not definitely assigned along all execution paths (see Definite Assignment Analysis).
SCRIPT_UNASSIGNEDVariable read before it is guaranteed to be assigned on all paths.
SCRIPT_INPUT_READONLYAttempted to reassign or mutate a read-only input port variable.
SCRIPT_NAME_UNDEFINEDReferenced an undefined variable or function name.
SCRIPT_NAME_RESERVEDUsed a built-in function name as a variable or user function name.
SCRIPT_NAME_CONFLICTIdentifier collides with an existing function, variable, constant, parameter, or port.
SCRIPT_CONST_NOT_TOPAll-uppercase constant defined inside a block rather than at the top level.
SCRIPT_CONST_REASSIGNAttempted to reassign or mutate an immutable constant.
SCRIPT_CONST_INVALIDConstant initializer references non-constant variables or input ports.
SCRIPT_FUNC_SCOPEFunction body references a top-level variable, input port, or output port directly.
SCRIPT_FUNC_ORDERCalled a user function before its definition (or attempted recursion).
SCRIPT_CALL_ARGSInvalid argument count or keyword argument name in function call.
SCRIPT_RETURN_OUTSIDEreturn statement used outside a function.
SCRIPT_RETURN_TYPEReturned value does not match the function's declared return type.
SCRIPT_RETURN_MISSINGValue-returning function has an execution path that does not end with return.
SCRIPT_TUPLE_MISMATCHTuple unpacking target count does not match, or repeats the same target variable.
SCRIPT_TUPLE_MISMATCH / SCRIPT_TUPLE_CONTEXTTuple value used outside unpacking or return.
SCRIPT_RANGE_CONTEXTrange(...) used outside the header of a for loop.
SCRIPT_LOOP_CONTROL_OUTSIDEbreak or continue used outside a for loop.
SCRIPT_EMPTY_LISTEmpty list [] used without an explicit type annotation (write xs: list[bytes] = []).
SCRIPT_NESTED_LISTAttempted to construct a nested list.
SCRIPT_INT_LITERAL_TOO_LARGEInteger literal exceeds 1,048,576 bits.
SCRIPT_FORMAT_INVALIDInvalid f-string format specifier for the expression's type or width limit (> 4,096).

Port Schema Diagnostics

Diagnostic CodeMeaning & Resolution
SCRIPT_PORT_INVALID_IDPort name violates identifier syntax ([A-Za-z_][A-Za-z0-9_]*) or starts with __.
SCRIPT_PORT_RESERVED_IDPort name collides with a reserved keyword or built-in function name.
SCRIPT_PORT_DUPLICATE_IDTwo ports on the Script node share the same name/ID.
SCRIPT_PORT_INVALID_TYPEPort data type is not one of bytes, int, bool, or string.

Runtime Errors

Error CodeMeaningExample
SCRIPT_COMPILE_ERRORSaved script failed static verification or uses an unsupported script version.—
SCRIPT_DIVISION_BY_ZERODivisor of // or % is 0.1 // 0
SCRIPT_INDEX_OUT_OF_RANGEList index or slice range is out of bounds.[1, 2][5]
SCRIPT_INVALID_ARGUMENTNegative bit-shift count, zero range step, or invalid pow arguments.1 << -1
SCRIPT_INVALID_ERROR_CODECustom code passed to fail(code, message) starts with reserved SCRIPT_ or BYTES_.—
SCRIPT_SIZE_LIMITInteger bit length, list length, or loop iteration count exceeded 1,048,576.1 << 2000000
SCRIPT_STEP_LIMITExecution exceeded the 10,000,000 evaluation step limit.—
SCRIPT_TIMEOUTExecution exceeded the wall-clock timeout (3 seconds in Web, 10 seconds in API Container).—
SCRIPT_INTERNAL_ERRORUnexpected internal interpreter error.—

Byte Operation Errors

Error CodeMeaningExample
BYTES_OUT_OF_RANGEByte index or slice range is outside the buffer bounds.h"01 02"[2]
BYTES_LENGTH_MISMATCHOperands to a bytewise operator or slice assignment have different lengths.h"01" ^ h"01 02"
BYTES_INT_OVERFLOWInteger cannot fit in the requested byte length and signedness.to_bytes(256, 1)
BYTES_INVALID_HEXInvalid hexadecimal string passed to from_hex.from_hex("zz")
BYTES_INVALID_UTF8Invalid UTF-8 byte sequence passed to to_utf8.to_utf8(h"c3 28")
BYTES_INVALID_ARGUMENTNegative length/count, out-of-range byte value, or invalid endianness string.to_int(h"01", "middle")
BYTES_SIZE_LIMITResulting byte array exceeds the 16 MiB buffer limit.zeros(20000000)

Resource Limits

ResourceLimitError Code When Exceeded
Evaluation steps10,000,000SCRIPT_STEP_LIMIT
Single bytes buffer size16 MiBBYTES_SIZE_LIMIT
Single list length / for loop iterations1,048,576SCRIPT_SIZE_LIMIT
Single int bit length1,048,576 bitsSCRIPT_SIZE_LIMIT (or SCRIPT_INT_LITERAL_TOO_LARGE)
Script source size64 KiBSCRIPT_SYNTAX_SOURCE_TOO_LARGE
f-string field width4,096SCRIPT_FORMAT_INVALID
Wall-clock execution time3 s (Web) / 10 s (API Container)SCRIPT_TIMEOUT
o = 0
for i in range(1000000):
    for j in range(100):
        o += 1
o = 0
for i in range(2000000):
    o += 1