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

SIMD-0204: Slashable event verification #204

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

Conversation

AshwinSekar
Copy link
Contributor

@AshwinSekar AshwinSekar commented Nov 26, 2024

Proposal to deploy a program that records and verifies slashable events on chain

This proposal does not modify any stakes or rewards, the program will only verify and record infractions.

At the moment we only verify duplicate block violations, but a future SIMD will add voting violations as well

@AshwinSekar AshwinSekar changed the title SIMD-0XXX: Slashable event verification SIMD-0204: Slashable event verification Nov 26, 2024
@AshwinSekar AshwinSekar force-pushed the slashing-program branch 4 times, most recently from 2d2ee08 to 339aa9a Compare November 26, 2024 18:27
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Really great work! Most of my comments are minor nits for clarification

proposals/0204-slashable-event-verification.md Outdated Show resolved Hide resolved
Comment on lines +52 to +54
2. Verify that the program account
`8sT74BE7sanh4iT84EyVUL8b77cVruLHXGjvTyJ4GwCe` has a verified build hash of
`<FILL IN AFTER IMPLEMENTATION>` [\[1\]](#notes)
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't typically do this when upgrading a program via feature gate, but I like it a lot! We should definitely start

Comment on lines +56 to +57
3. Copy the contents of `8sT74BE7sanh4iT84EyVUL8b77cVruLHXGjvTyJ4GwCe` into
`S1ashing11111111111111111111111111111111111`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you intend for S1ashing11111111111111111111111111111111111 to be owned by the upgradeable loader or loader-v4? If it's the former, we should also move the program-data account from the old address to the PDA for S1ashing11111111111111111111111111111111111, to ensure that the program behaves like any other BPF program. cc @buffalojoec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not familiar with the loaders so i'll defer to your wisdom :), just let me know which one makes the most sense and I can include it here.

Copy link
Contributor

@joncinque joncinque Dec 4, 2024

Choose a reason for hiding this comment

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

Let's go with the default loader (bpf-loader-upgradeable) for now. We can amend it if loader-v4 becomes the default sooner than this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Specified the default loader and your comment about moving the program data account, let me know if it looks correct f4f8ab7

proposals/0204-slashable-event-verification.md Outdated Show resolved Hide resolved
proposals/0204-slashable-event-verification.md Outdated Show resolved Hide resolved
Comment on lines 227 to 228
They can accomplish this via the `CloseProofReport` instruction which requires
2 accounts:
Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like it needs one more account -- the reporter to sign. But I wonder if we can allow this to be totally permissionless by having the reporter provide the lamport destination when they create the report. That way we're sure slash reports are always cleaned up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like that approach, can definitely see people forgetting to close their reports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could we just send it back to the initial reporter? Or is it worth carrying around a separate address as the destination

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd keep them separate -- it gives extra flexibility and clarity at the cost of an extra 32 bytes, which shouldn't be too bad, especially considering the accounts will get cleaned up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

separated it here f89a01b

proposals/0204-slashable-event-verification.md Outdated Show resolved Hide resolved
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