Skip to content

Commit

Permalink
lqt: fix effect hash calculation (#5075)
Browse files Browse the repository at this point in the history
## Describe your changes

Seems like the effect hash calculation for LQT votes was wrong, in that
it erroneously included the authorization data and proof, which would
make such actions effectively impossible to construct.

This corrects things so that the effect hash is only calculated over the
actual body of the vote.

Testing deferred.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

> This breaks consensus not only with main, but also with the
tentatively applied testnet upgrade 😬
  • Loading branch information
cronokirby committed Feb 27, 2025
1 parent 3927aa1 commit 19eeeb3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ impl From<LiquidityTournamentVoteBody> for pb::LiquidityTournamentVoteBody {
}
}

impl EffectingData for LiquidityTournamentVoteBody {
fn effect_hash(&self) -> EffectHash {
EffectHash::from_proto_effecting_data(&self.to_proto())
}
}

/// The action used to vote in the liquidity tournament.
///
/// This vote is towards a particular asset whose liquidity should be incentivized,
Expand Down Expand Up @@ -148,7 +154,7 @@ impl From<ActionLiquidityTournamentVote> for pb::ActionLiquidityTournamentVote {

impl EffectingData for ActionLiquidityTournamentVote {
fn effect_hash(&self) -> EffectHash {
EffectHash::from_proto_effecting_data(&self.to_proto())
self.body.effect_hash()
}
}

Expand Down

0 comments on commit 19eeeb3

Please sign in to comment.