Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NONEVM-984][solana] - Reorg Detection + lighter rpc call #951

Draft
wants to merge 89 commits into
base: develop
Choose a base branch
from

Conversation

Farber98
Copy link
Contributor

@Farber98 Farber98 commented Nov 28, 2024

Description

  • Track transaction statuses on per signature basis to identify which signature for a transaction was included to detect re-orgs specifically for it
  • Update the confirmation logic to identify regression in a signature’s transaction status when no or processed status is received to detect re-orgs
    • A transaction can revert back to no status or processed from confirmed status
    • A transaction can revert back to no status from processed status
  • If a re-org is detected
    • from confirmed, restart the retry/bump loop
    • from processed, we don't do nothing and it's handled by expiration rebroadcast if needed later

Tickets

Soak Testing

@@ -570,14 +640,14 @@ func (txm *Txm) handleFinalizedSignatureStatus(sig solanaGo.Signature) {
// An expired tx is one where it's blockhash lastValidBlockHeight (last valid block number) is smaller than the current block height (block number).
// If any error occurs during rebroadcast attempt, they are discarded, and the function continues with the next transaction.
func (txm *Txm) rebroadcastExpiredTxs(ctx context.Context, client client.ReaderWriter) {
currBlock, err := client.GetLatestBlock(ctx)
if err != nil || currBlock == nil || currBlock.BlockHeight == nil {
blockHeight, err := client.GetLatestBlockHeight(ctx)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is out of scope of the reorg, but pushing it here so we don't need to make a separate merge: https://smartcontract-it.atlassian.net/browse/NONEVM-1015

@@ -331,6 +333,19 @@ func (c *Client) GetLatestBlock(ctx context.Context) (*rpc.GetBlockResult, error
return v.(*rpc.GetBlockResult), err
}

// GetLatestBlockHeight returns the latest block height of the node based on the configured commitment type
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is out of scope of the reorg, but pushing it here so we don't need to make a separate merge: smartcontract-it.atlassian.net/browse/NONEVM-1015

@Farber98 Farber98 changed the title [NONEVM-984][solana] - Reorg Detection [NONEVM-984][solana] - Reorg Detection + lighter rpc call Dec 12, 2024
Base automatically changed from backup-branch-fee-bumping to develop December 19, 2024 17:34
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.

2 participants