Skip to content

pod network integration (Shadow mode)#4205

Draft
AryanGodara wants to merge 22 commits intomainfrom
aryan/pod-network-integration
Draft

pod network integration (Shadow mode)#4205
AryanGodara wants to merge 22 commits intomainfrom
aryan/pod-network-integration

Conversation

@AryanGodara
Copy link
Copy Markdown
Member

@AryanGodara AryanGodara commented Feb 24, 2026

New Crates & Modules

  • winner-selection: Deterministic solution hashing and combinatorial auction arbitration logic

Driver Pod Flow

  • After computing a solution, driver submits bid to pod network
  • Waits for auction deadline, fetches all bids, runs local winner selection
  • Shadow mode: bid failures log warnings only, never block main flow

Configuration

  • New [pod] TOML section: endpoint, auction_contract, wallet config
  • Nonce/balance logging on provider init for debugging

E2E Tests

  • pod_test_basic: Single solver bid submission + winner verification
  • pod_test_multi_order: Multiple orders in single auction
  • pod_test_multi_solver: Competing solvers with haircut-based score differentiation

Bug Fixes

  • Dynamic WETH address lookup
  • Graceful handling of None scores
  • Shadow mode for pod failures (non-blocking)

How to Test

Local Services

1. Start anvil in fork mode for mainnet.

1a. state override to bypass solver whitelisting requirement
❯ cast rpc -r http://127.0.0.1:8545 anvil_setCode \     
  0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE \
  0x600160005260206000F3

2. Start services DB and perform migrations (if not running)

