Skip to content

Conversation

@guidanoli
Copy link
Collaborator

Hey @stephenctw, I've collected some suggested changes into a PR for your appreciation.
Let's discuss here the changes, so we can converge. :-)

@guidanoli guidanoli requested a review from stephenctw December 10, 2025 20:41
@guidanoli guidanoli changed the base branch from main to feature/prt-tournament-simplification December 10, 2025 20:41
has_winner = helper.str_to_bool(ret[1]),
parent_commitment = Hash:from_digest_hex(ret[2]),
dangling_commitment = Hash:from_digest_hex(ret[3]),
commitment = Hash:from_digest_hex(ret[3]),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change makes the inner_tournament_winner function return a table which contains a commitment entry, making it more similar to the table returned by the root_tournament_winner function. That is important because the return value of both functions are used (almost) interchangeably here:

if not tournament.parent then
tournament.tournament_winner = self.reader:root_tournament_winner(tournament.address)
else
tournament.tournament_winner = self.reader:inner_tournament_winner(tournament.address)
end

Later, this tournament_winner value and its commitment value are accessed:

if tournament_winner.commitment ~= old_commitment then

This is the reason behind this change.

returns (TournamentArguments memory);

/// @notice Returns non-root tournament arguments
function nonRootTournamentArgs()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have added this function to the ITournament interface, because the NonRootArguments struct was not being used there. Also, it might be useful to expose this struct to the node.

//

/// @notice Check if this is a root tournament (level == 0)
function _isRootTournament() internal view returns (bool) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have removed this function because it was not being used.

@guidanoli guidanoli merged commit fa741b5 into feature/prt-tournament-simplification Dec 11, 2025
7 checks passed
@guidanoli guidanoli deleted the feature/prt-tournament-simplification-guidanoli branch December 11, 2025 09:22
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