Skip to content

[WIP] Peer Snitching Contract - #248

Draft
theref wants to merge 3 commits into
nucypher:mainfrom
theref:evidence
Draft

[WIP] Peer Snitching Contract#248
theref wants to merge 3 commits into
nucypher:mainfrom
theref:evidence

Conversation

@theref

@theref theref commented Mar 27, 2024

Copy link
Copy Markdown
Contributor

Type of PR:

  • Feature

Required reviews:

  • 3

@theref
theref requested review from cygnusv, manumonti and vzotova March 27, 2024 16:33
@theref
theref marked this pull request as draft March 27, 2024 16:33
Comment thread contracts/contracts/TACoEvidence.sol Outdated
collection.endTimestamp = collection.initTimestamp + submissionWindow;
collection.nonce =
uint256(keccak256(abi.encodePacked(block.timestamp, block.difficulty))) %
10 ** 18;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why mod 10^18? Unless there's a good reason, I'd drop it.

Comment thread contracts/contracts/TACoEvidence.sol Outdated
}

// Function for nodes to submit their online status with evidence
function submitEvidence(uint32 id, bytes[] memory signatures, address[] memory peers) public {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd remove the peers parameter, and simply extract the operator address (as you currently do in L85), and then cross-check with the staking provider address.

Comment thread contracts/contracts/TACoEvidence.sol Outdated

ITACoChildApplication public immutable application;

uint256 public submissionWindow = 1 hours;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can probably be made immutable.

Comment thread contracts/contracts/TACoEvidence.sol Outdated
Collection[] public collections;

constructor() {
admin = msg.sender;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This isn't defined, right? Anyway, I'd define as immutable too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd change it to Ownable and owner

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