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

Accept relayed tx v3 with sender account non-existent #6677

Merged
merged 3 commits into from
Dec 16, 2024

Conversation

sstanculeanu
Copy link
Collaborator

Reasoning behind the pull request

  • relayed txs v3 with sender account not-existent are rejected by interceptors, despite the zero value of transaction

Proposed changes

  • allow relayed txs v3 with new senders, in case of zero value transactions

Testing procedure

  • with feat branch

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

andreibancioiu
andreibancioiu previously approved these changes Dec 16, 2024
accountHandler, err := txv.getSenderAccount(interceptedTx)
if err != nil {
if err != nil && !shouldAllowMissingSenderAccount {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we check for ErrAccountNotFound (explicitly)? Just a question.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it is necessary, as ErrAccountNotFound is the only one returned from getSenderAccount method

return err
}

return txv.checkAccount(interceptedTx, accountHandler)
}

func hasTxValue(interceptedTx process.InterceptedTransactionHandler) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed, we don't handle MultiESDTTransfer with EGLD in interceptor (we never did, but that is OK).

return false
}

return big.NewInt(0).Cmp(txValue) < 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe directly use Sign() method of txValue, without instantiating a new big int (zero)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pushed

Base automatically changed from MX-16294-mempool-selection-relayed to feat/relayedv3 December 16, 2024 08:01
@sstanculeanu sstanculeanu dismissed andreibancioiu’s stale review December 16, 2024 08:01

The base branch was changed.

@sstanculeanu sstanculeanu marked this pull request as ready for review December 16, 2024 08:01
@AdoAdoAdo AdoAdoAdo self-requested a review December 16, 2024 08:01
@sstanculeanu sstanculeanu merged commit 6140ea4 into feat/relayedv3 Dec 16, 2024
4 checks passed
@sstanculeanu sstanculeanu deleted the rv3_non_existent_sender branch December 16, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants