Skip to content

feat: [E2E] Layer 2 — shim implementations#189

Open
sadiq1971 wants to merge 14 commits intomainfrom
feat/e2e-layer2-shim
Open

feat: [E2E] Layer 2 — shim implementations#189
sadiq1971 wants to merge 14 commits intomainfrom
feat/e2e-layer2-shim

Conversation

@sadiq1971
Copy link
Copy Markdown
Member

@sadiq1971 sadiq1971 commented Apr 6, 2026

Summary

Implements #180: Layer 2 of the E2E devstack — concrete implementations of all stack service interfaces.

Each shim is initialised from a ServiceManifest (produced by Layer 3 ServiceDiscovery) and wraps a real network client.

File Shim Notes
shim/anvil.go AnvilShim go-ethereum client; ERC20Balance via generated contracts.PromptToken; ApproveAndDeposit builds transactor, calls ApproveDepositToCanton, polls for receipts
shim/canton.go CantonShim Endpoint accessors; IsHealthy via HTTP GET
shim/apiserver.go APIServerShim All HTTP endpoints; EIP-191 signing for X-Signature/X-Message auth headers on transfer routes
shim/relayer.go RelayerShim GET /health, /ready, /api/v1/transfers, /api/v1/status
shim/indexer.go IndexerShim All /indexer/v1/admin/… endpoints with pagination query params
shim/postgres.go PostgresShim database/sql + lib/pq; whitelist insert (idempotent); user SELECT

Test plan

  • go build -tags e2e ./tests/e2e/... compiles cleanly
  • Each shim satisfies its stack interface (compile-time checked via interface assignments in Layer 4 System)

- Add `e2e-deploy` named volume to bootstrap container so the manifest survives until tests read it
- Write `/tmp/e2e-deploy.json` in docker-bootstrap.sh with contract addresses and issuer party IDs
- Add E2E test architecture design doc
…file targets (#178)

- Add tests/e2e/devstack/stack/interfaces.go: Anvil, Canton, APIServer,
  Relayer, Indexer, Postgres interfaces (build tag: e2e)
- Add tests/e2e/devstack/stack/types.go: ServiceManifest, Account,
  AnvilAccount0/1, all request/response/row types, indexer page types
- Add tests/e2e/docker-compose.e2e.yaml: thin include wrapper over root
  docker-compose.yaml; single entry point for E2E test runs
- Extend Makefile with test-e2e, test-e2e-api, test-e2e-bridge,
  test-e2e-indexer targets (stub: "not yet implemented")
Copy link
Copy Markdown
Contributor

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

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 introduces a devstack framework for E2E testing, featuring Docker Compose orchestration, service discovery, and client shims for all system components including Anvil, Canton, and the API server. Feedback includes a critical bug in the API server shim where string padding for eth_call payloads is incorrectly implemented using fmt.Sprintf, which results in space padding instead of zeros. Additionally, it is recommended to replace the use of http.DefaultClient with a configured client in the Canton shim and to avoid hardcoding magic numbers for gas limits in the Anvil shim.

Base automatically changed from feat/e2e-layer1-interfaces to main April 8, 2026 18:35
@sadiq1971
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

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

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 introduces a comprehensive set of shim implementations for E2E testing, covering Anvil, the API server, Canton, the indexer, Postgres, and the relayer. These shims provide typed wrappers for service interactions via REST, JSON-RPC, and SQL. The PR also refactors service discovery to remove unused database DSNs and updates the APIServer interface to support direct ethclient access. Feedback was provided to improve error handling when reading HTTP response bodies in the shared shim client.

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