diff --git a/contracts/src/gateway/GatewayGetterFacet.sol b/contracts/src/gateway/GatewayGetterFacet.sol index 831f2c586..d69105097 100644 --- a/contracts/src/gateway/GatewayGetterFacet.sol +++ b/contracts/src/gateway/GatewayGetterFacet.sol @@ -6,6 +6,7 @@ import {QuorumInfo} from "../structs/Quorum.sol"; import {SubnetID, Subnet} from "../structs/Subnet.sol"; import {Membership} from "../structs/Subnet.sol"; import {LibGateway} from "../lib/LibGateway.sol"; +import {LibStaking} from "../lib/LibStaking.sol"; import {LibQuorum} from "../lib/LibQuorum.sol"; import {GatewayActorStorage} from "../lib/LibGatewayActorStorage.sol"; import {SubnetIDHelper} from "../lib/SubnetIDHelper.sol"; @@ -20,6 +21,12 @@ contract GatewayGetterFacet { using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; + /// @notice Returns the next and start configuration numbers in the validator changes. + /// The configuration numbers are from changes made in the parent. + function getValidatorConfigurationNumbers() external view returns (uint64, uint64) { + return LibStaking.getConfigurationNumbers(); + } + /// @notice Returns code commit SHA where this contract is from. function getCommitSha() external view returns (bytes32) { return s.commitSha; diff --git a/contracts/src/gateway/router/TopDownFinalityFacet.sol b/contracts/src/gateway/router/TopDownFinalityFacet.sol index bd9e2fbcf..3e1088793 100644 --- a/contracts/src/gateway/router/TopDownFinalityFacet.sol +++ b/contracts/src/gateway/router/TopDownFinalityFacet.sol @@ -35,6 +35,15 @@ contract TopDownFinalityFacet is GatewayActorModifiers { s.validatorsTracker.batchStoreChange(changeRequests); } + /// @notice Returns the next and start configuration numbers in the tracker of changes + /// from the parent in the child gateway + function getTrackerConfigurationNumbers() external view returns (uint64, uint64) { + return ( + s.validatorsTracker.changes.nextConfigurationNumber, + s.validatorsTracker.changes.startConfigurationNumber + ); + } + /// @notice Apply all changes committed through the commitment of parent finality. /// @return configurationNumber The configuration number of the changes set that has been confirmed. function applyFinalityChanges() external systemActorOnly returns (uint64) {