3. Start services (update configs with actual working values for DB URL, etc. for your local machine; you don't have to make any changes to existing configs to support the pod-network addition

cargo run -p driver -- --config configs/local/driver.toml
cargo run -p autopilot -- --config configs/local/autopilot.toml
cargo run -p orderbook -- --config configs/local/orderbook.toml

5. Submit order via API and check logs for:

#    - "pod provider initialized" with signer_address, balance, nonce
#    - "preparing bid submission" with score and payload_len
#    - "bid submitted successfully" OR "pod bid submission failed (shadow mode)"
#    - "fetched bids" with num_participants

E2E Tests

# Run all pod tests
cargo nextest run -p e2e pod_test --run-ignored ignored-only --test-threads 1

Known Issues (waiting on response)

Pending TX on Pod Network

Bid submission fails with:

error code -32603: failed to send transaction: 
Another transaction 0x... is still pending

Details:

  • Pod endpoint: http://cow.pod.network:8545
  • Auction contract: 0xeDD0670497E00ded712a398563Ea938A29dD28c7
  • Affected address: 0xf985d2cf3f3c5cfc798d8e9e4ebdd6777653c3cb
  • Current nonce: 47, balance: ~10 ETH

Forwarded to pod team - tests will fail until resolved. Shadow mode ensures main flow continues.


Related

@AryanGodara AryanGodara self-assigned this Feb 24, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 24, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@AryanGodara AryanGodara force-pushed the aryan/pod-network-integration branch from aff7b2c to dad9d3d Compare February 24, 2026 18:59
@MartinquaXD MartinquaXD mentioned this pull request Mar 3, 2026
2 tasks
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

@github-actions github-actions bot added the stale label Mar 4, 2026
@AryanGodara AryanGodara removed the stale label Mar 9, 2026
Comment on lines +229 to +231
[pod]
endpoint = {:?}
auction-contract-address = {:?}
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.

This should be moved to the start_driver_with_config_override callsite where you setup your e2e

@github-actions
Copy link
Copy Markdown

This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed.

@github-actions github-actions bot added the stale label Mar 18, 2026
@github-actions github-actions bot closed this Mar 26, 2026
@AryanGodara AryanGodara reopened this Mar 31, 2026
@AryanGodara AryanGodara removed the stale label Mar 31, 2026
@AryanGodara AryanGodara force-pushed the aryan/pod-network-integration branch from 99c8b62 to 78a3e71 Compare March 31, 2026 14:14
Comment on lines +4396 to +4409
[[package]]
name = "jsonwebtoken"
version = "9.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde"
dependencies = [
"base64 0.22.1",
"js-sys",
"pem",
"ring",
"serde",
"serde_json",
"simple_asn1",
]

Check warning

Code scanning / Trivy

jsonwebtoken: jsonwebtoken has Type Confusion that leads to potential authorization bypass Medium

Package: jsonwebtoken
Installed Version: 9.3.1
Vulnerability CVE-2026-25537
Severity: MEDIUM
Fixed Version: 10.3.0
Link: CVE-2026-25537
@AryanGodara AryanGodara force-pushed the aryan/pod-network-integration branch from e32884c to 7f0f75c Compare April 3, 2026 13:01
@AryanGodara
Copy link
Copy Markdown
Member Author

Pod Integration: Design Decisions (more context apart from PR description)

Shadow Mode Architecture

Pod integration runs in shadow mode, so bid submission failures are logged as warnings but never block the protocol flow.

Haircut-Based Score Differentiation (fo rthe e2e Tests)

Since i'm using 2 instances of baseline solvers to simulate competition for the e2e tests; they produce the same flowTwo solvers competing for the same order find identical routes → identical scores.

Solution

Use haircut_bps parameter to artificially differentiate scores:

  • Solver A: haircut_bps = 0 (full score)
  • Solver B: haircut_bps = 5000 (50% haircut → lower score)

This reliably produces different scores for testing pod winner selection without complex liquidity setup.

Nonce/Pending TX Handling

Current Issue

Pod network rejects new TXs when previous ones from same sender are pending:

error code -32603: Another transaction 0x... is still pending

Approach

  • Log nonce on provider init for debugging
  • Shadow mode ensures failures don't block main flow
  • Pod team to resolve stuck TXs on their end
  • Future: pod-sdk should handle nonce conflicts internally (replace-by-fee)

Deterministic Test Addresses

E2E tests use deterministic addresses derived from Anvil's default mnemonic. Pre-funding these on pod network:

  • 0xf985d2cf3f3c5cfc798d8e9e4ebdd6777653c3cb - solver 1
  • 0x9315fc8ffae493123b9b6b1c93d50c9b9eef0344 - solver 2

Both funded with ~10 ETH on pod network.

Config Structure

[pod]
endpoint = "http://cow.pod.network:8545"
auction-contract = "0xeDD0670497E00ded712a398563Ea938A29dD28c7"

Wallet uses existing [account] section - no separate pod wallet config needed.

ogabrielides and others added 13 commits April 7, 2026 19:21
- Remove spurious pub mod bad_tokens (competition/mod.rs), pub mod fee
  (e2e setup/mod.rs), and participation_guard re-export (autopilot)
- Replace derivative crate with manual Debug impl for Solver
- Remove unused primitive-types dependency
- Delete HANDOFF_PROMPT.md and PLAYGROUND_DEEP_DIVE.md (not part of pod feature)
…twork testing

- Add autopilot.toml with driver configurations (required by new --config CLI arg)
- Fix driver2.toml: add missing tx-gas-limit, correct solver name/endpoint to baseline2
- Fix NATIVE_PRICE_ESTIMATORS format in compose files (add Driver| prefix for baseline2)
- Mount autopilot.toml in docker-compose.non-interactive.yml

The autopilot binary now requires a --config TOML file specifying drivers and fee
policies, replacing the previous DRIVERS environment variable approach.
…ebase to latest main branch, get test and services compiling again
…rbosity

- Add test-pod-verbose justfile target for detailed test output
- Replace [pod] log prefixes with structured tracing spans (pod_flow, pod_submit_bid, pod_fetch_bids, pod_local_arbitration)
- Move auction_id and solver context to span fields instead of repeating in each log
- Reduce log noise: change balance fetch failure from error to warn, make signer type selection debug-level
- Add debug-level payload hex logging,
@AryanGodara AryanGodara force-pushed the aryan/pod-network-integration branch from eec3eab to 62e7fc4 Compare April 7, 2026 13:51
@ogabrielides
Copy link
Copy Markdown

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 7, 2026
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.

Pod Integration (Shadow Mode)

4 participants