Skip to content

Fix governance vote purge#221

Merged
RichardAH merged 19 commits intoXahau:devfrom
tequdev:purge-votes
Jun 16, 2025
Merged

Fix governance vote purge#221
RichardAH merged 19 commits intoXahau:devfrom
tequdev:purge-votes

Conversation

@tequdev
Copy link
Member

@tequdev tequdev commented Nov 28, 2023

High Level Overview of Change

Fixed previous_member and vote_key are set correctly when deleting votes in Governance Hook.

Context of Change

The implementation didn't match the top comment in the govern.c file.

  • L1/L2 information was missing when obtaining State.

Fixed existence comparison conditions.

Type of Change

  • [x ] Bug fix (non-breaking change which fixes an issue)

If each governance table continues to use this governance Hook, it is recommended that the Hook be updated.

Test Plan

Since the author is not familiar with C++ code and cannot write sufficient test code, so used JS for the test instead.

https://github.com/tequdev/xahau-governance-hook-test

@RichardAH
Copy link
Contributor

I think this is correct but we really need a deterministic build setup for these "embedded" hooks so we can prove what the wasm binary contains. Not that I don't trust @tequdev, but because no one should have to trust an opaque binary to begin with. I feel uncomfortable about merging opaque binaries, even ones I generate myself.

@dangell7
Copy link
Collaborator

I think this is correct but we really need a deterministic build setup for these "embedded" hooks so we can prove what the wasm binary contains. Not that I don't trust @tequdev, but because no one should have to trust an opaque binary to begin with. I feel uncomfortable about merging opaque binaries, even ones I generate myself.

So you want to build and store the hex binary in the repo during the git actions? We could also do it how you did the tests where it shows both the c and the hex?

https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/src/test/app/SetHook_wasm.h

@RichardAH
Copy link
Contributor

I think this is correct but we really need a deterministic build setup for these "embedded" hooks so we can prove what the wasm binary contains. Not that I don't trust @tequdev, but because no one should have to trust an opaque binary to begin with. I feel uncomfortable about merging opaque binaries, even ones I generate myself.

So you want to build and store the hex binary in the repo during the git actions? We could also do it how you did the tests where it shows both the c and the hex?

https://raw.githubusercontent.com/Xahau/xahaud/refs/heads/dev/src/test/app/SetHook_wasm.h

Yeah I think automated building of the blobs during the git actions is the correct answer. But they have to be deterministic builds.

@RichardAH RichardAH merged commit f6d2bf8 into Xahau:dev Jun 16, 2025
10 checks passed
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.

Governance hook: Votes of removed members are not purged

4 participants