* clang-format-18 pass over the json-tx touchpoints so the
clang-format CI workflow is green.
* regenerate hook/sfcodes.h (adds the sfJsonTxBody entry) so the
verify-generated-headers CI workflow is green.
hasBody was conflating 'field is declared' with 'field is non-empty'.
a classical tx could ride along with a spurious empty sfJsonTxBody and
silently fall through to the classical sig path.
now:
* hasBody = sfJsonTxBody is present (pure routing predicate)
* checkSignature / checkStructuralEquivalence reject an empty body up
front with an explicit 'JsonTxBody is empty.' error string
behaviour for well-formed json-tx and well-formed classical-tx is
unchanged; the classical+empty-body edge case now fails cleanly instead
of silently routing classical.
python exploration of the client-side (any json) and node-side (field-aware
codec: OP_FIELD / OP_NAME / OP_VALUE / OP_TAG / OP_RAW). not wired into
the c++ build; kept for design reference and size measurements.
introduces a signing scheme where the signature covers the raw utf-8
bytes of a tx_json_str the client produced, rather than the classical
binary signing payload. clients need no codec library: dump json,
sign bytes, post.
protocol:
* new sfJsonTxBody VL field (notSigning) carrying the exact ascii bytes
* new featureJsonTx amendment gating the new sign path
* STTx::checkSign routes to jsonTx::checkSignature when the amendment
is active and the body is present
* passesLocalChecks runs jsonTx::checkStructuralEquivalence so the body
must parse to the same canonical fields as the tx itself
helper:
* include/xrpl/protocol/JsonTx.h -- hasBody / body / bodyHash
(sha512half over the body) / checkSignature / checkStructuralEquivalence
rpc:
* submit_json_tx handler: { tx_json_str, signature } -> verify ascii sig,
stuff body + sig into the tx, forceValidity(SigGoodOnly), route through
the normal processTransaction flow. gated on featureJsonTx.
tests:
* ripple.app.JsonTx: feature gate, basic roundtrip, invalid params,
invalid json, bad signature, sig-over-different-bytes, wrong pubkey,
helper unit tests including structural-equivalence tamper case.