Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1cb990d
feat(runtime): wire pallet_revive into both runtimes (issue #83 step 1)
ilchu May 27, 2026
2afca09
feat(precompiles): storage-provider + drive-registry pallet_revive pr…
ilchu May 27, 2026
348975a
feat(examples): StorageMarketplace.sol example contract (issue #83 st…
ilchu May 27, 2026
db9f8a7
feat(papi): pure-PAPI e2e driver + per-selector coverage (issue #83 s…
ilchu May 27, 2026
875c13b
feat(just): build-contracts + sc-demo + sc-coverage recipes (issue #8…
ilchu May 27, 2026
b9eee89
ci: install solc/resolc and run sc-demo + sc-coverage (issue #83 step 6)
ilchu May 27, 2026
8c87fb0
docs: smart-contract architecture, precompile ABI tables (issue #83 s…
ilchu May 27, 2026
5346764
fix(papi): bump default proof_size to fit deleteDrive
ilchu May 27, 2026
5568143
feat(precompiles): pallet_s3_registry precompile (issue #83 follow-up)
ilchu May 27, 2026
69b9147
feat(examples): SharedTeamDrive dApp + e2e (issue #83 follow-up)
ilchu May 27, 2026
b07ac53
feat(examples): TokenGatedDrive dApp + s3 docs (issue #83 follow-up)
ilchu May 27, 2026
0e572e4
fix(ci): drop comment line from .github/env
ilchu May 27, 2026
48b6621
fix(papi): drop unused imports + add missing bucketC id assertion
ilchu May 27, 2026
c4390a5
fix(precompiles): propagate s3-registry try-runtime in s3 precompile
ilchu May 28, 2026
3f0a2c1
fix(ci): pin solc to 0.8.34 (resolc 1.1.0 rejects 0.8.35)
ilchu May 28, 2026
3d735f4
fix(papi): silence non-target providers before sc demos
ilchu May 28, 2026
face2ef
ci: split sc demos into a parallel job
ilchu May 28, 2026
86c48ca
Merge branch 'dev' into ic/smart-contract-revive
ilchu May 29, 2026
01bb91d
Merge branch 'dev' into ic/smart-contract-revive
ilchu Jun 1, 2026
873ad98
Update from github-actions[bot] running command 'bench --pallet palle…
github-actions[bot] Jun 1, 2026
7ec6c38
Update from github-actions[bot] running command 'bench'
github-actions[bot] Jun 1, 2026
97a1979
Merge branch 'dev' into ic/smart-contract-revive
ilchu Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/env
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ POLKADOT_SDK_VERSION=polkadot-stable2603
ZOMBIENET_VERSION=v0.4.11
CI_IMAGE=docker.io/paritytech/ci-unified:bullseye-1.93.0-2026-01-27-v202603042356
NODE_VERSION=22
SOLC_VERSION=0.8.34
RESOLC_VERSION=1.1.0
171 changes: 170 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,178 @@ jobs:
/tmp/zombie-*/*-plain.json
/tmp/zombie-*/*-raw.json

# Smart-contract demos run in a parallel job with their own chain +
# provider — the sequential time of L0 demos + fs/s3 lifecycles + sc demos
# was bumping against the 60-minute job timeout. Parallel splits the
# wall-clock roughly in half; SC tests only need //Alice as a provider.
sc-integration-tests:
name: SC Integration Tests (${{ matrix.runtime.name }})
runs-on: parity-large
timeout-minutes: 60
needs: [set-image, runtime-matrix]
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
strategy:
fail-fast: false
matrix:
runtime: ${{ fromJSON(needs.runtime-matrix.outputs.runtime) }}
steps:
- name: Checkout sources
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Load common environment variables via env file
run: cat .github/env >> $GITHUB_ENV

- name: Rust cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
shared-key: "sc-integration-tests-${{ matrix.runtime.name }}"
save-if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }}

- name: Install just
run: cargo install just --locked || true

- name: Cache Polkadot SDK binaries
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
id: sdk-cache
with:
path: |
.bin/polkadot
.bin/polkadot-execute-worker
.bin/polkadot-prepare-worker
.bin/polkadot-omni-node
.bin/chain-spec-builder
key: polkadot-sdk-${{ env.POLKADOT_SDK_VERSION }}

- name: Download Polkadot SDK binaries
if: steps.sdk-cache.outputs.cache-hit != 'true'
run: just polkadot_version=${{ env.POLKADOT_SDK_VERSION }} download-polkadot-sdk-binaries

- name: Cache zombienet
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
id: zombienet-cache
with:
path: .bin/zombienet
key: zombienet-${{ env.ZOMBIENET_VERSION }}

- name: Download zombienet
if: steps.zombienet-cache.outputs.cache-hit != 'true'
run: just zombienet_version=${{ env.ZOMBIENET_VERSION }} download-zombienet

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install solc and resolc
run: |
curl -L -o /usr/local/bin/solc \
"https://github.com/ethereum/solidity/releases/download/v${SOLC_VERSION}/solc-static-linux"
curl -L -o /usr/local/bin/resolc \
"https://github.com/paritytech/revive/releases/download/v${RESOLC_VERSION}/resolc-x86_64-unknown-linux-musl"
chmod +x /usr/local/bin/solc /usr/local/bin/resolc
solc --version
resolc --version

- name: Build runtime and provider
run: just ${{ matrix.runtime.build_command }} && just build-provider

- name: Build example contracts
run: just build-contracts

- name: Start chain and wait for blocks
run: |
nohup env PROJECT_ROOT=$(pwd) .bin/zombienet spawn -p native ${{ matrix.runtime.zombienet_config }} > /tmp/zombienet.log 2>&1 &
ZOMBIE_PID=$!
echo "Waiting for zombienet to set up nodes..."
sleep 15
if ! kill -0 $ZOMBIE_PID 2>/dev/null; then
echo "ERROR: zombienet exited early"
cat /tmp/zombienet.log || true
exit 1
fi
echo "Waiting for parachain to produce finalized blocks..."
for i in $(seq 1 180); do
RESPONSE=$(curl -s -H "Content-Type: application/json" \
-d '{"id":1,"jsonrpc":"2.0","method":"chain_getFinalizedHead","params":[]}' \
http://127.0.0.1:2222 2>/dev/null) || true
FINALIZED_HASH=$(echo "$RESPONSE" | jq -r '.result // empty' 2>/dev/null)
if [ -n "$FINALIZED_HASH" ]; then
HEADER=$(curl -s -H "Content-Type: application/json" \
-d "{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"chain_getHeader\",\"params\":[\"$FINALIZED_HASH\"]}" \
http://127.0.0.1:2222 2>/dev/null) || true
BLOCK_HEX=$(echo "$HEADER" | jq -r '.result.number // empty' 2>/dev/null)
if [ -n "$BLOCK_HEX" ]; then
BLOCK_NUM=$((BLOCK_HEX))
if [ "$BLOCK_NUM" -ge 1 ]; then
echo "Parachain finalized block: #$BLOCK_NUM (attempt $i)"
break
fi
fi
fi
if [ "$i" -eq 180 ]; then
echo "TIMEOUT: parachain did not finalize blocks"
exit 1
fi
sleep 5
done

- name: Start provider (inmemory) and wait for health
run: |
echo "//Alice" > /tmp/alice-key && chmod 600 /tmp/alice-key
nohup ./target/release/storage-provider-node \
--keyfile /tmp/alice-key --storage-mode inmemory \
--bind-addr 0.0.0.0:3333 --chain-rpc ws://127.0.0.1:2222 \
--enable-agreement-coordinator --enable-checkpoint-coordinator \
> /tmp/provider.log 2>&1 &
for i in $(seq 1 60); do
if curl -s http://127.0.0.1:3333/health | jq -e '.status' > /dev/null 2>&1; then
echo "Provider is healthy (attempt $i)"
break
fi
if [ "$i" -eq 60 ]; then
echo "Timeout: provider did not become healthy"
cat /tmp/provider.log || true
exit 1
fi
sleep 2
done

- name: Run smart-contract end-to-end demo
run: just sc-demo "http://127.0.0.1:3333" "//Alice" "//Bob"

- name: Run smart-contract precompile-coverage e2e
run: just drain-tx-pool-then sc-coverage "http://127.0.0.1:3333" "//Alice" "//Bob"

- name: Run SharedTeamDrive dApp e2e
run: just drain-tx-pool-then sc-team-drive "http://127.0.0.1:3333" "//Alice" "//Bob"

- name: Run TokenGatedDrive dApp e2e
run: just drain-tx-pool-then sc-token-gated "http://127.0.0.1:3333" "//Alice" "//Bob"

- name: Stop services
if: always()
run: |
pkill -f "polkadot-omni-node" 2>/dev/null || true
pkill -f "polkadot" 2>/dev/null || true
pkill -f "storage-provider-node" 2>/dev/null || true

- name: Upload logs (on failure)
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sc-integration-test-logs-${{ matrix.runtime.name }}
path: |
/tmp/zombienet.log
/tmp/provider.log
/tmp/zombie-*/*.log
/tmp/zombie-*/**/*.log
/tmp/zombie-*/*-plain.json
/tmp/zombie-*/*-raw.json

integration-tests-complete:
name: Integration Tests
needs: [integration-tests]
needs: [integration-tests, sc-integration-tests]
if: always()
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ web3-storage/
├── primitives/ # Layer 0 shared types and utilities
│ ├── src/lib.rs # Common types
│ └── Cargo.toml # Primitive dependencies
├── precompiles/ # pallet_revive precompiles (Solidity → pallets)
│ ├── storage-provider-precompile/ # 0x…0901 — bucket lifecycle
│ └── drive-registry-precompile/ # 0x…0902 — drive lifecycle
├── examples/contracts/ # Example Solidity dApps (StorageMarketplace.sol)
├── storage-interfaces/ # Layer 1 - High-level interfaces
│ └── file-system/ # File System Interface
│ ├── primitives/ # File system types (DriveInfo, CommitStrategy, etc.)
Expand Down Expand Up @@ -278,6 +282,8 @@ web3-storage/

**Primitives (`primitives/`)**: Shared types used across pallet, provider node, and client.

**Smart Contracts (`precompiles/`, `examples/contracts/`)**: `pallet_revive` (PolkaVM-based smart contracts) is wired into both runtimes. Two custom precompiles expose the client-side bucket lifecycle and drive registry to Solidity contracts. The `StorageMarketplace.sol` example shows how a dApp buys storage on behalf of its users; `just sc-demo` runs the end-to-end PAPI test. Full design in [docs/design/smart-contracts.md](docs/design/smart-contracts.md).

#### Layer 1 (File System Interface)

**File System Primitives (`storage-interfaces/file-system/primitives/`)**: High-level types for file system:
Expand Down
Loading
Loading