solana-playground / solana-playground

Quickly develop, deploy and test Solana programs from browsers
https://beta.solpg.io
Apache License 2.0
399 stars 135 forks source link

Upgrade program #213

Closed CryptoUncleSam closed 2 months ago

CryptoUncleSam commented 2 months ago

When trying to upgrade a program on mainnet it send and retries all tx to write the buffer (everything good here) but the final tx for Bpf-Upgradeable-Loader: Upgrade is only sent once and is not confirming that actually is landing or confirmed so it end up saying Upgrade/Deploy success when is not true so should have kind of same logic of txs of writings buffer to retry till actually is confirmed.

acheroncrypto commented 2 months ago

It should retry 5 times for the last transaction and also confirm it too:

https://github.com/solana-playground/solana-playground/blob/3629cd2768176ea79e00844624893827e73b8c27/client/src/commands/deploy/deploy.ts#L258-L259

https://github.com/solana-playground/solana-playground/blob/3629cd2768176ea79e00844624893827e73b8c27/client/src/commands/deploy/deploy.ts#L305-L316

Maybe it somehow got confirmed incorrectly?

CryptoUncleSam commented 2 months ago

I see! For me basically for last tx the terminal says upgrade successfully but there's no confirm/fail going thru. Even if I click the pop up with the tx. Explorer just say tx doesn't exist

acheroncrypto commented 2 months ago

I think confirming the transaction is unreliable and sometimes returns false positives. https://github.com/solana-playground/solana-playground/commit/99a355ff0def83b1997542dd0535555072bf218b should fix it:

https://github.com/solana-playground/solana-playground/blob/99a355ff0def83b1997542dd0535555072bf218b/client/src/commands/deploy/deploy.ts#L313-L316

Closing, feel free to reopen if the problem continues. Thanks for the report!

CryptoUncleSam commented 2 months ago

it worked correctly now! I was able to upgrade