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

feat: add tx confirm func and create virtual group retry #981

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

will-2012
Copy link
Collaborator

@will-2012 will-2012 commented Aug 7, 2023

Description

Add tx confirm func and create virtual group retry.

Rationale

Send tx and query tx hash, in order to ensure the tx executed by chain.

Example

N/A.

Changes

Notable changes:

  • signer/chain client.

@will-2012 will-2012 added the wip Working in process label Aug 7, 2023
@will-2012 will-2012 marked this pull request as draft August 7, 2023 09:40
@will-2012 will-2012 changed the title feat: add tx confirm feat: add tx confirm func and create virtual group retry Aug 7, 2023
@will-2012 will-2012 added r4r Ready for review and removed wip Working in process labels Aug 7, 2023
@will-2012 will-2012 marked this pull request as ready for review August 7, 2023 14:18
@@ -783,3 +787,70 @@ func (g *Gnfd) VerifyPutObjectPermission(ctx context.Context, account, bucket, o
}
return false, err
}

// ConfirmTransaction is used to confirm whether the transaction is on the chain.
func (g *Gnfd) ConfirmTransaction(ctx context.Context, txHash string) (*sdk.TxResponse, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It should have a timeout for retry.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, only retry once and there is a timeout in waitForNextBlock.

Copy link
Collaborator

@fynnss fynnss Aug 8, 2023

Choose a reason for hiding this comment

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

Why only retry once? The transaction may be completed after several blocks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Retrying once basically guarantees whether it is in the current block or the next block.
what is the suggestion here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

At least 3 blocks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Collaborator

@sysvm sysvm left a comment

Choose a reason for hiding this comment

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

LGTM

@will-2012 will-2012 added this pull request to the merge queue Aug 8, 2023
Merged via the queue into develop with commit d4bfabf Aug 8, 2023
7 checks passed
@will-2012 will-2012 deleted the fix-develop branch August 8, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r4r Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants