Skip to content

Verify Mainnet Account Abstraction sources - #189

Merged
JOY (JOY) merged 9 commits into
mainfrom
codex/mainnet-aa-source-verification
Aug 13, 2026
Merged

Verify Mainnet Account Abstraction sources#189
JOY (JOY) merged 9 commits into
mainfrom
codex/mainnet-aa-source-verification

Conversation

@JOY

Copy link
Copy Markdown

What changed

  • build immutable verification inputs for five DOS ID Wallet Account Abstraction contracts from exact official source and dependency commits before cloud authentication
  • compile with exact deployment compiler profiles and prove compiler output against live Mainnet runtime bytecode and immutable getters
  • submit idempotent Blockscout verification after deployment acceptance with one global deadline and exact full or partial metadata gates
  • add public Playwright acceptance for all five contract pages and the Account Abstraction operations page
  • document the production design and implementation plan

Why

The five Mainnet wallet contracts were deployed and active, but their source metadata was not reproducibly verified on DOScan. This change makes source verification repeatable, fail-closed, and tied to the exact deployed bytecode without modifying Blockscout core.

Validation

  • real upstream compilation at exact pins matched all five Mainnet runtime bytecodes
  • Mainnet tests: extractor 3/3, bytecode 7/7, source verifier 8/8, workflow/runtime 17/17
  • Testnet regressions: extractor 3/3, source verifier 11/11, workflow/runtime 25/25
  • Bash syntax, Node syntax, YAML parse, actionlint, and git diff check pass

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a deterministic Mainnet Account Abstraction source verification system for five DOS ID Wallet contracts on DOS Chain Mainnet. It introduces scripts for standard input extraction, immutable-aware bytecode comparison, Blockscout source verification, and Playwright browser UAT, along with comprehensive test suites and design documentation. The review feedback highlights three valuable improvements: stripping comments from Solidity files before parsing imports to avoid build crashes, using npx for Yarn execution to prevent global installation permission failures, and applying jq optional chaining to safely handle potentially null API response fields.

Comment on lines +196 to +208
function importedPaths(content) {
const paths = [];
const expressions = [
/import\s*["']([^"']+)["']\s*;/g,
/import\s+[^;]*?\s+from\s*["']([^"']+)["']\s*;/g,
];
for (const expression of expressions) {
for (const match of content.matchAll(expression)) {
paths.push(match[1]);
}
}
return paths;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Commented-out imports (e.g., // import "./Foo.sol"; or inside /* ... */ blocks) are currently matched by the regular expressions in importedPaths. This can cause the script to attempt to resolve non-existent or irrelevant files, leading to unexpected build crashes.

To make the import extraction robust, strip single-line and multi-line comments from the Solidity source content before running the regex matches.

function importedPaths(content) {
  const paths = [];
  const cleanedContent = content
    .replace(/\/\*[\s\S]*?\*\//g, '')
    .replace(/\/\/.*/g, '');
  const expressions = [
    /import\s*["']([^"']+)["']\s*;/g,
    /import\s+[^;]*?\s+from\s*["']([^"']+)["']\s*;/g,
  ];
  for (const expression of expressions) {
    for (const match of cleanedContent.matchAll(expression)) {
      paths.push(match[1]);
    }
  }
  return paths;
}

Comment on lines +71 to +72
npm install --global yarn@1.22.22
yarn --cwd "${aa_checkout}" install --frozen-lockfile --non-interactive

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Installing yarn globally via npm install --global can fail on environments where the Node.js installation is system-owned or lacks write permissions for global directories.

Since npx is always available alongside npm, you can run the exact version of Yarn directly using npx yarn@1.22.22. This avoids global installation entirely, making the script cleaner, safer, and more portable.

Suggested change
npm install --global yarn@1.22.22
yarn --cwd "${aa_checkout}" install --frozen-lockfile --non-interactive
npx yarn@1.22.22 --cwd "${aa_checkout}" install --frozen-lockfile --non-interactive

Comment on lines +139 to +141
(if $target.viaIR then .compiler_settings.viaIR == true else (.compiler_settings.viaIR // false) == false end) and
(if $target.key == "entry-point" then (.compiler_settings.metadata.bytecodeHash // "ipfs") == "ipfs"
else .compiler_settings.metadata.appendCBOR == false and .compiler_settings.metadata.bytecodeHash == "none" end)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If compiler_settings or metadata is null or missing in the Blockscout API response, accessing nested properties directly (e.g., .compiler_settings.metadata.bytecodeHash) will cause jq to crash with a Cannot index null with string ... error. This prints noisy errors to stderr and fails the verification check.

Using jq's optional chaining operator ? (e.g., .compiler_settings?.metadata?.bytecodeHash) safely navigates these fields and prevents any potential crashes or log pollution.

Suggested change
(if $target.viaIR then .compiler_settings.viaIR == true else (.compiler_settings.viaIR // false) == false end) and
(if $target.key == "entry-point" then (.compiler_settings.metadata.bytecodeHash // "ipfs") == "ipfs"
else .compiler_settings.metadata.appendCBOR == false and .compiler_settings.metadata.bytecodeHash == "none" end)
(if $target.viaIR then .compiler_settings?.viaIR == true else (.compiler_settings?.viaIR // false) == false end) and
(if $target.key == "entry-point" then (.compiler_settings?.metadata?.bytecodeHash // "ipfs") == "ipfs"
else .compiler_settings?.metadata?.appendCBOR == false and .compiler_settings?.metadata?.bytecodeHash == "none" end)

@JOY
JOY (JOY) marked this pull request as ready for review August 13, 2026 22:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@JOY
JOY (JOY) merged commit d7203ea into main Aug 13, 2026
12 checks passed
@JOY
JOY (JOY) deleted the codex/mainnet-aa-source-verification branch August 13, 2026 22:51
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.

1 participant