Improvements
-
Inputs are validated and processed from a plain-data snapshot
Several APIs now take a plain-data snapshot of their inputs at entry and use that snapshot consistently for validation and processing. Previously they read the caller's object several times, so a
Proxyor a getter could show the validation one value and hand a different one to the signing or the request. An operation is now always carried out against the same input state it was validated against.Affected:
sign,multiSign,signTypedData(incl._signTypedData,utils.typedData.signTypedData),ecRecover,newTxID(incl.extendExpiration,addUpdateData), ABI loading inContract(constructor,loadAbi,at), andtriggerSmartContract/triggerConstantContract/triggerConfirmedConstantContract/estimateEnergy(both the options and theparametersargument). Contract method.call()/.send()and theread/writenamespaces inherit the same behavior. -
Caller-provided objects are no longer modified
signno longer appends to the transaction'ssignaturearray, andmultiSignno longer writesPermission_id. Code that kept using the object it passed in must switch to the returned transaction.triggerConstantContract/triggerConfirmedConstantContract/estimateEnergyno longer write internal flags into the options object, so a reused options object no longer carries them into later calls.Contractno longer lowercasestype/stateMutabilityin the caller's ABI, andcontract.abiis now an internal copy. Edits made to the original ABI after loading no longer affect the contract instance.
-
Input requirements
Snapshotting preserves
bigint, andUint8Arraywhere it was already supported (typed-data byte values such assalt,bytesarguments inparameters/parametersV2). Plain objects and arrays from another realm (an iframe, avmcontext) are accepted like local ones.Inputs that are not plain data are now rejected: class instances,
Date, functions, typed arrays outside the two cases above, circular references, and nesting deeper than 64 levels. A snapshot rejection is reported asInvalid transaction provided,Invalid typed data,Invalid options provided,Invalid parameters providedorInvalid ABI provided, followed by the reason and the path to the offending value (for exampleInvalid options provided: unsupported Date at options.feeLimit). The reason-and-path suffix is specific to the snapshot check. Other errors keep their existing messages: the transaction checks insign/multiSignstill throw a bareInvalid transaction provided, and ABI encoding, parameter validation and node-side errors are unchanged.For
signTypedData/verifyTypedData(andhashTypedData) these requirements apply todomainandtypesonly. Thevalueargument is not restricted by type: it is walked along the type definitions, each field declared intypesis read once and handed to the EIP-712 encoder as it is (aUint8Arrayis copied), and only the encoder's own per-type checks apply to the leaves. Fields thattypesdoes not declare are ignored as before, whatever they hold — aDate, a class instance or a function there is not rejected.