-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use new hashing service #2896
Use new hashing service #2896
Conversation
…imityScoringService
…redistnace-function-id
…simulation' into test/hash-and-scoredistnace-function-id
…simulation' into feature/use-new-hashing-service
…se-new-hashing-service
…OriginTrail/ot-node into feature/use-new-hashing-service
|
||
let neighbourhoodEdges = null; | ||
if (serviceAgreement.scoreFunctionId === 2) { | ||
neighbourhoodEdges = await this.shardingTableService.getNeighboorhoodEdgeNodes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep American version neighborhood
consistently everywhere
neighbourhoodEdges = await this.shardingTableService.getNeighboorhoodEdgeNodes( | |
neighborhoodEdges = await this.shardingTableService.getNeighborhoodEdgeNodes( |
COMMIT_MANAGER_V1_U1_CONTRACT: 'CommitManagerV1U1Contract', | ||
SERVICE_AGREEMENT_V1_CONTRACT: 'ServiceAgreementV1Contract', | ||
PARAMETERS_STORAGE_CONTRACT: 'ParametersStorageContract', | ||
IDENTITY_STORAGE_CONTRACT: 'IdentityStorageContract', | ||
Log2PLDSF: 'Log2PLDSF', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work as we don't listen to the events from this contract + it should be handled in a different way comparing to other contracts as we get parameters with one getter, but set them with different setters
@@ -49,6 +49,7 @@ class PullBlockchainShardingTableMigration extends BaseMigration { | |||
...nodes.slice(sliceIndex).filter((node) => node.nodeId !== '0x'), | |||
); | |||
sliceIndex = 1; | |||
// TODO: Should we fix it here also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what is meant by this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not valid anymore, this comment should be removed
@@ -41,18 +41,20 @@ const ABIs = { | |||
ProfileStorage: require('dkg-evm-module/abi/ProfileStorage.json'), | |||
ScoringProxy: require('dkg-evm-module/abi/ScoringProxy.json'), | |||
ServiceAgreementV1: require('dkg-evm-module/abi/ServiceAgreementV1.json'), | |||
CommitManagerV1: require('dkg-evm-module/abi/CommitManagerV1.json'), | |||
CommitManagerV1U1: require('dkg-evm-module/abi/CommitManagerV1U1.json'), | |||
CommitManagerV1: require('dkg-evm-module/abi/CommitManagerV2.json'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use exports from the package
ServiceAgreementStorageProxy: require('dkg-evm-module/abi/ServiceAgreementStorageProxy.json'), | ||
UnfinalizedStateStorage: require('dkg-evm-module/abi/UnfinalizedStateStorage.json'), | ||
LinearSum: require('dkg-evm-module/abi/LinearSum.json'), | ||
}; | ||
|
||
const SCORING_FUNCTIONS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can get it from the blockchain and cache it
); | ||
} | ||
|
||
async getLinearSumParams() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be updated
@@ -67,6 +67,7 @@ class BlockchainEventListenerService { | |||
currentBlock, | |||
CONTRACT_EVENTS.PROFILE, | |||
), | |||
// TODO: Update with new commit managers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the comment, not needed
@@ -110,7 +110,7 @@ class ProximityScoringService { | |||
}; | |||
} | |||
|
|||
async LinearSum(blockchain, distance, stake, maxNeighborhoodDistance) { | |||
async linearSum(blockchain, distance, stake, maxNeighborhoodDistance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be updated
this.log2PLDSFParams = await this.blockchainModuleManager.getLog2PLDSFParams( | ||
let maxNeighborhoodDistance; | ||
if (neighbourhoodEdges) { | ||
maxNeighborhoodDistance = await this.proximityScoringService.callProximityFunction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should introduce ideal max distance here
); | ||
peersWithDistance.sort((a, b) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified
…he blockchain implementation
Fixed formula for LinearSum score calculation
c141ffd
into
feature/final-proximity-scoring-simulation
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: