Skip to content

Retire rain.lib.hash after rainlang.interface adopts EIP-712 signed context: inline the one hashWords line and drop the dependency #39

Description

@thedavidmeister

Blocked by rainlanguage/rainlang.interface#133.

Why

The only source file in the org that calls this library is rainlang.interface's LibContext.sol, which uses hashWords(context) for the signed-context digest and imports HASH_NIL as a fold seed; its two fold functions already inline the composition pattern by hand. Seven other repos declare the soldeer dependency only because non-recursive soldeer makes them restate rainlang.interface's dependencies; none imports it. (Verified 2026-09-03 by GitHub code search plus direct fetch of the candidate files; historic OrderBook deployments embed the library's bytecode and are unaffected.)

Once #133 moves signed context to EIP-712 hashStruct, the library's contribution to the stack is one assembly line: keccak256(add(ptr, 0x20), mul(mload(ptr), 0x20)), which is EIP-712's own encoding of a bytes32[] member. HASH_NIL is keccak256("") and folds at compile time; combineHashes is two mstores and a keccak. A versioned package, its audit surface and its release lifecycle for one line is the wrong side of the ledger.

Done when

  • rainlang.interface inlines that line in LibContext (or its V2 successor) and drops rain-lib-hash from foundry.toml / soldeer.lock; the seven transitive listings disappear with it as those repos re-lock.
  • This repo's README pattern section is either archived as-is or its encodeData-relevant parts move next to the implementation in rainlang.interface.
  • This repo is archived on GitHub with a README banner pointing at rainlang.interface.

Refs #7 (moved to rainlang.interface #133), #22.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions