Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

This PR updates the price pusher code to cause a crash when the RPC has issues. The RPC issues can be either the target network or Hermes.

This also solves #1704.

@ali-behjati ali-behjati requested review from guibescos and m30m June 25, 2024 11:49
@vercel
Copy link

vercel bot commented Jun 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 25, 2024 5:11pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 25, 2024 5:11pm

version: objectResponse.data!.version,
};
} else {
throw new Error("Failed to refresh object reference");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how often this may happen, but if it fails frequently and causes crashes, there is a higher chance that we lock all the gas price objects

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During my experiments I think I've resolved the issue of locked gases. It seems that it happens when we reuse a gas coin upon crash/restarts. I changed our deployment configuration to never allow to live instances at the same time and wait 10s before starting a new instance to make sure older ones are settled. No locking issues since this change.

I'll also run this code for sui for a day or so before merging to see how it works.

Copy link
Contributor

@guibescos guibescos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debugged it a bit, found couple of bugs

@ali-behjati ali-behjati force-pushed the price-pusher/refactor branch from 87c3623 to 8de8d28 Compare June 25, 2024 17:09
logger: Logger
): Promise<SuiObjectRef[]> {
const signerAddress = await signer.toSuiAddress();
const signerAddress = signer.toSuiAddress();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by: linter

Comment on lines -211 to -216
pythPackageId,
pythStateId,
wormholePackageId,
wormholeStateId,
endpoint,
keypair,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive-by: linter

this.logger.info({ signatures }, "updatePriceFeed successful");
} catch (err: any) {
this.logger.error(err, "updatePriceFeed failed");
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this return doesn't seem to do anything

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol it was there before and i removed it. added it back to minimize the changes.

@ali-behjati ali-behjati merged commit 87aea6f into main Jun 26, 2024
@ali-behjati ali-behjati deleted the price-pusher/refactor branch June 26, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants