File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,19 @@ task("kms:deploy", "Deploy the DstackKms contract")
108108 await appContractImpl . waitForDeployment ( ) ;
109109 appImplementation = await appContractImpl . getAddress ( ) ;
110110 console . log ( "✅ DstackApp implementation deployed to:" , appImplementation ) ;
111+
112+ // Wait for RPC nonce to catch up (public RPCs may return stale nonce)
113+ const tx = appContractImpl . deploymentTransaction ( ) ;
114+ if ( tx ) {
115+ const expectedNonce = tx . nonce + 1 ;
116+ for ( let i = 0 ; i < 10 ; i ++ ) {
117+ const latestNonce = await ethers . provider . getTransactionCount ( deployerAddress , "latest" ) ;
118+ if ( latestNonce >= expectedNonce ) break ;
119+ await new Promise ( r => setTimeout ( r , 1500 ) ) ;
120+ }
121+ }
111122 }
112-
123+
113124 if ( appImplementation !== ethers . ZeroAddress ) {
114125 console . log ( "Setting DstackApp implementation during initialization:" , appImplementation ) ;
115126 }
You can’t perform that action at this time.
0 commit comments