more gas optimizations for getProof and getRoot
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
cb7c52f655
commit
424535e1f1
@ -79,8 +79,8 @@ contract Gatekeeper is IGatekeeper, IGatekeeperMetadata, IGatekeeperWeaver {
|
|||||||
uint256 i;
|
uint256 i;
|
||||||
for (; i < currentLevelCount;) {
|
for (; i < currentLevelCount;) {
|
||||||
uint256 j = i << 1;
|
uint256 j = i << 1;
|
||||||
bytes32 left = bytes32(_treeNodes[session][j].upperLookupRecent(atBlock));
|
bytes32 left = bytes32(_treeNodes[session][j].upperLookup(atBlock));
|
||||||
bytes32 right = bytes32(_treeNodes[session][j | 1].upperLookupRecent(atBlock));
|
bytes32 right = bytes32(_treeNodes[session][j | 1].upperLookup(atBlock));
|
||||||
|
|
||||||
currentLevel[i] = Hashes.efficientKeccak256(left, right);
|
currentLevel[i] = Hashes.efficientKeccak256(left, right);
|
||||||
unchecked { ++i; }
|
unchecked { ++i; }
|
||||||
@ -115,7 +115,7 @@ contract Gatekeeper is IGatekeeper, IGatekeeperMetadata, IGatekeeperWeaver {
|
|||||||
uint256 i;
|
uint256 i;
|
||||||
|
|
||||||
for (; i < currentLevelCount;) {
|
for (; i < currentLevelCount;) {
|
||||||
currentLevel[i] = bytes32(_treeNodes[session][i].upperLookupRecent(atBlock));
|
currentLevel[i] = bytes32(_treeNodes[session][i].upperLookup(atBlock));
|
||||||
unchecked { ++i; }
|
unchecked { ++i; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user