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

ReceiptStoreOperations.list_receipts_since returns wrong list #4

Closed
rohitmp opened this issue Feb 17, 2024 · 4 comments
Closed

ReceiptStoreOperations.list_receipts_since returns wrong list #4

rohitmp opened this issue Feb 17, 2024 · 4 comments

Comments

@rohitmp
Copy link

rohitmp commented Feb 17, 2024

The list_receipts_since returns wrong list;
this is because, the WHERE clause instead of comparing the transaction_receipt::idx.gt(idx) is comparing the transaction_receipt::transaction_id.gt(id)

let transaction_receipt_models: Vec = match id {
Some(id) => query
.filter(transaction_receipt::transaction_id.gt(id)) // THIS IS THE BUG
.select(transaction_receipt::all_columns)
.load(self.conn)

Solution: i think we should get the transaction_receipt's idx for the give 'id'; and then filter the other receipts which have idx greater that the given idx.

@rohitmp
Copy link
Author

rohitmp commented Feb 17, 2024

I ran the splinter in a debug mode and can see the list fetched;
the idx of the last_seen_event is 10, but if we see the returned list, there are entries whose idx value are less than 10.
Please see attached image.
Screenshot from 2024-02-17 19-27-13

The side effect of this is. IN the gridd, we keep getting below kind of errors. Since these events are already synced in the girdd.

DEBUG [gridd::event::db_handler] Received commit event: (50da128a8d3ced5168955e8ec4d33faadc407b2ed1f54e7261f70bf419e439db7b8abfca26a5ab913da63c54cc90db3be60d6daf8751c8f67a7a600fde9ed279, 3hFh4-6LGgZ::ssBB, #changes: 1)
INFO [gridd::event::db_handler] Received new commit 50da128a8d3ced5168955e8ec4d33faadc407b2ed1f54e7261f70bf419e439db7b8abfca26a5ab913da63c54cc90db3be60d6daf8751c8f67a7a600fde9ed279
ERROR [gridd::splinter::run] Event Error: Unique constraint violated
DEBUG [gridd::event::db_handler] Received commit event: (e43acc8e1c0c954ab9eb56e1ac18570f293e9913f8ceddf1177619dc9534460001e16b59cc8babca494786bca9ed37c4ee2e31340b088f9d2114f4fc05de20be, LE1hF-Yk0c5::gsBB, #changes: 2)
INFO [gridd::event::db_handler] Received new commit e43acc8e1c0c954ab9eb56e1ac18570f293e9913f8ceddf1177619dc9534460001e16b59cc8babca494786bca9ed37c4ee2e31340b088f9d2114f4fc05de20be
ERROR [gridd::splinter::run] Event Error: Unique constraint violated

@rohitmp
Copy link
Author

rohitmp commented Feb 19, 2024

i realize that this is wrong project for this defect.
It should actually be https://github.com/splintercommunity/sawtooth-lib
Is there a way to move this issue there..? Or i close this and create a new on on the sawtooth-lib project ?

@agunde406
Copy link
Contributor

i realize that this is wrong project for this defect. It should actually be https://github.com/splintercommunity/sawtooth-lib Is there a way to move this issue there..? Or i close this and create a new on on the sawtooth-lib project ?

Please close this issue and create a new one on sawtooth-lib. Thanks!

@rohitmp rohitmp closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2024
@rohitmp
Copy link
Author

rohitmp commented Feb 20, 2024

moved to correct project splintercommunity/sawtooth-lib#3

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

No branches or pull requests

2 participants