Skip to content

Commit

Permalink
Merge pull request #218 from OriginTrail/fix/commit-managers-and-formula
Browse files Browse the repository at this point in the history
Fixed CommitManagerV1/V1U1 bugs, fixed LinearSum score calculation to avoid underflows, added tests for CommitManagerV1 and LinearSum
  • Loading branch information
0xbraindevd authored Feb 1, 2024
2 parents 6de1293 + 9160c83 commit 145a78a
Show file tree
Hide file tree
Showing 13 changed files with 702 additions and 176 deletions.
36 changes: 10 additions & 26 deletions abi/CommitManagerV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@
"name": "leftEdgeNodeIndex",
"type": "uint72"
},
{
"internalType": "uint72",
"name": "rightEdgeNodeAdjacentIndex",
"type": "uint72"
},
{
"internalType": "uint256",
"name": "leftEdgeNodeDistance",
Expand Down Expand Up @@ -243,6 +248,11 @@
"name": "rightEdgeNodeIndex",
"type": "uint72"
},
{
"internalType": "uint72",
"name": "leftEdgeNodeAdjacentIndex",
"type": "uint72"
},
{
"internalType": "uint256",
"name": "rightEdgeNodeDistance",
Expand Down Expand Up @@ -503,19 +513,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hashingProxy",
"outputs": [
{
"internalType": "contract HashingProxy",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hub",
Expand Down Expand Up @@ -714,19 +711,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakingContract",
"outputs": [
{
"internalType": "contract StakingV2",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakingStorage",
Expand Down
46 changes: 15 additions & 31 deletions abi/CommitManagerV2U1.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
"name": "leftEdgeNodeIndex",
"type": "uint72"
},
{
"internalType": "uint72",
"name": "rightEdgeNodeAdjacentIndex",
"type": "uint72"
},
{
"internalType": "uint256",
"name": "leftEdgeNodeDistance",
Expand Down Expand Up @@ -248,6 +253,11 @@
"name": "rightEdgeNodeIndex",
"type": "uint72"
},
{
"internalType": "uint72",
"name": "leftEdgeNodeAdjacentIndex",
"type": "uint72"
},
{
"internalType": "uint256",
"name": "rightEdgeNodeDistance",
Expand Down Expand Up @@ -443,13 +453,13 @@
"anonymous": false,
"inputs": [
{
"indexed": true,
"indexed": false,
"internalType": "address",
"name": "assetContract",
"type": "address"
},
{
"indexed": true,
"indexed": false,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
Expand Down Expand Up @@ -479,7 +489,7 @@
"type": "uint256"
},
{
"indexed": true,
"indexed": false,
"internalType": "uint72",
"name": "identityId",
"type": "uint72"
Expand All @@ -498,13 +508,13 @@
"anonymous": false,
"inputs": [
{
"indexed": true,
"indexed": false,
"internalType": "address",
"name": "assetContract",
"type": "address"
},
{
"indexed": true,
"indexed": false,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
Expand Down Expand Up @@ -607,19 +617,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hashingProxy",
"outputs": [
{
"internalType": "contract HashingProxy",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "hub",
Expand Down Expand Up @@ -847,19 +844,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakingContract",
"outputs": [
{
"internalType": "contract StakingV2",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakingStorage",
Expand Down
35 changes: 35 additions & 0 deletions abi/ShardingTableStorageV2.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "identityId",
Expand Down Expand Up @@ -150,6 +155,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand Down Expand Up @@ -196,6 +206,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand All @@ -218,6 +233,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand All @@ -240,6 +260,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand Down Expand Up @@ -276,6 +301,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand Down Expand Up @@ -312,6 +342,11 @@
"name": "hashRingPosition",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "nodeId",
"type": "bytes"
},
{
"internalType": "uint72",
"name": "index",
Expand Down
Loading

0 comments on commit 145a78a

Please sign in to comment.