Skip to content

Factory execution + SnapshotDB RW-set coverage for CREATE/CREATE2#151

Open
rootp1 wants to merge 6 commits into
hyperledger:mainfrom
rootp1:fix/issue-47-1
Open

Factory execution + SnapshotDB RW-set coverage for CREATE/CREATE2#151
rootp1 wants to merge 6 commits into
hyperledger:mainfrom
rootp1:fix/issue-47-1

Conversation

@rootp1

@rootp1 rootp1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Description

  1. Extends integration harness with a CREATE-based ProxyFactory fixture and strengthens the existing Uniswap CREATE2 path.
  2. Adds endorsement RW-set assertions to confirm child contract code/storage writes are captured and persist after commit.
  3. Validates success and failure paths for factory deployments using existing endorsementToRWS flow.
  4. Keeps execution plumbing unchanged (still using geth ApplyMessage and existing StateDB journaling).

Tests

  • go test ./integration -run TestLocal -count=1
  • go test ./integration -run TestLocalX -count=1

Related Issues

#47

PR1: validates execution and SnapshotDB states for CREATE and CREATE2 ops.
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
Copilot AI review requested due to automatic review settings May 4, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds factory-deployment integration coverage (CREATE + improved CREATE2 path) to ensure SnapshotDB read/write sets include child contract code/storage writes and that deployed contracts remain queryable after commit.

Changes:

  • Introduces a ProxyFactory Solidity fixture that deploys arbitrary initcode via CREATE.
  • Extends integration tests to (a) assert child contract code/nonce/storage writes appear in the endorsement RW-set and (b) validate gateway indexing (receipts, logs, code queries) for factory deployments.
  • Adds small EthClient helpers to endorse a state-changing call and then broadcast+wait for commit.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
solidity/ProxyFactory/ProxyFactory.sol New Solidity factory contract used to exercise CREATE-based deployments in integration tests.
integration/integration_test.go Adds proxy_factory test case and strengthens Uniswap CREATE2 coverage with RW-set assertions and indexing checks.
integration/ethclient.go Adds helper methods to endorse a transaction and broadcast it while waiting for commit.
integration/contracts/proxyfactory.gen.go Generated Go binding for the new ProxyFactory contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread solidity/ProxyFactory/ProxyFactory.sol
Comment thread integration/integration_test.go Outdated
Comment thread integration/integration_test.go
Comment thread integration/integration_test.go Outdated
Comment thread integration/integration_test.go Outdated
rootp1 added 5 commits May 4, 2026 15:20
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
Signed-off-by: rootp1 <arnav.iitr@gmail.com>
@rootp1

rootp1 commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@ale-linux, Please have a look whenever you get a chance to.

@ale-linux

Copy link
Copy Markdown
Contributor

I don't know what @arner or @kushnireyal think, but: while those tests served us well at the beginning of the project, I think now we have coverage for create2 and create in the ethereum tests, and I think the hardhat-tests makefile target already uses proxy-style smart contracts (pls correct me if I'm wrong @kushnireyal).

Do we also want these?

@kushnireyal

Copy link
Copy Markdown
Contributor

I don't know what @arner or @kushnireyal think, but: while those tests served us well at the beginning of the project, I think now we have coverage for create2 and create in the ethereum tests, and I think the hardhat-tests makefile target already uses proxy-style smart contracts (pls correct me if I'm wrong @kushnireyal).

Do we also want these?

Good question. The Hardhat tests test the EVM behavior as a black box, so we don't verify RW sets for CREATE and CREATE2-deployed contract. Also, there are additional assertions around Gateway-level behavior (log indexing, receipt semantics, code queryability) that Hardhat doesn't currently cover (some of those may become redundant as Hardhat coverage grows, but they're filling a real gap today)

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.

4 participants