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: mark as submitted only those bids that were actually submitted #367

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

guibescos
Copy link
Contributor

@guibescos guibescos commented Jan 27, 2025

I fix this bug where some SVM bids were being marked as submitted despite send_transaction failing to submit them

Copy link

vercel bot commented Jan 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
swap-staging ⬜️ Ignored (Inspect) Visit Preview Jan 28, 2025 0:12am

@guibescos guibescos changed the title Fix/mark as submitted only those that should fix: mark as submitted only those bids that were actually submitted Jan 27, 2025
@guibescos guibescos marked this pull request as ready for review January 27, 2025 19:19
@@ -415,7 +416,7 @@ impl AuctionManager<Svm> for Service<Svm> {
&self,
_permission_key: entities::PermissionKey<Svm>,
bids: Vec<entities::Bid<Svm>>,
) -> Result<entities::TxHash<Svm>> {
) -> Result<Vec<Result<entities::TxHash<Svm>>>> {
if bids.is_empty() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we simplify this function return type to Vec<Result<entities::TxHash<Svm>>> and remove the len 0 check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mmmm I tried this and it's hard because in the EVM version we get a single error for the whole vector and returning a vector of results would requiring cloning that error which is not allowed.

I do agree about removing the 0-length check, it seems outside of the responsibility of this function.

Copy link
Contributor Author

@guibescos guibescos Jan 28, 2025

Choose a reason for hiding this comment

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

on second thoughts since all we do with the errors is logging... we can log them inside submit_bids
if you want I could do Result<Vec<Option>> or Vec<Option>.
Wdyt?

auction-server/src/auction/service/handle_auction.rs Outdated Show resolved Hide resolved
self.update_bid_status(UpdateBidStatusInput {
new_status: Service::get_new_status(
&bid,
&submitted_bids,
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change, we are marking the bids that are not submitted (failed to be submitted) on chain as lost, and we broadcast that their bid is lost (even when it's a winner bid and we were unable to submit it). Are we sure about this UX?

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

Successfully merging this pull request may close these issues.

3 participants