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 #3

Open
rohitmp opened this issue Feb 20, 2024 · 0 comments
Open

ReceiptStoreOperations.list_receipts_since returns wrong list #3

rohitmp opened this issue Feb 20, 2024 · 0 comments

Comments

@rohitmp
Copy link

rohitmp commented Feb 20, 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.

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.

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 pushed a commit to rohitmp/sawtooth-lib that referenced this issue Feb 20, 2024
rohitmp pushed a commit to rohitmp/sawtooth-lib that referenced this issue Feb 20, 2024
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

1 participant