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 auction resolution during a tie #2971

Merged
merged 5 commits into from
Feb 24, 2025
Merged

Conversation

ganeshvanahalli
Copy link
Contributor

This PR fixes how we broke tie on the GO side and matches it to how the auction contract breaks it.

Resolves NIT-3132

Tristan-Wilson
Tristan-Wilson previously approved these changes Feb 21, 2025
Copy link
Member

@Tristan-Wilson Tristan-Wilson left a comment

Choose a reason for hiding this comment

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

This looks like it matches the contract now, nice work. The test is also very good, I just have one question about it, but I'll approve this for now and you can fix if there's something to be fixed.


}

var expectedWinner common.Address
Copy link
Member

Choose a reason for hiding this comment

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

Does the bidHash change between runs of the test so that both alice and bob being the expected winner are tested? Could we run this test a few times then?

Copy link
Contributor Author

@ganeshvanahalli ganeshvanahalli Feb 24, 2025

Choose a reason for hiding this comment

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

Since hashing is pseudo-random its hard to deterministically say one should win out during a tie!
I agree with you and that we can have another test that would keep running multiple auctions until both alice and bob winning a tie is tested out- but this test would need to be skipped in CI as it would take a lot of time

@joshuacolvin0 joshuacolvin0 merged commit d5b5334 into master Feb 24, 2025
14 of 15 checks passed
@joshuacolvin0 joshuacolvin0 deleted the fix-auction-tiebreaking branch February 24, 2025 19:56
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.

3 participants