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 integrate recent participants contract #355

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

Conversation

juliangruber
Copy link
Member

https://github.com/filecoin-station/spark-evaluations-recent-participants

Also added a refactor of ie-contract.js, while I was there.

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

IIRC, we were discussing a different approach in the past:

  1. spark-evaluate creates a JSON object linking to measurement commitments included in the evaluation plus the evaluation outcomes
  2. spark-evaluate uploads this JSON object to web3storage and commits the CID of this JSON object to the smart contract
  3. the smart contract emits an event with the round index and evaluation commitment CID
  4. spark-stats listens for these events, downloads the evaluation results & linked measurements, and runs data analysis & aggregation over the data obtained this way

I'd rather avoid creating many smart contract methods & events individually for each stats field like "recent participants" because it would be a lot of work, IMO.

In particular, if we are interested in recent participants only, then I don't think we need a new contract for that - we can find the participant addresses either in the committed measurements or in the history of setScores calls.

Comment on lines +18 to +30
export const createMeridianContract = (contractAddress = SparkImpactEvaluator.ADDRESS) => {
return new ethers.Contract(
contractAddress,
SparkImpactEvaluator.ABI,
provider
)
}

export const recentParticipantsContract = new ethers.Contract(
SparkEvaluationsRecentParticipants.ADDRESS,
SparkEvaluationsRecentParticipants.ABI,
provider
)
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why we need a factory function for the meridian contract (createMeridianContract)? I find it surprising that there isn't a factory function for "recent participants" contract as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants