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

Add participation > MIN_SYNC_COMMITTEE_PARTICIPANTS check #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Spectre.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ contract Spectre {

uint256 internal immutable SLOTS_PER_PERIOD;

uint256 internal constant MIN_SYNC_COMMITTEE_PARTICIPANTS = 10;

/// Maps from a sync period to the poseidon commitment for the sync committee.
mapping(uint256 => uint256) public syncCommitteePoseidons;

Expand Down Expand Up @@ -60,6 +62,11 @@ contract Spectre {
"Sync committee not yet set for this period"
);

require(
input.participation > MIN_SYNC_COMMITTEE_PARTICIPANTS,
"Less than MIN_SYNC_COMMITTEE_PARTICIPANTS signed"
);

_verifyStepProof(input, proof, syncCommitteePoseidons[currentPeriod]);

// update the contract state
Expand Down