Skip to content

Commit b138bd5

Browse files
authored
fix: set default CHALLENGE_FINALITY in deployment scripts (#237)
- Mainnet: 150 epochs - Calibration: 10 epochs - Devnet: 10 epochs
1 parent 2302ea6 commit b138bd5

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
RPC_URL ?=
55
KEYSTORE ?=
66
PASSWORD ?=
7-
CHALLENGE_FINALITY ?=
87

98
# Default target
109
.PHONY: default

tools/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ A place for all tools related to running and developing the PDP contracts. When
44

55
## Deployment Scripts
66

7+
| Network | CHALLENGE_FINALITY |
8+
|-------------|-------------------|
9+
| Mainnet | 150 epochs |
10+
| Calibration | 10 epochs |
11+
| Devnet | 10 epochs |
12+
713
### deploy-devnet.sh
814
Deploys PDPVerifier to a local filecoin devnet. Assumes lotus binary is in path and local devnet is running with eth API enabled. The keystore will be funded automatically from lotus default address.
915

tools/deploy-calibnet.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ if [ -z "$KEYSTORE" ]; then
1717
exit 1
1818
fi
1919

20-
if [ -z "$CHALLENGE_FINALITY" ]; then
21-
echo "Error: CHALLENGE_FINALITY is not set"
22-
exit 1
23-
fi
20+
# Calibration testnet uses 10 epochs (vs 150 on mainnet)
21+
CHALLENGE_FINALITY=10
2422

2523
ADDR=$(cast wallet address --keystore "$KEYSTORE" --password "$PASSWORD")
2624
echo "Deploying PDP verifier from address $ADDR"

tools/deploy-devnet.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ echo "PDP verifier implementation deployed at: $VERIFIER_IMPLEMENTATION_ADDRESS"
3737

3838
NONCE=$(expr $NONCE + "1")
3939

40+
# Devnet uses 10 epochs (same as Calibration testnet)
41+
CHALLENGE_FINALITY=10
42+
4043
echo "Deploying PDP verifier proxy"
41-
INIT_DATA=$(cast calldata "initialize(uint256)" 150)
44+
INIT_DATA=$(cast calldata "initialize(uint256)" $CHALLENGE_FINALITY)
4245
PDP_VERIFIER_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --nonce $NONCE --broadcast src/ERC1967Proxy.sol:MyERC1967Proxy --constructor-args $VERIFIER_IMPLEMENTATION_ADDRESS $INIT_DATA | grep "Deployed to" | awk '{print $3}')
4346
echo "PDP verifier deployed at: $PDP_VERIFIER_ADDRESS"
4447

tools/deploy-mainnet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if [ -z "$KEYSTORE" ]; then
1717
exit 1
1818
fi
1919

20-
# CHALLENGE_FINALITY should always be 150 in production
21-
CHALLENGE_FINALITY=150
20+
# Mainnet uses 150 epochs (vs 10 on Calibration testnet)
21+
CHALLENGE_FINALITY=150
2222

2323
ADDR=$(cast wallet address --keystore "$KEYSTORE" --password "$PASSWORD")
2424
echo "Deploying PDP verifier from address $ADDR"

0 commit comments

Comments
 (0)