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

Fix duplicated txs into tx pool api response #4424

Merged
merged 2 commits into from Aug 31, 2022

Conversation

sstanculeanu
Copy link
Contributor

@sstanculeanu sstanculeanu commented Aug 31, 2022

Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)

  • same tx is displayed multiple times in the response of /transaction/pool?by-sender=erd1... as ShardDataStore returns the same data storer for all ids "0", "0_1", "0_2", "0_META"

Proposed Changes

  • removed the iteration through all data stores with ids sourceShard_destinationShard as they all point to the same one, leading to duplicates

Testing procedure

  • scenario:
    • get one or 2 txs in pool(save the sender if possible..if not, get /transaction/pool on the observer from the shard you sent txsf and copy a sender address)
    • running /transaction/pool?by-sender=sender_addr_from_above_point on either proxy or intra shard observer, tyou should not the duplicates among tx hashes received in response

… with id = shard_otherShard as they point to the same one
@sstanculeanu sstanculeanu marked this pull request as ready for review August 31, 2022 13:37
@iulianpascalau iulianpascalau self-requested a review August 31, 2022 16:54

txs := txCache.GetTransactionsPoolForSender(sender)
txsForSender = append(txsForSender, txs...)
cacheId := process.ShardCacherIdentifier(senderShard, senderShard)
Copy link
Contributor

Choose a reason for hiding this comment

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

so this will work despite the fact that a transaction might be cross shard? On both nodes: sender & destination?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, as verified with @andreibancioiu and can be seen here, no matter the destination shard, there will always be returned the source id.

the problem was observed on a transaction from shard 0 to shard 1, when the same transaction was returned 4 times from a shard 0 observer.

also, @gabi-vuls confirmed that testing was made with cross shard txs.

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.

@gabi-vuls gabi-vuls merged commit 8816bd7 into rc/2022-july Aug 31, 2022
@gabi-vuls gabi-vuls deleted the fix_duplicates_on_txpool_api branch August 31, 2022 17:06
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.

None yet

4 participants