-
Notifications
You must be signed in to change notification settings - Fork 9
fix(cat-gateway): Fix cip36 endpoint #2124
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
base: main
Are you sure you want to change the base?
Conversation
…sation (#2100) * update cardano sync code * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix fmt * change schema version * wip * wip * wip * wip
✅ Test Report | |
* fix assets endpoint * wip * wip * wip * wip * wip * fix spelling * Update catalyst-gateway/bin/src/service/common/objects/cardano/stake_info.rs Co-authored-by: Steven Johnson <[email protected]> * wip --------- Co-authored-by: Steven Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic in get_all_valid_registrations terminates early when there could be valid registrations, not desired behavior and not what it used to do.
// This should NOT happen, valid registrations should be infallible. | ||
// If it happens, there is an indexing issue. | ||
continue; | ||
anyhow::bail!("Corrupt valid registration, invalid stake_pub_key {err}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we bailing here, and not just ignoring the corrupt registration? It may not be the latest, and if its not, it doesn't matter that its corrupt...
This causes us to fail to report otherwise valid registrations because there was a single error.
// This should NOT happen, valid registrations should be infallible. | ||
// If it happens, there is an indexing issue. | ||
continue; | ||
anyhow::bail!("Corrupt invalid registration {err}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we bailing, and not just ignoring a registration which may not be the latest? This prevents us finding valid registrations because something was wrong.
} else { | ||
continue; | ||
let Ok(raw_nonce) = u64::try_from(row.raw_nonce) else { | ||
anyhow::bail!("Corrupt valid registration, cannot decode raw_nonce"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, why are we bailing when there may be valid registrations yet to process?
regs_stream.map_err(Into::<anyhow::Error>::into).try_fold(Vec::new(), |mut regs, row| | ||
async move { | ||
let Ok(nonce) = u64::try_from(row.nonce) else { | ||
anyhow::bail!("Corrupt valid registration, cannot decode nonce"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bail when there may be valid registrations we can actually process following it.
err, stake_pub_key | ||
); | ||
continue; | ||
anyhow::bail!("Corrupt valid registration, invalid payment_address {err}\n Stake pub key:{stake_pub_key:?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bail?
err, stake_pub_key | ||
); | ||
continue; | ||
anyhow::bail!("Corrupt valid registration, invalid vote_pub_key {err}\n Stake pub key:{stake_pub_key:?}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bail?
Description
Based on #1986
cardano/cip36
endpoint