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

Add XRPL tx finality check. #48

Merged
merged 4 commits into from
Nov 28, 2023
Merged

Conversation

dzmitryhil
Copy link
Contributor

@dzmitryhil dzmitryhil commented Nov 16, 2023

Description

Add XRPL tx finality check.

XRPL tx finality spec: https://xrpl.org/finality-of-results.html

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@dzmitryhil dzmitryhil requested a review from a team as a code owner November 16, 2023 13:06
@dzmitryhil dzmitryhil requested review from miladz68, ysv and wojtek-coreum and removed request for a team November 16, 2023 13:06
wojtek-coreum
wojtek-coreum previously approved these changes Nov 20, 2023
Copy link
Collaborator

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @miladz68 and @ysv)

Copy link
Collaborator

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dzmitryhil and @miladz68)


relayer/processes/xrpl_tx_observer.go line 269 at r1 (raw file):

// Any tem code	 Final unless the protocol changes to make the transaction valid.
// tefPAST_SEQ	 Final when another transaction with the same sequence number is included in a validated ledger.
// tefMAX_LEDGER Final when a validated ledger has a ledger index higher than the transaction's LastLedgerSequence field, and no validated ledger includes the transaction.

I don't fully understand this
lets probably discuss after call


relayer/processes/xrpl_tx_observer.go line 272 at r1 (raw file):

func txIsFinal(tx rippledata.TransactionWithMetaData) bool {
	txResult := tx.MetaData.TransactionResult
	if tx.MetaData.TransactionResult.Success() ||

nit:

if and second return is not needed here. You can just write

return tx.MetaData.TransactionResult.Success() || ...

Copy link
Contributor Author

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68 and @ysv)


relayer/processes/xrpl_tx_observer.go line 269 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

I don't fully understand this
lets probably discuss after call

Sure


relayer/processes/xrpl_tx_observer.go line 272 at r1 (raw file):

Previously, ysv (Yaroslav Savchuk) wrote…

nit:

if and second return is not needed here. You can just write

return tx.MetaData.TransactionResult.Success() || ...

Rright, updated.

wojtek-coreum
wojtek-coreum previously approved these changes Nov 20, 2023
Copy link
Collaborator

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @miladz68 and @ysv)

Copy link
Collaborator

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68)

ysv
ysv previously approved these changes Nov 22, 2023
Copy link
Collaborator

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @miladz68)

# Conflicts:
#	relayer/processes/xrpl_tx_observer.go
#	relayer/xrpl/constatns.go
@dzmitryhil dzmitryhil dismissed stale reviews from ysv and wojtek-coreum via 612fdff November 24, 2023 11:38
Copy link
Collaborator

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dzmitryhil, @miladz68, and @ysv)


relayer/xrpl/constatns.go line 8 at r3 (raw file):

	TecPathDryTxResult = "tecPATH_DRY"
	// TefNOTicketTxResult defines the result which indicates the usage of the passed ticket or not created ticket.
	// TefNOTicketTxResult defines that the usage of the passed ticket or not created ticket.

duplicated

Copy link
Contributor Author

@dzmitryhil dzmitryhil left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @miladz68, @wojtek-coreum, and @ysv)


relayer/xrpl/constatns.go line 8 at r3 (raw file):

Previously, wojtek-coreum (Wojtek) wrote…

duplicated

Done.

Copy link
Contributor

@miladz68 miladz68 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @wojtek-coreum and @ysv)

Copy link
Collaborator

@ysv ysv left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @wojtek-coreum)

Copy link
Collaborator

@wojtek-coreum wojtek-coreum left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dzmitryhil)

@dzmitryhil dzmitryhil merged commit 78f24b3 into master Nov 28, 2023
4 checks passed
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