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

feat: implement challenge module #43

Merged
merged 51 commits into from
Mar 9, 2023
Merged

feat: implement challenge module #43

merged 51 commits into from
Mar 9, 2023

Conversation

forcodedancing
Copy link
Contributor

@forcodedancing forcodedancing commented Feb 9, 2023

Description

This pull request will add challenge module to Greenfield. The purpose is triggering data availability challenges to storage providers, and punishing storage providers if they are doing something wrong.

There are two entrances for challenging a storage provider:

  1. User (called challenger) can submit Submit transactions.
  2. Randomly generated challenges at EndBlocks.

The off-chain service will verify the challenge by monitoring EventStartChallenge events, comparing object hashes between storage provide side and blockchain side, and aggregating votes to attest a challenge. If Attest transaction runs correctly, the challenged storage provider will be slashed, and validators, Submit transaction creator (the challenger) if there is, Attest transaction creator (called submitter) will be rewarded.

Rationale

To support data availability challenges .

Example

NA

Changes

Notable changes:

  • new messages and events

@forcodedancing forcodedancing marked this pull request as draft February 9, 2023 13:36
@forcodedancing forcodedancing marked this pull request as ready for review February 22, 2023 08:49
@forcodedancing forcodedancing force-pushed the challenge branch 2 times, most recently from 0864418 to 0affb06 Compare February 23, 2023 10:21
refine codes, remove unneeded data from genesis
proto/greenfield/challenge/tx.proto Outdated Show resolved Hide resolved
proto/greenfield/challenge/tx.proto Outdated Show resolved Hide resolved
proto/greenfield/challenge/tx.proto Outdated Show resolved Hide resolved
x/challenge/types/keys.go Outdated Show resolved Hide resolved
x/challenge/abci.go Outdated Show resolved Hide resolved
x/challenge/abci.go Outdated Show resolved Hide resolved
@unclezoro
Copy link
Collaborator

Can you clean the code because the a lot of heartbeat event and parameters still there.

@unclezoro unclezoro merged commit b7e75de into develop Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants