Harden ENSJobPages resolver handling, portable ENS audit tooling, and docs/artifacts refresh#154
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbef105d8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| (bool supportsText,,) = _resolverCapabilities(); | ||
| if (!supportsText) failures |= CONFIG_ERR_RESOLVER_TEXT; |
There was a problem hiding this comment.
Restore write-capability gating in validateConfiguration
Any resolver that exposes a readable text(bytes32,string) surface but does not actually implement setText/setAuthorisation now passes validateConfiguration(). In that setup handleHook() will proceed, create/adopt the subname, and emit ENSHookProcessed(..., configured=true, success=true) because _setTextBestEffort() and _setAuthorisationBestEffort() swallow the missing-function reverts, but the page never gets metadata or permissions and jobEnsReady() stays false. Before this change the ERC-165 write-interface checks prevented that silent misconfiguration.
Useful? React with 👍 / 👎.
| function compat() { | ||
| if (isV6) return raw; | ||
| const utils = raw.utils; | ||
| return { | ||
| ...raw, | ||
| ZeroAddress: raw.constants.AddressZero, | ||
| ZeroHash: raw.constants.HashZero, | ||
| Interface: utils.Interface, | ||
| Wallet: raw.Wallet, | ||
| id: utils.id, | ||
| namehash: utils.namehash, | ||
| ensNormalize: (value) => value.trim().toLowerCase(), | ||
| solidityPackedKeccak256: (types, values) => utils.solidityKeccak256(types, values), |
There was a problem hiding this comment.
Complete the v5 compatibility shim before using it in phase0
When loadEthers() falls back to an ethers v5 install, compat() only aliases Interface, Wallet, hashing helpers, and constants. scripts/ens/phase0-mainnet-snapshot.mjs now consumes this helper but immediately calls new ethers.JsonRpcProvider(...) and new ethers.Contract(...), which do not exist on the v5-shaped object returned here. In the portability scenario this helper is meant to support (no hardhat/node_modules/ethers, only a standalone ethers install), the phase0 snapshot script will still crash before it can query mainnet.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb95e7e129
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const candidates = [ | ||
| path.resolve(__dirname, '../../../hardhat/node_modules/ethers'), | ||
| 'ethers', | ||
| ]; |
There was a problem hiding this comment.
Finish the portable ethers fallback for RPC-based tools
This new helper does not make the ENS operator scripts portable end-to-end yet. audit-mainnet.ts, inventory-job-pages.ts, migrate-legacy-batch.ts, and repair-job-page.ts now import ./lib/ethers, but they still instantiate CurlJsonRpcProvider, and scripts/ens/lib/json_rpc.js:5 still does a hard require('../../../hardhat/node_modules/ethers'). In the exact fallback scenario this change is meant to support (no hardhat/node_modules/ethers, only a standalone ethers install), those scripts will still fail during module load before any RPC call.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73fcfbfb7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| ...raw, | ||
| ZeroAddress: raw.constants.AddressZero, | ||
| ZeroHash: raw.constants.HashZero, | ||
| Contract: raw.Contract, | ||
| JsonRpcProvider: raw.providers.JsonRpcProvider, | ||
| Interface: utils.Interface, | ||
| Wallet: raw.Wallet, | ||
| id: utils.id, | ||
| namehash: utils.namehash, | ||
| ensNormalize: (value) => value.trim().toLowerCase(), | ||
| solidityPackedKeccak256: (types, values) => utils.solidityKeccak256(types, values), | ||
| }; |
There was a problem hiding this comment.
Provide
toBeHex in the v5 ethers shim
In the standalone ethers v5 fallback this helper is supposed to support, compat() never defines toBeHex, but scripts/ens/lib/json_rpc.js now unconditionally calls ethers.toBeHex(...) when formatting block tags, nonces, gas, and values. That means audit-mainnet.ts, inventory-job-pages.ts, repair-job-page.ts, and migrate-legacy-batch.ts will still die with TypeError: ethers.toBeHex is not a function as soon as CurlJsonRpcProvider needs any quantity conversion, so the new portability path remains broken for every RPC-backed ENS tool.
Useful? React with 👍 / 👎.
| Interface: utils.Interface, | ||
| Wallet: raw.Wallet, | ||
| id: utils.id, | ||
| namehash: utils.namehash, | ||
| ensNormalize: (value) => value.trim().toLowerCase(), | ||
| solidityPackedKeccak256: (types, values) => utils.solidityKeccak256(types, values), |
There was a problem hiding this comment.
Normalize v5 decoded integers before exposing the compat shim
The v5 branch returns utils.Interface unchanged, so decodeFunctionResult() still yields v5 BigNumber objects, while the scripts you just rewired assume v6-style native bigints. For example, inventory-job-pages.ts does Number(nextJobIdRead), phase0-mainnet-snapshot.mjs calls BigInt(value) in asNumber(), and audit-mainnet.ts only stringifies values whose type is bigint. In the exact fallback scenario this shim targets, those reads will either throw or serialize malformed JSON, so the ENS audit/snapshot tooling still cannot run end-to-end on an ethers v5 install.
Useful? React with 👍 / 👎.
Motivation
AGIJobManagerPrimebytecode, and reconcile repo docs/tooling with live mainnet state.hardhat/node_modules/ethers) and emit machine-readable chain-backed artifacts.Description
ENSJobPages.validateConfiguration()so resolver readability (text()probe) is a hard signal while ERC-165 write-interface bits (setText/setAuthorisation) are diagnostic only.setText/setAuthorisationand kept guarded write attempts that emitENSHookBestEffortFailureon failure._supportsTextLookup(address)probe and adapted_resolverCapabilities()to detect resolvers that respond totext(bytes32,string)even if they omit ERC-165 adverts.scripts/ens/lib/ethers.jsand rewired ENS scripts (audit-mainnet.ts,inventory-job-pages.ts,repair-job-page.ts,migrate-legacy-batch.ts,phase0-mainnet-snapshot.mjs) to use it.scripts/ens/output/from mainnet (audit, inventory, repair planner).preview*(projections) vseffective*(authoritative snapshots) terminology, and quarantineuseEnsJobTokenURIfor Prime docs.test/ensAuthoritySnapshot.test.jsto cover live-style resolvers that implement readabletext()but do not advertise write interfaces, and to assert explicit configuration flags inconfigurationStatus().Testing
node scripts/ens/audit-mainnet.ts,MAX_JOBS=32 node scripts/ens/inventory-job-pages.ts, andJOB_ID=0 node scripts/ens/repair-job-page.ts, which completed and produced updated JSON artifacts underscripts/ens/output/(success).test/ensAuthoritySnapshot.test.js; test run was started in this environment but the full Truffle/Hardhat test/compile suite did not complete before handoff (in-progress).cd hardhat && npm run compileandnode scripts/check-bytecode-size.jsto remeasure bytecode; compilation was started but the environment did not produce final size reports before handoff (pending).Codex Task