Skip to content

Commit

Permalink
test(contracts/core): test gas metrics using larger valsets (#2311)
Browse files Browse the repository at this point in the history
I expanded the testing base contracts to allow for creation of larger
validator sets of arbitrary size so I could perform more xsubmit gas
benchmarking.

issue: none
  • Loading branch information
Zodomo authored Oct 28, 2024
1 parent a80ae44 commit 4ff3a6c
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 63 deletions.
118 changes: 65 additions & 53 deletions contracts/core/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Admin_Test:test_pause_unpause_bridge() (gas: 21501844)
Admin_Test:test_pause_unpause_xcall() (gas: 26426087)
Admin_Test:test_pause_unpause_xsubmit() (gas: 26425838)
Admin_Test:test_upgrade() (gas: 30507332)
AllocPredeploys_Test:test_num_allocs() (gas: 1181198035)
AllocPredeploys_Test:test_num_allocs() (gas: 1181152549)
AllocPredeploys_Test:test_predeploys() (gas: 1181134337)
AllocPredeploys_Test:test_preinstalls() (gas: 1181850775)
AllocPredeploys_Test:test_proxies() (gas: 1408777576)
Expand Down Expand Up @@ -49,58 +49,70 @@ OmniGasPump_Test:test_withdraw() (gas: 71440)
OmniGasStation_Test:test_pause() (gas: 65220)
OmniGasStation_Test:test_setPump() (gas: 83966)
OmniGasStation_Test:test_settleUp() (gas: 365260)
OmniPortal_Test:test_example() (gas: 621232)
OmniPortal_admin_Test:test_pauseAll() (gas: 824100)
OmniPortal_admin_Test:test_pauseXCall() (gas: 271715)
OmniPortal_admin_Test:test_pauseXSubmit() (gas: 236204)
OmniPortal_admin_Test:test_setFeeOracle() (gas: 31367)
OmniPortal_admin_Test:test_setInXBlockOffset() (gas: 54097)
OmniPortal_admin_Test:test_setInXMsgOffset() (gas: 54136)
OmniPortal_admin_Test:test_setXMsgGasLimits() (gas: 62007)
OmniPortal_admin_Test:test_setXSubValsetCutoff() (gas: 35080)
OmniPortal_adversarial:test_xcallToPortal__fails() (gas: 76764)
OmniPortal_exec_Test:test_call_notEnoughGas_reverts() (gas: 4997001)
OmniPortal_exec_Test:test_exec_aheadOffset_reverts() (gas: 23888)
OmniPortal_exec_Test:test_exec_behindOffset_reverts() (gas: 137561)
OmniPortal_exec_Test:test_exec_errorSize() (gas: 71934178)
OmniPortal_exec_Test:test_exec_wrongDestChainId_reverts() (gas: 21432)
OmniPortal_exec_Test:test_exec_xmsgRevert_succeeds() (gas: 97208)
OmniPortal_exec_Test:test_exec_xmsg_succeeds() (gas: 156195)
OmniPortal_exec_Test:test_syscall_forwardsRevert() (gas: 20576)
OmniPortal_feeFor_Test:test_feeFor_succeeds() (gas: 46493)
OmniPortal_sys_Test:test_setNetwork() (gas: 493185)
OmniPortal_sys_Test:test_syscall_auth() (gas: 1953715)
OmniPortal_xcall_Test:test_xcall_gasLimitTooHigh_reverts() (gas: 64764)
OmniPortal_xcall_Test:test_xcall_gasLimitTooLow_reverts() (gas: 64978)
OmniPortal_xcall_Test:test_xcall_insufficientFee_reverts() (gas: 69742)
OmniPortal_xcall_Test:test_xcall_sameChain_reverts() (gas: 60998)
OmniPortal_xcall_Test:test_xcall_succeeds() (gas: 105592)
OmniPortal_xcall_Test:test_xcall_unsupportedConf_reverts() (gas: 40686)
OmniPortal_xcall_Test:test_xcall_unsupportedDest_reverts() (gas: 36233)
OmniPortal_xsubmit_Test:test_xsubmit_addValidatorSet_succeeds() (gas: 1051891)
OmniPortal_xsubmit_Test:test_xsubmit_duplicateValidator_reverts() (gas: 495845)
OmniPortal_xsubmit_Test:test_xsubmit_invalidAttestationRoot_reverts() (gas: 549108)
OmniPortal_xsubmit_Test:test_xsubmit_invalidMsgs_reverts() (gas: 536774)
OmniPortal_xsubmit_Test:test_xsubmit_noQuorum_reverts() (gas: 502297)
OmniPortal_xsubmit_Test:test_xsubmit_noXmsgs_reverts() (gas: 478748)
OmniPortal_xsubmit_Test:test_xsubmit_notNewValSet_succeeds() (gas: 1024420)
OmniPortal_xsubmit_Test:test_xsubmit_oldValSet_reverts() (gas: 493175)
OmniPortal_xsubmit_Test:test_xsubmit_reentrancy_reverts() (gas: 247575)
OmniPortal_xsubmit_Test:test_xsubmit_unknownValSetId_reverts() (gas: 485125)
OmniPortal_xsubmit_Test:test_xsubmit_wrongConsensusChainId_reverts() (gas: 482166)
OmniPortal_xsubmit_Test:test_xsubmit_wrongDestChainId_reverts() (gas: 537591)
OmniPortal_xsubmit_Test:test_xsubmit_wrongStreamOffset_reverts() (gas: 540020)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_chainB_succeeds() (gas: 765186)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_succeeds() (gas: 765242)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_chainB_succeeds() (gas: 1346751)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_succeeds() (gas: 1346686)
OmniPortal_xsubmit_gas_Test:test_singleExec() (gas: 876609)
OmniPortal_xsubmit_gas_Test:test_xsubmit_addValidator_succeeds() (gas: 345241)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_succeeds() (gas: 1678916)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_succeeds() (gas: 343750)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_succeeds() (gas: 4075956)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_succeeds() (gas: 8529715)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_succeeds() (gas: 947645)
OmniPortal_Test:test_example() (gas: 621249)
OmniPortal_admin_Test:test_pauseAll() (gas: 824443)
OmniPortal_admin_Test:test_pauseXCall() (gas: 272052)
OmniPortal_admin_Test:test_pauseXSubmit() (gas: 236630)
OmniPortal_admin_Test:test_setFeeOracle() (gas: 31465)
OmniPortal_admin_Test:test_setInXBlockOffset() (gas: 54206)
OmniPortal_admin_Test:test_setInXMsgOffset() (gas: 54222)
OmniPortal_admin_Test:test_setXMsgGasLimits() (gas: 62364)
OmniPortal_admin_Test:test_setXSubValsetCutoff() (gas: 35136)
OmniPortal_adversarial:test_xcallToPortal__fails() (gas: 76776)
OmniPortal_exec_Test:test_call_notEnoughGas_reverts() (gas: 4997060)
OmniPortal_exec_Test:test_exec_aheadOffset_reverts() (gas: 23902)
OmniPortal_exec_Test:test_exec_behindOffset_reverts() (gas: 137545)
OmniPortal_exec_Test:test_exec_errorSize() (gas: 71934298)
OmniPortal_exec_Test:test_exec_wrongDestChainId_reverts() (gas: 21490)
OmniPortal_exec_Test:test_exec_xmsgRevert_succeeds() (gas: 97236)
OmniPortal_exec_Test:test_exec_xmsg_succeeds() (gas: 156226)
OmniPortal_exec_Test:test_syscall_forwardsRevert() (gas: 20634)
OmniPortal_feeFor_Test:test_feeFor_succeeds() (gas: 46638)
OmniPortal_sys_Test:test_setNetwork() (gas: 493202)
OmniPortal_sys_Test:test_syscall_auth() (gas: 1953534)
OmniPortal_xcall_Test:test_xcall_gasLimitTooHigh_reverts() (gas: 64865)
OmniPortal_xcall_Test:test_xcall_gasLimitTooLow_reverts() (gas: 65051)
OmniPortal_xcall_Test:test_xcall_insufficientFee_reverts() (gas: 69818)
OmniPortal_xcall_Test:test_xcall_sameChain_reverts() (gas: 61071)
OmniPortal_xcall_Test:test_xcall_succeeds() (gas: 105634)
OmniPortal_xcall_Test:test_xcall_unsupportedConf_reverts() (gas: 40700)
OmniPortal_xcall_Test:test_xcall_unsupportedDest_reverts() (gas: 36203)
OmniPortal_xsubmit_Test:test_xsubmit_addValidatorSet_succeeds() (gas: 1052227)
OmniPortal_xsubmit_Test:test_xsubmit_duplicateValidator_reverts() (gas: 495859)
OmniPortal_xsubmit_Test:test_xsubmit_invalidAttestationRoot_reverts() (gas: 549122)
OmniPortal_xsubmit_Test:test_xsubmit_invalidMsgs_reverts() (gas: 536766)
OmniPortal_xsubmit_Test:test_xsubmit_noQuorum_reverts() (gas: 502398)
OmniPortal_xsubmit_Test:test_xsubmit_noXmsgs_reverts() (gas: 478762)
OmniPortal_xsubmit_Test:test_xsubmit_notNewValSet_succeeds() (gas: 1024539)
OmniPortal_xsubmit_Test:test_xsubmit_oldValSet_reverts() (gas: 493181)
OmniPortal_xsubmit_Test:test_xsubmit_reentrancy_reverts() (gas: 247567)
OmniPortal_xsubmit_Test:test_xsubmit_unknownValSetId_reverts() (gas: 485139)
OmniPortal_xsubmit_Test:test_xsubmit_wrongConsensusChainId_reverts() (gas: 482188)
OmniPortal_xsubmit_Test:test_xsubmit_wrongDestChainId_reverts() (gas: 537613)
OmniPortal_xsubmit_Test:test_xsubmit_wrongStreamOffset_reverts() (gas: 540012)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_chainB_succeeds() (gas: 765164)
OmniPortal_xsubmit_Test:test_xsubmit_xblock1_succeeds() (gas: 765237)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_chainB_succeeds() (gas: 1346729)
OmniPortal_xsubmit_Test:test_xsubmit_xblock2_succeeds() (gas: 1346698)
OmniPortal_xsubmit_gas_Test:test_singleExec() (gas: 877270)
OmniPortal_xsubmit_gas_Test:test_xsubmit_addValidator_succeeds() (gas: 345525)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_10validators_succeeds() (gas: 2898438)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_25validators_succeeds() (gas: 4242538)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle10_succeeds() (gas: 1679272)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_100validators_succeeds() (gas: 11665016)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_10validators_succeeds() (gas: 1561411)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_25validators_succeeds() (gas: 2903787)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle1_succeeds() (gas: 344062)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_10validators_succeeds() (gas: 5298542)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_25validators_succeeds() (gas: 6645307)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle25_succeeds() (gas: 4076245)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_100validators_succeeds() (gas: 19913993)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_10validators_succeeds() (gas: 9757536)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_25validators_succeeds() (gas: 11108760)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle50_succeeds() (gas: 8529982)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_10validators_succeeds() (gas: 2166060)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_25validators_succeeds() (gas: 3509283)
OmniPortal_xsubmit_gas_Test:test_xsubmit_guzzle5_succeeds() (gas: 947935)
Omni_Test:test_constructor() (gas: 1008119)
PortalRegistry_Test:test_register() (gas: 1092038)
PortalRegistry_Test:test_stub() (gas: 143)
Expand Down
4 changes: 4 additions & 0 deletions contracts/core/test/utils/XSubGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ contract XSubGen is Test {

mapping(uint64 => Validator[]) public valset;

uint32 public valsetCount;

PortalHarness public portal;

constructor() {
Expand Down Expand Up @@ -160,13 +162,15 @@ contract XSubGen is Test {
genVals.push(v2);
genVals.push(v3);
genVals.push(v4);
++valsetCount;

// val set 2 adds one validator, and removes val2
Validator[] storage valSet2 = valset[genesisValSetId + 1];
valSet2.push(v1);
valSet2.push(v3);
valSet2.push(v4);
valSet2.push(v5);
++valsetCount;
}

/// @dev Sort sigs by validator address. OmniPortal.xsubmit expects sigs to be sorted.
Expand Down
124 changes: 114 additions & 10 deletions contracts/core/test/xchain/OmniPortal_xsubmit_gas.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,111 @@ import { console } from "forge-std/console.sol";
*/
contract OmniPortal_xsubmit_gas_Test is Base {
function test_xsubmit_guzzle1_succeeds() public {
_testGasSubmitXBlock("guzzle1", _guzzle_xblock({ numGuzzles: 1 }));
_testGasSubmitXBlock("guzzle1", 1, _guzzle_xblock({ numGuzzles: 1 }));
}

function test_xsubmit_guzzle1_10validators_succeeds() public {
uint64 valSetId = newValSet(10);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle1", valSetId, _guzzle_xblock({ numGuzzles: 1 }));
}

function test_xsubmit_guzzle1_25validators_succeeds() public {
uint64 valSetId = newValSet(25);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle1", valSetId, _guzzle_xblock({ numGuzzles: 1 }));
}

function test_xsubmit_guzzle1_100validators_succeeds() public {
uint64 valSetId = newValSet(100);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle1", valSetId, _guzzle_xblock({ numGuzzles: 1 }));
}

function test_xsubmit_guzzle5_succeeds() public {
_testGasSubmitXBlock("guzzle5", _guzzle_xblock({ numGuzzles: 5 }));
_testGasSubmitXBlock("guzzle5", 1, _guzzle_xblock({ numGuzzles: 5 }));
}

function test_xsubmit_guzzle5_10validators_succeeds() public {
uint64 valSetId = newValSet(10);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle5", valSetId, _guzzle_xblock({ numGuzzles: 5 }));
}

function test_xsubmit_guzzle5_25validators_succeeds() public {
uint64 valSetId = newValSet(25);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle5", valSetId, _guzzle_xblock({ numGuzzles: 5 }));
}

function test_xsubmit_guzzle10_succeeds() public {
_testGasSubmitXBlock("guzzle10", _guzzle_xblock({ numGuzzles: 10 }));
_testGasSubmitXBlock("guzzle10", 1, _guzzle_xblock({ numGuzzles: 10 }));
}

function test_xsubmit_guzzle10_10validators_succeeds() public {
uint64 valSetId = newValSet(10);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle10", valSetId, _guzzle_xblock({ numGuzzles: 10 }));
}

function test_xsubmit_guzzle10_25validators_succeeds() public {
uint64 valSetId = newValSet(25);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle10", valSetId, _guzzle_xblock({ numGuzzles: 10 }));
}

function test_xsubmit_guzzle25_succeeds() public {
_testGasSubmitXBlock("guzzle25", _guzzle_xblock({ numGuzzles: 25 }));
_testGasSubmitXBlock("guzzle25", 1, _guzzle_xblock({ numGuzzles: 25 }));
}

function test_xsubmit_guzzle25_10validators_succeeds() public {
uint64 valSetId = newValSet(10);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle25", valSetId, _guzzle_xblock({ numGuzzles: 25 }));
}

function test_xsubmit_guzzle25_25validators_succeeds() public {
uint64 valSetId = newValSet(25);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle25", valSetId, _guzzle_xblock({ numGuzzles: 25 }));
}

function test_xsubmit_guzzle50_succeeds() public {
_testGasSubmitXBlock("guzzle50", _guzzle_xblock({ numGuzzles: 50 }));
_testGasSubmitXBlock("guzzle50", 1, _guzzle_xblock({ numGuzzles: 50 }));
}

function test_xsubmit_guzzle50_10validators_succeeds() public {
uint64 valSetId = newValSet(10);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle50", valSetId, _guzzle_xblock({ numGuzzles: 50 }));
}

function test_xsubmit_guzzle50_25validators_succeeds() public {
uint64 valSetId = newValSet(25);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle50", valSetId, _guzzle_xblock({ numGuzzles: 50 }));
}

function test_xsubmit_guzzle50_100validators_succeeds() public {
uint64 valSetId = newValSet(100);
_silentTestGasSubmitXBlock(1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_silentTestGasSubmitXBlock(2, _addValidatorSet_xblock({ valSetId: valSetId }), broadcastChainId);
_testGasSubmitXBlock("guzzle50", valSetId, _guzzle_xblock({ numGuzzles: 50 }));
}

function test_xsubmit_addValidator_succeeds() public {
_testGasSubmitXBlock("addValSet2", _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
_testGasSubmitXBlock("addValSet2", 1, _addValidatorSet_xblock({ valSetId: 2 }), broadcastChainId);
}

function test_singleExec() public {
Expand All @@ -59,13 +143,33 @@ contract OmniPortal_xsubmit_gas_Test is Base {
}
}

function _testGasSubmitXBlock(string memory name, TestXTypes.Block memory xblock) internal {
_testGasSubmitXBlock(name, xblock, thisChainId);
function _silentTestGasSubmitXBlock(uint64 valSetId, TestXTypes.Block memory xblock, uint64 destChainId) internal {
XTypes.Submission memory xsub =
makeXSub(valSetId, xblock.blockHeader, xblock.msgs, msgFlagsForDest(xblock.msgs, destChainId));

uint64 sourceChainId = xsub.blockHeader.sourceChainId;
uint64 shardId = xsub.msgs[xsub.msgs.length - 1].shardId;
uint64 expectedOffset = xsub.msgs[xsub.msgs.length - 1].offset;

vm.chainId(destChainId);
portal.xsubmit(xsub);

assertEq(portal.inXMsgOffset(sourceChainId, shardId), expectedOffset);
assertEq(portal.inXBlockOffset(sourceChainId, shardId), xsub.blockHeader.offset);
}

function _testGasSubmitXBlock(string memory name, uint64 valSetId, TestXTypes.Block memory xblock) internal {
_testGasSubmitXBlock(name, valSetId, xblock, thisChainId);
}

function _testGasSubmitXBlock(string memory name, TestXTypes.Block memory xblock, uint64 destChainId) internal {
function _testGasSubmitXBlock(
string memory name,
uint64 valSetId,
TestXTypes.Block memory xblock,
uint64 destChainId
) internal {
XTypes.Submission memory xsub =
makeXSub(1, xblock.blockHeader, xblock.msgs, msgFlagsForDest(xblock.msgs, destChainId));
makeXSub(valSetId, xblock.blockHeader, xblock.msgs, msgFlagsForDest(xblock.msgs, destChainId));

uint64 sourceChainId = xsub.blockHeader.sourceChainId;
uint64 shardId = xsub.msgs[xsub.msgs.length - 1].shardId;
Expand Down
17 changes: 17 additions & 0 deletions contracts/core/test/xchain/common/Fixtures.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ contract Fixtures is CommonBase, StdCheats, XSubGen {
return _getSignatures(valSetId, digest);
}

/// @dev Generate a new valset of an arbitrary size
function newValSet(uint32 valSetSize) public returns (uint64 valSetId) {
require(valSetSize >= 3, "Validator set size is too small");

valSetId = ++valsetCount;
Validator[] storage newValset = valset[valSetId];

for (uint32 i; i < valSetSize; ++i) {
Validator memory validator;
(address val, uint256 valPk) = deriveRememberKey(mnemonic, i);
validator = Validator(val, baseValPower, valPk);
newValset.push(validator);
}

return valSetId;
}

/// @dev Sort sigs by validator address. OmniPortal.xsubmit expects sigs to be sorted.
/// Func is not really 'pure', because it modifies the input array in place. But it does not depend on contract state.
function _sortSigsByAddr(XTypes.SigTuple[] memory sigs) internal pure {
Expand Down

0 comments on commit 4ff3a6c

Please sign in to comment.