Skip to content

Commit 1d201cf

Browse files
authored
feat: deploy custom da validator (#396)
* feat: deploy custom da validator * fix: factory should have no custom da
1 parent a283db8 commit 1d201cf

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

scripts/deployOsp.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,28 @@ import { deployOneStepProofEntry } from './deploymentUtils'
44
async function main() {
55
const [deployer] = await ethers.getSigners()
66

7+
// Get custom DA validator address from environment variable
8+
const customDAValidator =
9+
process.env.CUSTOM_DA_VALIDATOR || ethers.constants.AddressZero
10+
711
console.log('Deploying OneStepProofEntry with the following configuration:')
812
console.log('Deployer:', deployer.address)
13+
console.log('Custom DA Validator:', customDAValidator)
914
console.log('Network:', (await ethers.provider.getNetwork()).name)
1015

16+
// Validate the custom DA validator address if provided
17+
if (customDAValidator !== ethers.constants.AddressZero) {
18+
// Check if the address has code deployed
19+
const code = await ethers.provider.getCode(customDAValidator)
20+
if (code === '0x') {
21+
console.warn('WARNING: Custom DA validator address has no code deployed')
22+
}
23+
}
24+
1125
// Deploy OneStepProofEntry and its dependencies
1226
const deployment = await deployOneStepProofEntry(
1327
deployer,
28+
customDAValidator,
1429
process.env.DISABLE_VERIFICATION !== 'true'
1530
)
1631

scripts/deploymentUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export async function create2(
165165

166166
export async function deployOneStepProofEntry(
167167
signer: any,
168+
customDAValidator: string,
168169
verify: boolean = true
169170
): Promise<{
170171
prover0: Contract
@@ -198,7 +199,7 @@ export async function deployOneStepProofEntry(
198199
const proverHostIo = await deployContract(
199200
'OneStepProverHostIo',
200201
signer,
201-
[ethers.constants.AddressZero],
202+
[customDAValidator],
202203
verify,
203204
true
204205
)
@@ -348,7 +349,7 @@ export async function deployAllContracts(
348349
true
349350
)
350351
const { prover0, proverMem, proverMath, proverHostIo, osp } =
351-
await deployOneStepProofEntry(signer, verify)
352+
await deployOneStepProofEntry(signer, ethers.constants.AddressZero, verify)
352353
const challengeManager = await deployContract(
353354
'EdgeChallengeManager',
354355
signer,

0 commit comments

Comments
 (0)