Skip to content

Update with fixes#431

Merged
OisinKyne merged 1 commit into
mainfrom
oisin/patchverifier
May 6, 2026
Merged

Update with fixes#431
OisinKyne merged 1 commit into
mainfrom
oisin/patchverifier

Conversation

@OisinKyne
Copy link
Copy Markdown
Contributor

@OisinKyne OisinKyne commented May 6, 2026

Summary

Verifier crashloop fix (the blocker)

  • internal/x402/config.go: LoadConfig
    now treats os.ErrNotExist as a soft
    success — returns a defaulted
    PricingConfig (chain base, default
    facilitator, zero routes) and logs a
    friendly explanation. Other read errors
    (permission denied, IO failures) still
    surface so genuinely broken deployments
    fail loudly. defaultPricingConfig()
    helper introduced.
  • Two tests pinning the new contract:
    TestLoadConfig_FileNotFound_ReturnsDefau
    ltsWithoutError (the rc10 reproducer)
    and TestLoadConfig_UnreadableFile_StillE
    rrors (permission-denied path still
    rejects). Skips the latter under root.
  • End-to-end smoke: x402-verifier
    --config /tmp/does-not-exist.yaml
    --listen :18402 --watch=false boots
    cleanly, logs the friendly message,
    /healthz → 200, /verify → 200 for an
    unmatched URI. The new HTML 402 path is
    unblocked once the new image rolls.

setMetadata revert decoder (the partial
fix)

  • internal/erc8004/revert.go: new
    decodeRevertReason(err) and
    wrapTransactError(prefix, err). Decodes
    the three Solidity revert shapes the
    node returns on the JSON-RPC data field:
    • Error(string) (selector 0x08c379a0)
      → the literal Solidity message.
    • Panic(uint256) (selector 0x4e487b71)
      → mapped to a human label via
      panicReason() (overflow, div-by-zero,
      OOB, etc.).
    • Any other 4-byte selector → surfaced
      as custom error 0x so an
      operator can grep the contract source.
  • internal/erc8004/client.go:
    SetMetadata, SetMetadataWithOpts,
    SetAgentURI now wrap their Transact
    error with the decoder. The original
    error chain stays intact for
    errors.Is/As.
  • internal/erc8004/revert_test.go: 4
    unit tests covering Error(string),
    Panic(uint256), unknown selector, and
    the no-data fast-paths.
  • internal/erc8004/client_test.go:
    extended the mock RPC to attach data on
    JSON-RPC error envelopes via a new
    rpcMockDataError type. Two new
    SetMetadata tests assert the decoded
    reason / selector show up in the wrapped
    CLI error.

What this means for the rc10 reproducer:
next time someone runs obol sell
register twice in a row and hits the
revert, the CLI message will contain
either the Solidity revert("…") text or
custom error 0x — enough for
engineering to grep the registry
contract and identify the actual
rejection condition (probably
MetadataAlreadySet or a wallet-policy
check, per the report). Doesn't fix the
root cause, but turns the opaque error
into something diagnosable in one rerun
rather than a chain-trace expedition.

@OisinKyne OisinKyne merged commit b056026 into main May 6, 2026
6 checks passed
@OisinKyne OisinKyne deleted the oisin/patchverifier branch May 6, 2026 12:02
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.

2 participants