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

Valset/Data commitment requests security for QGB #349

Closed
Tracked by #301
rach-id opened this issue Apr 24, 2022 · 6 comments
Closed
Tracked by #301

Valset/Data commitment requests security for QGB #349

rach-id opened this issue Apr 24, 2022 · 6 comments

Comments

@rach-id
Copy link
Member

rach-id commented Apr 24, 2022

For Valsets, the orchestrator is currently checking the valset by nonce and then signs it. This works if we suppose that all valset requests are valid.
However, we can have a malicious party that generates invalid valsets (duplicates with different nonce, valsets for non-significant validator set changes etc.), and the orchestrator will keep signing those.
Thus, we will need to add validity checks on valsets before the orchestrator signs them.
These need to be defined not to allow any malicious party to flood the network with incorrect valsets.

The same applies for data commitment requests which will be added here #268.

@rach-id rach-id added the C: QGB label Apr 24, 2022
@rach-id
Copy link
Member Author

rach-id commented Apr 24, 2022

@evan-forbes What do you think ?

@evan-forbes
Copy link
Member

However, we can have a malicious party that generates invalid valsets (duplicates with different nonce, valsets for non-significant validator set changes etc.), and the orchestrator will keep signing those.

I thought that the only way to set an invalid one is with 2/3's malicious voting power? How would one create one in the state with out 2/3's agreement?

@rach-id
Copy link
Member Author

rach-id commented Apr 24, 2022

We're currently setting valsets in end blockers via calling:

func (k Keeper) SetValsetRequest(ctx sdk.Context) types.Valset {

This function doesn't have any checks in it. And similar with Data commitments.

Thus, if we implement the client requests (maybe not for valsets, but to set data commitments), or similar, under https://github.com/celestiaorg/celestia-app/tree/master/x/qgb/client/cli, we wouldn't have any checks whether the committed state is correct or not.

Furthermore, I created this issue to discuss adding more checks on the keeper level, if it makes sense.

@evan-forbes
Copy link
Member

I think its ok to add checks later if we wanted to add cli functionality, but currently we have no plans to, and even if we did, it would only be for data availability commitments.

Since the SetValsetRequest function can only be called during EndBlocker and effects state, anyone attempting to call it inappropriately will result in a different app hash, so I think its safe to not add checks. This was likely the thinking behind not adding checks in the first place.

This is good to think about though!! We might also want to consider adding invariants for this and other things. https://docs.cosmos.network/v0.45/building-modules/invariants.html

@rach-id
Copy link
Member Author

rach-id commented Apr 25, 2022

Sounds good. Should we keep the issue open to remind us in the future ?

@evan-forbes
Copy link
Member

I think we can close this for now, as there are no direct actionable items. If we ever do variable data commitment windows, then we will only handle this then.

@rach-id rach-id closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants