Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions .github/scripts/tempo-mpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ BLOCK2=$("$CAST" block-number --rpc-url "$RPC_MPP")
AFTER2=$("$CAST" erc20 balance "$TOKEN" "$WALLET" --rpc-url "$RPC" | awk '{print $1}')
SPENT2=$((BEFORE2 - AFTER2))
echo "Block: $BLOCK2"
echo "Spent: $SPENT2 units (should be 0 — channel reused from ~/.tempo/foundry/channels.json)"
echo "Spent: $SPENT2 units (should be 0 — channel reused from ~/.tempo/channels.db)"

# 6. forge script via MPP
echo ""
Expand All @@ -129,9 +129,9 @@ contract MppCheck is Script {
}
}
SOL
VCNT_BEFORE=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_BEFORE=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
"$FORGE" script "$TMPDIR/script/Mpp.s.sol" --rpc-url "$RPC_MPP" --root "$TMPDIR"
VCNT_AFTER=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_AFTER=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
echo "Vouchers paid: +$((VCNT_AFTER - VCNT_BEFORE)) ($((( VCNT_AFTER - VCNT_BEFORE ) / 1000)) RPC calls via MPP)"

# 7. forge test with vm.createSelectFork via MPP
Expand All @@ -149,15 +149,15 @@ contract MppForkTest is Test {
}
}
SOL
VCNT_BEFORE=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_BEFORE=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
"$FORGE" test --match-test test_fork_via_mpp --root "$TMPDIR" -vvv
VCNT_AFTER=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_AFTER=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
echo "Vouchers paid: +$((VCNT_AFTER - VCNT_BEFORE)) ($((( VCNT_AFTER - VCNT_BEFORE ) / 1000)) RPC calls via MPP)"

# 8. anvil fork via MPP
echo ""
echo "=== 8. anvil --fork-url (via MPP) ==="
VCNT_BEFORE=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_BEFORE=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
"$ANVIL" --fork-url "$RPC_MPP" --port 8555 --silent &
ANVIL_PID=$!
for _ in $(seq 1 30); do
Expand All @@ -167,15 +167,15 @@ done
echo "chain-id: $("$CAST" chain-id --rpc-url http://localhost:8555)"
kill $ANVIL_PID 2>/dev/null
wait $ANVIL_PID 2>/dev/null
VCNT_AFTER=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_AFTER=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
echo "Vouchers paid: +$((VCNT_AFTER - VCNT_BEFORE)) ($((( VCNT_AFTER - VCNT_BEFORE ) / 1000)) RPC calls via MPP)"

# 9. chisel fork via MPP
echo ""
echo "=== 9. chisel --fork-url (via MPP) ==="
VCNT_BEFORE=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_BEFORE=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
echo 'block.number' | "$CHISEL" --fork-url "$RPC_MPP" 2>&1 | grep -E "Decimal|Type"
VCNT_AFTER=$(grep cumulative_amount ~/.tempo/foundry/channels.json | awk -F'"' '{print $4}')
VCNT_AFTER=$(sqlite3 ~/.tempo/channels.db "SELECT cumulative_amount FROM channels LIMIT 1")
echo "Vouchers paid: +$((VCNT_AFTER - VCNT_BEFORE)) ($((( VCNT_AFTER - VCNT_BEFORE ) / 1000)) RPC calls via MPP)"

echo ""
Expand Down
92 changes: 70 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ svm = { package = "svm-rs", version = "0.5", default-features = false, features
] }

## foundry-core
foundry-wallets = { git = "https://github.com/foundry-rs/foundry-core", rev = "7f401c1397af90a0a94ef7424a48bbf3dc0248cc", default-features = false }
foundry-wallets = { git = "https://github.com/foundry-rs/foundry-core", rev = "e8c8be1", default-features = false }

## alloy
alloy-consensus = { version = "2.0.0", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ flate2.workspace = true
tempo-alloy.workspace = true
tempo-primitives.workspace = true
mpp.workspace = true
foundry-wallets.workspace = true

[build-dependencies]
chrono.workspace = true
Expand Down
Loading
Loading