Discuss best way to syncronize Assessment Data with blockchain
Current Behavior
In the fathom-app, the FE would fetch all stage0 notifications from fathomToken and then instanciate all assessment contracts from obtained addresses and finally fetch assessment data from those contracts.
Expected Behavior
Let's discuss the most efficient way to have the assessment data we need at all time
Motivation and Context
This is in the context of building a production-ready MVP for the Assessment
Possible Implementation
State:
assessments: {
'0x1232': {
size: 0,
cost: 0,
concept: '0x...'
assessee: '0x...',
stage: 0,
startTime: 0,
endTime: 0,
assessmentData: 'Qm...'
assessors: [
{address: '0x...', stage: 0}
]
}
}
Prop1 - old one
fetch all stage0 notifications from fathomToken and then instanciate all assessment contracts from obtained addresses and finally fetch assessment data from those contracts, and fetch stage1 notifications to get assessors
example:
Cost:
- fetch all notifications & filter them: nbAssessments
- instanciate all assessment contracts: nbAssessments*instance
- call all parameters: nbAssessments*nbParameters
- fetch stage 2 notifications to get all assessors: nbAssessment*avrgNbAssessor
Missing info:
- use stage1 to get potential assessors
- use assessorState to know about commited assessors
Prop1 - improved
fetch all stage0 notifications from fathomToken with user === userAddress and then instanciate all assessment contracts from obtained addresses and finally fetch assessment data from those contracts ; repeat same process with stage2 to get assessments where user is assessor
Cost:
- fetch all notifications & filter them: nbAssessmentsUserRelevant
- instanciate all assessment contracts: nbAssessmentsUserRelevant*instance
- call all parameters: nbAssessmentsUserRelevant*nbParameters
Missing info:
- call again stage2 notifications with assessmentAddresses to get other assessors
- use stage1 to get potential assessors
- use assessorState to know about commited assessors
Prop2
fetch all notifications with user===userAddress and update progressively the notifications object with user stage, then fetch/instanciate all assessment contract to get data
Cost:
- fetch all notifications & filter them: nbAssessmentsUserRelevant*nbUserActions
- instanciate all assessment contracts: nbAssessmentsUserRelevant*instance
- call all parameters: nbAssessmentsUserRelevant*nbParameters
Missing info:
- anything about the other users
Notify Collaborators
Disclaimer: This form is a work in progress. Feedback on its components is welcomed!