diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 198badfc5..a5edf0aed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,8 +45,8 @@ jobs: source scripts/constants.sh go test ./... - e2e_tests: - name: e2e_tests + teleporter_e2e: + name: teleporter-e2e-tests runs-on: ubuntu-22.04 steps: - name: Checkout repositories and submodules @@ -67,15 +67,52 @@ jobs: run: | export PATH=$PATH:$HOME/.foundry/bin export PATH="$PATH:$GOPATH/bin" - ./scripts/local/e2e_test.sh + ./scripts/local/e2e_test.sh --components teleporter - - name: Upload tmpnet network dir - uses: actions/upload-artifact@v4 - if: always() + governance_e2e: + name: governance-e2e-tests + runs-on: ubuntu-22.04 + steps: + - name: Checkout repositories and submodules + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Install Foundry + run: ./scripts/install_foundry.sh + + - name: Run E2E Tests + # Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc + run: | + export PATH=$PATH:$HOME/.foundry/bin + export PATH="$PATH:$GOPATH/bin" + ./scripts/local/e2e_test.sh --components governance + + validator_manager_e2e: + name: validator-manager-e2e-tests + runs-on: ubuntu-22.04 + steps: + - name: Checkout repositories and submodules + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Go + uses: actions/setup-go@v5 with: - name: e2e-tmpnet-data - path: | - ~/.tmpnet/networks - ~/.tmpnet/prometheus/prometheus.log - ~/.tmpnet/promtail/promtail.log - if-no-files-found: error + go-version-file: 'go.mod' + + - name: Install Foundry + run: ./scripts/install_foundry.sh + + - name: Run E2E Tests + # Forge installs to BASE_DIR, but updates the PATH definition in $HOME/.bashrc + run: | + export PATH=$PATH:$HOME/.foundry/bin + export PATH="$PATH:$GOPATH/bin" + ./scripts/local/e2e_test.sh --components validator-manager diff --git a/.gitignore b/.gitignore index 922ef3288..babc5dac1 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ server.log # Forge documentation docs/ +coverage/ diff --git a/abi-bindings/go/validator-manager/ERC20TokenStakingManager/ERC20TokenStakingManager.go b/abi-bindings/go/validator-manager/ERC20TokenStakingManager/ERC20TokenStakingManager.go index 8da6be672..f62018b5b 100644 --- a/abi-bindings/go/validator-manager/ERC20TokenStakingManager/ERC20TokenStakingManager.go +++ b/abi-bindings/go/validator-manager/ERC20TokenStakingManager/ERC20TokenStakingManager.go @@ -31,9 +31,15 @@ var ( // InitialValidator is an auto generated low-level Go binding around an user-defined struct. type InitialValidator struct { - NodeID [32]byte - Weight uint64 + NodeID []byte BlsPublicKey []byte + Weight uint64 +} + +// PChainOwner is an auto generated low-level Go binding around an user-defined struct. +type PChainOwner struct { + Threshold uint32 + Addresses []common.Address } // PoSValidatorManagerSettings is an auto generated low-level Go binding around an user-defined struct. @@ -49,7 +55,7 @@ type PoSValidatorManagerSettings struct { // SubnetConversionData is an auto generated low-level Go binding around an user-defined struct. type SubnetConversionData struct { - ConvertSubnetTxID [32]byte + SubnetID [32]byte ValidatorManagerBlockchainID [32]byte ValidatorManagerAddress common.Address InitialValidators []InitialValidator @@ -58,7 +64,7 @@ type SubnetConversionData struct { // Validator is an auto generated low-level Go binding around an user-defined struct. type Validator struct { Status uint8 - NodeID [32]byte + NodeID []byte StartingWeight uint64 MessageNonce uint64 Weight uint64 @@ -75,15 +81,17 @@ type ValidatorManagerSettings struct { // ValidatorRegistrationInput is an auto generated low-level Go binding around an user-defined struct. type ValidatorRegistrationInput struct { - NodeID [32]byte - RegistrationExpiry uint64 - BlsPublicKey []byte + NodeID []byte + BlsPublicKey []byte + RegistrationExpiry uint64 + RemainingBalanceOwner PChainOwner + DisableOwner PChainOwner } // ERC20TokenStakingManagerMetaData contains all meta data concerning the ERC20TokenStakingManager contract. var ERC20TokenStakingManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ERC20_STAKING_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_DELEGATION_FEE_BIPS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_STAKE_MULTIPLIER_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"POS_VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimDelegationFees\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeDelegatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndDelegation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structPoSValidatorManagerSettings\",\"components\":[{\"name\":\"baseSettings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"minimumDelegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20Mintable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeDelegatorRegistration\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"delegationAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"convertSubnetTxID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendUpdateDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitUptimeProof\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"DelegationEnded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewards\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorAdded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"delegatorAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"delegatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRegistered\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"startTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRemovalInitialized\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UptimeUpdated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AddressInsufficientBalance\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"DelegatorIneligibleForRewards\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDelegationFee\",\"inputs\":[{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationID\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumDelegatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMinStakeDuration\",\"inputs\":[{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidNonce\",\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeAmount\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeMultiplier\",\"inputs\":[{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidTokenAddress\",\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MaxWeightExceeded\",\"inputs\":[{\"name\":\"newValidatorWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MinStakeDurationNotPassed\",\"inputs\":[{\"name\":\"endTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedOwner\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"type\":\"error\",\"name\":\"ValidatorIneligibleForRewards\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ValidatorNotPoS\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b506040516154c13803806154c183398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6153748061014d5f395ff3fe608060405234801561000f575f80fd5b50600436106101f2575f3560e01c80638280a25a11610114578063bc5fbfec116100a9578063df93d8de11610079578063df93d8de14610451578063e4a63c401461045b578063e7d14c1c1461046f578063eb0acb89146104ad578063f09969ae146104c0575f80fd5b8063bc5fbfec14610402578063bee0a03f14610416578063c974d1b614610429578063d5f20ff614610431575f80fd5b8063a3a65e48116100e4578063a3a65e48146103a2578063afb98096146103b5578063b771b3bc146103c9578063ba3a4b97146103ef575f80fd5b80638280a25a1461036157806393e245981461036957806398f3e2b41461037c5780639e1bc4ef1461038f575f80fd5b8063467ef06f1161018a578063620658561161015a578063620658561461031357806366435abf14610334578063732214f81461034757806376f786211461034e575f80fd5b8063467ef06f146102bd5780635297fae6146102d057806360305d62146102e357806361e2f49014610300575f80fd5b806325e1c776116101c557806325e1c776146102505780632e2194d81461026357806335455ded1461028e5780633a1cfff6146102aa575f80fd5b80630118acc4146101f65780630322ed981461020b578063151d30d11461021e5780631ec447241461023d575b5f80fd5b610209610204366004614897565b6104d3565b005b6102096102193660046148d2565b610508565b610226600a81565b60405160ff90911681526020015b60405180910390f35b61020961024b366004614897565b61068f565b61020961025e3660046148e9565b61069a565b6102766102713660046148d2565b61070e565b6040516001600160401b039091168152602001610234565b61029761271081565b60405161ffff9091168152602001610234565b6102096102b8366004614897565b610724565b6102096102cb366004614913565b61072f565b6102096102de36600461492c565b6107f1565b6102eb601481565b60405163ffffffff9091168152602001610234565b61020961030e366004614954565b610a5c565b6103266103213660046149af565b610f0f565b604051908152602001610234565b6102766103423660046148d2565b610f28565b6103265f81565b61020961035c366004614897565b610f3c565b610226603081565b6102096103773660046148d2565b610f67565b61020961038a36600461492c565b611032565b61032661039d3660046149c8565b61120a565b6102096103b0366004614913565b611236565b6103265f805160206152e883398151915281565b6103d76005600160991b0181565b6040516001600160a01b039091168152602001610234565b6102096103fd3660046148d2565b6113bf565b6103265f8051602061530883398151915281565b6102096104243660046148d2565b6115a8565b610226601481565b61044461043f3660046148d2565b6116e5565b6040516102349190614a10565b6102766202a30081565b6103265f805160206152c883398151915281565b61032661047d3660046148d2565b5f9081527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb08602052604090205490565b6103266104bb366004614a8a565b6117ad565b6102096104ce366004614b03565b6117e2565b6104de8383836118c1565b61050357604051631036cf9160e11b8152600481018490526024015b60405180910390fd5b505050565b5f8181525f805160206153488339815191526020526040808220815160e0810190925280545f8051602061530883398151915293929190829060ff166005811115610555576105556149e8565b6005811115610566576105666149e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c090910152909150815160058111156105d5576105d56149e8565b14610608575f8381526007830160205260409081902054905163170cc93360e21b81526104fa9160ff1690600401614b41565b6005600160991b016001600160a01b031663ee5b48eb61062d8584606001515f611b46565b6040518263ffffffff1660e01b81526004016106499190614b71565b6020604051808303815f875af1158015610665573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106899190614ba3565b50505050565b6106898383836118c1565b6106a382611b95565b6106c3576040516330efa98b60e01b8152600481018390526024016104fa565b5f6106cd836116e5565b51905060028160058111156106e4576106e46149e8565b14610704578060405163170cc93360e21b81526004016104fa9190614b41565b6106898383611bd0565b5f61071e64e8d4a5100083614bce565b92915050565b610689838383611e4a565b610737612043565b5f805160206152e88339815191525f806107508461207a565b9150915061075d82611b95565b610769575050506107d8565b5f82815260048085016020526040909120546001600160a01b03169082516005811115610798576107986149e8565b036107bd575f838152600785016020526040812080549190556107bb8282612311565b505b6107d3816107ce8460400151610f0f565b612387565b505050505b6107ee60015f8051602061532883398151915255565b50565b5f8181525f805160206152a88339815191526020526040808220815160e0810190925280545f805160206152e883398151915293929190829060ff16600381111561083e5761083e6149e8565b600381111561084f5761084f6149e8565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f6108c5826116e5565b90506001835160038111156108dc576108dc6149e8565b146108fd578251604051633b0d540d60e21b81526104fa9190600401614bed565b600481516005811115610912576109126149e8565b0361092857610920856123bd565b505050505050565b5f8061093f610936896125a4565b604001516126ba565b509150915081841461096c57846040015160405163089938b360e11b81526004016104fa91815260200190565b806001600160401b031683606001516001600160401b031610806109a55750806001600160401b03168560a001516001600160401b0316115b156109ce57604051632e19bc2d60e11b81526001600160401b03821660048201526024016104fa565b5f878152600587016020908152604091829020805460ff1916600290811782550180546001600160401b034216600160401b81026fffffffffffffffff000000000000000019909216919091179091559151918252859189917f047059b465069b8b751836b41f9f1d83daff583d2238cc7fbb461437ec23a4f6910160405180910390a35050505050505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f805160206153088339815191529060ff1615610aae57604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610af1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b159190614ba3565b836020013514610b3e576040516372b0a7e760e11b8152602084013560048201526024016104fa565b30610b4f6060850160408601614c07565b6001600160a01b031614610b9257610b6d6060840160408501614c07565b604051632f88120d60e21b81526001600160a01b0390911660048201526024016104fa565b5f610ba06060850185614c22565b905090505f805b828163ffffffff161015610e4f575f610bc36060880188614c22565b8363ffffffff16818110610bd957610bd9614c67565b9050602002810190610beb9190614c7b565b610bf490614d2b565b80515f8181526008880160205260409020549192509015610c2b57604051631ec583cb60e11b8152600481018290526024016104fa565b5f6002895f013585604051602001610c5a92919091825260e01b6001600160e01b031916602082015260240190565b60408051601f1981840301815290829052610c7491614dc2565b602060405180830381855afa158015610c8f573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610cb29190614ba3565b5f8381526008890160209081526040808320849055805160e0810182526002815287518184015287830180516001600160401b039081168385015260608301869052905181166080830152421660a082015260c0810184905284845260078c01909252909120815181549394509192909190829060ff19166001836005811115610d3e57610d3e6149e8565b0217905550602082810151600183015560408301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff191692841692909217909155840151610df1911686614dd3565b83516020808601516040516001600160401b039091168152929750909183917fb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014910160405180910390a350505080610e4890614de6565b9050610ba7565b50600483018190555f610e6d610e64866125a4565b604001516128f8565b90505f610e7987612a6d565b90505f600282604051610e8c9190614dc2565b602060405180830381855afa158015610ea7573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610eca9190614ba3565b9050828114610ef657604051631872fc8d60e01b815260048101829052602481018490526044016104fa565b5050506009909201805460ff1916600117905550505050565b5f61071e6001600160401b03831664e8d4a51000614e08565b5f610f32826116e5565b6080015192915050565b610f47838383611e4a565b61050357604051635bff683f60e11b8152600481018490526024016104fa565b5f805160206152e88339815191525f610f7f836116e5565b5190506004816005811115610f9657610f966149e8565b14610fb6578060405163170cc93360e21b81526004016104fa9190614b41565b5f8381526004830160205260409020546001600160a01b03163314610ffc57335b604051636e2ccd7560e11b81526001600160a01b0390911660048201526024016104fa565b5f83815260078301602090815260408083208054908490556004860190925290912054610689906001600160a01b031682612311565b61103a612043565b5f8181525f805160206152a88339815191526020526040808220815160e0810190925280545f805160206152e883398151915293929190829060ff166003811115611087576110876149e8565b6003811115611098576110986149e8565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101529050600381516003811115611111576111116149e8565b14611132578051604051633b0d540d60e21b81526104fa9190600401614bed565b600461114182604001516116e5565b516005811115611153576111536149e8565b146111e5575f611162856125a4565b90505f8061117383604001516126ba565b50915091508184604001511461119f5760405163089938b360e11b8152600481018390526024016104fa565b806001600160401b03168460c001516001600160401b031611156111e157604051632e19bc2d60e11b81526001600160401b03821660048201526024016104fa565b5050505b6111ee836123bd565b505061120660015f8051602061532883398151915255565b5050565b5f611213612043565b61121e833384612bf3565b905061071e60015f8051602061532883398151915255565b5f805160206153088339815191525f8061125b611252856125a4565b60400151612ecb565b915091508061128157604051632d07135360e01b815281151560048201526024016104fa565b5f8281526006840160205260409020805461129b90614e1f565b90505f036112bf5760405163089938b360e11b8152600481018390526024016104fa565b60015f83815260078501602052604090205460ff1660058111156112e5576112e56149e8565b14611318575f8281526007840160205260409081902054905163170cc93360e21b81526104fa9160ff1690600401614b41565b5f8281526006840160205260408120611330916147e7565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f8181525f805160206152a88339815191526020526040808220815160e0810190925280545f805160206152e883398151915293929190829060ff16600381111561140c5761140c6149e8565b600381111561141d5761141d6149e8565b8152815461010090046001600160a01b0316602082015260018083015460408301526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c09091015290915081516003811115611496576114966149e8565b141580156114b757506003815160038111156114b4576114b46149e8565b14155b156114d8578051604051633b0d540d60e21b81526104fa9190600401614bed565b5f6114e682604001516116e5565b905080606001516001600160401b03165f03611518576040516339b894f960e21b8152600481018590526024016104fa565b6005600160991b016001600160a01b031663ee5b48eb611545846040015184606001518560800151611b46565b6040518263ffffffff1660e01b81526004016115619190614b71565b6020604051808303815f875af115801561157d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115a19190614ba3565b5050505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f8051602061530883398151915291906115ef90614e1f565b90505f036116135760405163089938b360e11b8152600481018390526024016104fa565b60015f83815260078301602052604090205460ff166005811115611639576116396149e8565b1461166c575f8281526007820160205260409081902054905163170cc93360e21b81526104fa9160ff1690600401614b41565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb916116a59190600401614e57565b6020604051808303815f875af11580156116c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105039190614ba3565b6116ed61481e565b5f8281525f80516020615348833981519152602052604090819020815160e0810190925280545f80516020615308833981519152929190829060ff16600581111561173a5761173a6149e8565b600581111561174b5761174b6149e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a083015260039092015490911660c0909101529392505050565b5f6117b6612043565b6117c28585858561306f565b90506117da60015f8051602061532883398151915255565b949350505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff168061182b575080546001600160401b03808416911610155b156118495760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556118748484613248565b805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b5f8381525f805160206152a88339815191526020526040808220815160e0810190925280545f805160206152e88339815191529284929091829060ff16600381111561190f5761190f6149e8565b6003811115611920576119206149e8565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f611996826116e5565b90506002835160038111156119ad576119ad6149e8565b146119ce578251604051633b0d540d60e21b81526104fa9190600401614bed565b60208301516001600160a01b031633146119e85733610fd7565b6002815160058111156119fd576119fd6149e8565b03611ada578615611a1457611a128287611bd0565b505b5f8881526005850160205260409020805460ff1916600317905560608301516080820151611a4d918491611a489190614ee1565b613262565b505f898152600586016020526040812060020180546001600160401b03909316600160c01b026001600160c01b0390931692909217909155611a8e846133b9565b5f8a81526006870160205260408082208390555191925084918b917f366d336c0ab380dc799f095a6f82a26326585c52909cc698b09ba4540709ed5791a315159450611b3f9350505050565b600481516005811115611aef57611aef6149e8565b03611b2357611afd836133b9565b5f898152600686016020526040902055611b16886123bd565b6001945050505050611b3f565b805160405163170cc93360e21b81526104fa9190600401614b41565b9392505050565b604080515f6020820152600160e11b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b5f9081527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020546001600160a01b0316151590565b6040516306f8253560e41b815263ffffffff821660048201525f90819081906005600160991b0190636f825350906024015f60405180830381865afa158015611c1b573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611c429190810190614f0c565b9150915080611c6457604051636b2f19e960e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ca7573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611ccb9190614ba3565b825114611cf1578151604051636ba589a560e01b815260048101919091526024016104fa565b60208201516001600160a01b031615611d2d576020820151604051624de75d60e31b81526001600160a01b0390911660048201526024016104fa565b5f80611d3c8460400151613565565b91509150818714611d635760405163089938b360e11b8152600481018890526024016104fa565b5f8781527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020600101545f805160206152e8833981519152906001600160401b039081169083161115611e20575f888152600482016020908152604091829020600101805467ffffffffffffffff19166001600160401b038616908117909155915191825289917fec44148e8ff271f2d0bacef1142154abacb0abb3a29eb3eb50e2ca97e86d0435910160405180910390a2611e3f565b5f8881526004820160205260409020600101546001600160401b031691505b509695505050505050565b5f5f805160206152e883398151915281611e6386613740565b9050611e6e86611b95565b611e7d57600192505050611b3f565b5f8681526004830160205260409020546001600160a01b03163314611ea25733610fd7565b5f86815260048301602052604090205460a0820151611ed191600160b01b90046001600160401b031690614fde565b6001600160401b03168160c001516001600160401b03161015611f185760c081015160405163fb6ce63f60e01b81526001600160401b0390911660048201526024016104fa565b5f8515611f3057611f298786611bd0565b9050611f4e565b505f8681526004830160205260409020600101546001600160401b03165b600383015460408301515f916001600160a01b03169063778c06b590611f7390610f0f565b60a086015160c087015160405160e085901b6001600160e01b031916815260048101939093526001600160401b0391821660248401819052604484015281166064830152851660848201525f60a4820181905260c482015260e401602060405180830381865afa158015611fe9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061200d9190614ba3565b905080846007015f8a81526020019081526020015f205f8282546120319190614dd3565b90915550501515979650505050505050565b5f8051602061532883398151915280546001190161207457604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f61208361481e565b5f805160206153088339815191525f8061209f611252876125a4565b9150915080156120c657604051632d07135360e01b815281151560048201526024016104fa565b5f828152600784016020526040808220815160e081019092528054829060ff1660058111156120f7576120f76149e8565b6005811115612108576121086149e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c09091015290915081516005811115612177576121776149e8565b141580156121985750600181516005811115612195576121956149e8565b14155b156121b957805160405163170cc93360e21b81526104fa9190600401614b41565b6003815160058111156121ce576121ce6149e8565b036121dc57600481526121e1565b600581525b6020808201515f908152600886018252604080822082905585825260078701909252208151815483929190829060ff19166001836005811115612226576122266149e8565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff191691909216179055805160058111156122da576122da6149e8565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b5f5f805160206152c883398151915280546040516340c10f1960e01b81526001600160a01b038681166004830152602482018690529293509116906340c10f19906044015f604051808303815f87803b15801561236c575f80fd5b505af115801561237e573d5f803e3d5ffd5b50505050505050565b5f805160206152c883398151915254611206906001600160a01b03168383613992565b60015f8051602061532883398151915255565b5f8181525f805160206152a88339815191526020526040808220815160e0810190925280545f805160206152e883398151915293929190829060ff16600381111561240a5761240a6149e8565b600381111561241b5761241b6149e8565b8152815461010090046001600160a01b03166020808301919091526001808401546040808501919091526002948501546001600160401b038082166060870152600160401b820481166080870152600160801b8204811660a0870152600160c01b9091041660c090940193909352848301515f89815260058901845284812080546001600160a81b03191681559283018190559190940181905560068701909152908120805490829055929350909190808215612549575f848152600487016020526040902054612710906124fb90600160a01b900461ffff1685614e08565b6125059190614bce565b915081866007015f8681526020019081526020015f205f8282546125299190614dd3565b9091555061253990508284614ffe565b9050612549856020015182612311565b61255e85602001516107ce8760600151610f0f565b6040805182815260208101849052859189917f8ececf510070c320d9a55323ffabe350e294ae505fc0c509dc5736da6f5cc993910160405180910390a350505050505050565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015612608573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261262f9190810190614f0c565b915091508061265157604051636b2f19e960e01b815260040160405180910390fd5b815115612677578151604051636ba589a560e01b815260048101919091526024016104fa565b60208201516001600160a01b0316156126b3576020820151604051624de75d60e31b81526001600160a01b0390911660048201526024016104fa565b5092915050565b5f805f83516036146126df57604051638d0242c960e01b815260040160405180910390fd5b5f805b600281101561272e576126f6816001614ffe565b612701906008614e08565b61ffff1686828151811061271757612717614c67565b016020015160f81c901b91909117906001016126e2565b5061ffff8116156127525760405163059510e360e31b815260040160405180910390fd5b5f805b60048110156127ad57612769816003614ffe565b612774906008614e08565b63ffffffff1687612786836002614dd3565b8151811061279657612796614c67565b016020015160f81c901b9190911790600101612755565b5063ffffffff81166004146127d557604051635b60892f60e01b815260040160405180910390fd5b5f805b602081101561282a576127ec81601f614ffe565b6127f7906008614e08565b88612803836006614dd3565b8151811061281357612813614c67565b016020015160f81c901b91909117906001016127d8565b505f805b600881101561288957612842816007614ffe565b61284d906008614e08565b6001600160401b031689612862836026614dd3565b8151811061287257612872614c67565b016020015160f81c901b919091179060010161282e565b505f805b60088110156128e8576128a1816007614ffe565b6128ac906008614e08565b6001600160401b03168a6128c183602e614dd3565b815181106128d1576128d1614c67565b016020015160f81c901b919091179060010161288d565b5091989097509095509350505050565b5f815160261461291b57604051638d0242c960e01b815260040160405180910390fd5b5f805b600281101561296a57612932816001614ffe565b61293d906008614e08565b61ffff1684828151811061295357612953614c67565b016020015160f81c901b919091179060010161291e565b5061ffff81161561298e5760405163059510e360e31b815260040160405180910390fd5b5f805b60048110156129e9576129a5816003614ffe565b6129b0906008614e08565b63ffffffff16856129c2836002614dd3565b815181106129d2576129d2614c67565b016020015160f81c901b9190911790600101612991565b5063ffffffff811615612a0f57604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612a6457612a2681601f614ffe565b612a31906008614e08565b86612a3d836006614dd3565b81518110612a4d57612a4d614c67565b016020015160f81c901b9190911790600101612a12565b50949350505050565b60605f823560208401356014612a8886860160408801614c07565b612a956060880188614c22565b604051612aee969594939250602001948552602085019390935260e091821b6001600160e01b0319908116604086015260609190911b6bffffffffffffffffffffffff1916604485015291901b166058820152605c0190565b60405160208183030381529060405290505f5b612b0e6060850185614c22565b90508110156126b35781612b256060860186614c22565b83818110612b3557612b35614c67565b9050602002810190612b479190614c7b565b35612b556060870187614c22565b84818110612b6557612b65614c67565b9050602002810190612b779190614c7b565b612b889060408101906020016149af565b612b956060880188614c22565b85818110612ba557612ba5614c67565b9050602002810190612bb79190614c7b565b612bc5906040810190615011565b604051602001612bd9959493929190615053565b60408051601f198184030181529190529150600101612b01565b5f5f805160206152e883398151915281612c0f610271856139f1565b90505f612c1b876116e5565b9050612c2687611b95565b612c46576040516330efa98b60e01b8152600481018890526024016104fa565b600281516005811115612c5b57612c5b6149e8565b14612c7c57805160405163170cc93360e21b81526104fa9190600401614b41565b5f828260800151612c8d9190614fde565b905083600201600a9054906101000a90046001600160401b03168260400151612cb69190615098565b6001600160401b0316816001600160401b03161115612cf357604051636d51fe0560e11b81526001600160401b03821660048201526024016104fa565b5f80612cff8a84613262565b915091505f8a83604051602001612d2d92919091825260c01b6001600160c01b031916602082015260280190565b60408051601f19818403018152828252805160209091012060e08301909152915080600181526001600160a01b038c1660208083019190915260408083018f90526001600160401b03808b1660608501525f6080850181905290881660a085015260c090930183905284835260058b01909152902081518154829060ff19166001836003811115612dc057612dc06149e8565b02179055506020828101518254610100600160a81b0319166101006001600160a01b039283160217835560408085015160018501556060808601516002909501805460808089015160a08a015160c0909a01516001600160401b03998a166001600160801b031990941693909317600160401b918a1691909102176001600160801b0316600160801b998916999099026001600160c01b031698909817600160c01b91881691909102179055815189861681528a861694810194909452938b1690830152918101859052908c16918d9184917fb0024b263bc3a0b728a6edea50a69efa841189f8d32ee8af9d1c2b1a1a223426910160405180910390a49a9950505050505050505050565b5f808251602714612eef57604051638d0242c960e01b815260040160405180910390fd5b5f805b6002811015612f3e57612f06816001614ffe565b612f11906008614e08565b61ffff16858281518110612f2757612f27614c67565b016020015160f81c901b9190911790600101612ef2565b5061ffff811615612f625760405163059510e360e31b815260040160405180910390fd5b5f805b6004811015612fbd57612f79816003614ffe565b612f84906008614e08565b63ffffffff1686612f96836002614dd3565b81518110612fa657612fa6614c67565b016020015160f81c901b9190911790600101612f65565b5063ffffffff8116600314612fe557604051635b60892f60e01b815260040160405180910390fd5b5f805b602081101561303a57612ffc81601f614ffe565b613007906008614e08565b87613013836006614dd3565b8151811061302357613023614c67565b016020015160f81c901b9190911790600101612fe8565b505f8660268151811061304f5761304f614c67565b016020015191976001600160f81b03199092161515965090945050505050565b7f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d02545f905f805160206152e883398151915290600160401b900461ffff90811690861610806130c3575061271061ffff8616115b156130e757604051635f12e6c360e11b815261ffff861660048201526024016104fa565b60028101546001600160401b039081169085161015613123576040516202a06d60e11b81526001600160401b03851660048201526024016104fa565b80548310806131355750806001015483115b156131565760405163222d164360e21b8152600481018490526024016104fa565b5f613160846139f1565b90505f61316c8261070e565b90505f6131798983613a14565b9050604051806080016040528061318d3390565b6001600160a01b03908116825261ffff808c166020808501919091526001600160401b03808d166040808701919091525f60609687018190528881526004909b018352998a902086518154938801519b8801518316600160b01b0267ffffffffffffffff60b01b199c909516600160a01b026001600160b01b03199094169516949094179190911798909816178155910151600190910180549190951667ffffffffffffffff19909116179093555090915050949350505050565b613250613e46565b61325982613e91565b61120681613eff565b5f8281525f80516020615348833981519152602052604081206002015481905f8051602061530883398151915290600160801b90046001600160401b03166132aa8582613f67565b5f6132b487614141565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6133048a858b611b46565b6040518263ffffffff1660e01b81526004016133209190614b71565b6020604051808303815f875af115801561333c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133609190614ba3565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b5f805f805160206152e883398151915290505f6133d984604001516116e5565b90505f6003825160058111156133f1576133f16149e8565b148061340f575060048251600581111561340d5761340d6149e8565b145b1561341f575060c081015161345c565b600282516005811115613434576134346149e8565b0361344057504261345c565b815160405163170cc93360e21b81526104fa9190600401614b41565b84608001516001600160401b0316816001600160401b03161161348357505f949350505050565b600383015460608601516001600160a01b039091169063778c06b5906134a890610f0f565b60a085015160808901516040808b01515f90815260048a810160205282822060010154925160e088901b6001600160e01b0319168152908101959095526001600160401b0393841660248601529183166044850152828716606485015291909116608483015260a4820181905260c482015260e401602060405180830381865afa158015613538573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061355c9190614ba3565b95945050505050565b5f808251602e1461358957604051638d0242c960e01b815260040160405180910390fd5b5f805b60028110156135d8576135a0816001614ffe565b6135ab906008614e08565b61ffff168582815181106135c1576135c1614c67565b016020015160f81c901b919091179060010161358c565b5061ffff8116156135fc5760405163059510e360e31b815260040160405180910390fd5b5f805b600481101561365757613613816003614ffe565b61361e906008614e08565b63ffffffff1686613630836002614dd3565b8151811061364057613640614c67565b016020015160f81c901b91909117906001016135ff565b5063ffffffff811660051461367f57604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156136d45761369681601f614ffe565b6136a1906008614e08565b876136ad836006614dd3565b815181106136bd576136bd614c67565b016020015160f81c901b9190911790600101613682565b505f805b6008811015613733576136ec816007614ffe565b6136f7906008614e08565b6001600160401b03168861370c836026614dd3565b8151811061371c5761371c614c67565b016020015160f81c901b91909117906001016136d8565b5090969095509350505050565b61374861481e565b5f8281525f805160206153488339815191526020526040808220815160e0810190925280545f8051602061530883398151915293929190829060ff166005811115613795576137956149e8565b60058111156137a6576137a66149e8565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a084015260039093015490921660c09091015290915081516005811115613818576138186149e8565b1461384b575f8481526007830160205260409081902054905163170cc93360e21b81526104fa9160ff1690600401614b41565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff1916600183600581111561388f5761388f6149e8565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f61393b8582613262565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b6040516001600160a01b0383811660248301526044820183905261050391859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b0383818316178352505050506141b6565b5f61071e825f805160206152c8833981519152546001600160a01b031690614217565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff16613a5857604051637fab81e560e01b815260040160405180910390fd5b5f8051602061530883398151915242613a7760408601602087016149af565b6001600160401b0316111580613ab15750613a956202a30042614dd3565b613aa560408601602087016149af565b6001600160401b031610155b15613aeb57613ac660408501602086016149af565b604051635879da1360e11b81526001600160401b0390911660048201526024016104fa565b6030613afa6040860186615011565b905014613b2c57613b0e6040850185615011565b6040516326475b2f60e11b81526104fa925060040190815260200190565b8335613b4e5760405163099e922360e21b8152843560048201526024016104fa565b83355f90815260088201602052604090205415613b8157604051631ec583cb60e11b8152843560048201526024016104fa565b613b8b835f613f67565b5f80613c246040518060a00160405280855f01548152602001885f01358152602001876001600160401b03168152602001886020016020810190613bcf91906149af565b6001600160401b03168152602001613bea60408a018a615011565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050915250614370565b5f82815260068601602052604090209193509150613c428282615107565b5085355f9081526008840160205260408082208490555163ee5b48eb60e01b81526005600160991b019063ee5b48eb90613c80908590600401614b71565b6020604051808303815f875af1158015613c9c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613cc09190614ba3565b6040805160e08101909152909150806001815288356020808301919091526001600160401b03891660408084018290525f60608501819052608085019290925260a0840182905260c0909301819052868152600788019091522081518154829060ff19166001836005811115613d3857613d386149e8565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909401516003909301805467ffffffffffffffff19169390941692909217909255829189359186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e918b91613e18918e01908e016149af565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16613e8f57604051631afcd79f60e31b815260040160405180910390fd5b565b613e99613e46565b613ea281614433565b613eaa61444c565b6107ee60608201356080830135613ec760c0850160a086016149af565b613ed760e0860160c087016151c2565b613ee8610100870160e088016151db565b613efa61012088016101008901614c07565b61445c565b613f07613e46565b5f805160206152c88339815191526001600160a01b038216613f4757604051637330680360e01b81526001600160a01b03831660048201526024016104fa565b80546001600160a01b0319166001600160a01b0392909216919091179055565b5f805160206153088339815191525f6001600160401b038084169085161115613f9b57613f948385614ee1565b9050613fa8565b613fa58484614ee1565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b031660608201524291158061400a575060018401548151614006916001600160401b031690614dd3565b8210155b15614030576001600160401b03831660608201528181526040810151602082015261404f565b82816060018181516140429190614fde565b6001600160401b03169052505b606081015161405f906064615098565b602082015160018601546001600160401b03929092169161408a9190600160401b900460ff16614e08565b10156140ba57606081015160405163dfae880160e01b81526001600160401b0390911660048201526024016104fa565b856001600160401b0316816040018181516140d59190614dd3565b9052506040810180516001600160401b03871691906140f5908390614ffe565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f8181525f805160206153488339815191526020526040812060020180545f80516020615308833981519152919060089061418b90600160401b90046001600160401b03166151fb565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b5f6141ca6001600160a01b0384168361458b565b905080515f141580156141ee5750808060200190518101906141ec9190615216565b155b1561050357604051635274afe760e01b81526001600160a01b03841660048201526024016104fa565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa15801561425d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142819190614ba3565b90506142986001600160a01b038516333086614598565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa1580156142dc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906143009190614ba3565b90508181116143665760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104fa565b61355c8282614ffe565b5f606082608001515160301461439957604051638d0242c960e01b815260040160405180910390fd5b5f806001855f015186602001518760400151886080015189606001516040516020016143cb9796959493929190615231565b60405160208183030381529060405290506002816040516143ec9190614dc2565b602060405180830381855afa158015614407573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061442a9190614ba3565b94909350915050565b61443b613e46565b6144436145d1565b6107ee816145d9565b614454613e46565b613e8f6146c1565b614464613e46565b5f805160206152e883398151915261ffff84161580614488575061271061ffff8516115b156144ac57604051635f12e6c360e11b815261ffff851660048201526024016104fa565b858711156144d05760405163222d164360e21b8152600481018890526024016104fa565b60ff831615806144e35750600a60ff8416115b156145065760405163170db35960e31b815260ff841660048201526024016104fa565b95865560018601949094556002850180546001600160401b039490941669ffffffffffffffffffff1990941693909317600160401b61ffff93909316929092029190911767ffffffffffffffff60501b191660ff91909116600160501b02179055600390910180546001600160a01b0319166001600160a01b03909216919091179055565b6060611b3f83835f6146c9565b6040516001600160a01b0384811660248301528381166044830152606482018390526106899186918216906323b872dd906084016139bf565b613e8f613e46565b6145e1613e46565b80355f80516020615308833981519152908155601461460660608401604085016151db565b60ff161180614625575061462060608301604084016151db565b60ff16155b156146595761463a60608301604084016151db565b604051634a59bbff60e11b815260ff90911660048201526024016104fa565b61466960608301604084016151db565b60018201805460ff92909216600160401b0260ff60401b1990921691909117905561469a60408301602084016149af565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b6123aa613e46565b6060814710156146ee5760405163cd78605960e01b81523060048201526024016104fa565b5f80856001600160a01b031684866040516147099190614dc2565b5f6040518083038185875af1925050503d805f8114614743576040519150601f19603f3d011682016040523d82523d5f602084013e614748565b606091505b5091509150614758868383614762565b9695505050505050565b60608261477757614772826147be565b611b3f565b815115801561478e57506001600160a01b0384163b155b156147b757604051639996b31560e01b81526001600160a01b03851660048201526024016104fa565b5080611b3f565b8051156147ce5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b5080546147f390614e1f565b5f825580601f10614802575050565b601f0160209004905f5260205f20908101906107ee919061485a565b6040805160e08101909152805f81525f6020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b5b8082111561486e575f815560010161485b565b5090565b80151581146107ee575f80fd5b803563ffffffff81168114614892575f80fd5b919050565b5f805f606084860312156148a9575f80fd5b8335925060208401356148bb81614872565b91506148c96040850161487f565b90509250925092565b5f602082840312156148e2575f80fd5b5035919050565b5f80604083850312156148fa575f80fd5b8235915061490a6020840161487f565b90509250929050565b5f60208284031215614923575f80fd5b611b3f8261487f565b5f806040838503121561493d575f80fd5b6149468361487f565b946020939093013593505050565b5f8060408385031215614965575f80fd5b82356001600160401b0381111561497a575f80fd5b83016080818603121561498b575f80fd5b915061490a6020840161487f565b80356001600160401b0381168114614892575f80fd5b5f602082840312156149bf575f80fd5b611b3f82614999565b5f80604083850312156149d9575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52602160045260245ffd5b60068110614a0c57614a0c6149e8565b9052565b5f60e082019050614a228284516149fc565b6020830151602083015260408301516001600160401b0380821660408501528060608601511660608501528060808601511660808501528060a08601511660a08501528060c08601511660c0850152505092915050565b803561ffff81168114614892575f80fd5b5f805f8060808587031215614a9d575f80fd5b84356001600160401b03811115614ab2575f80fd5b850160608188031215614ac3575f80fd5b9350614ad160208601614a79565b9250614adf60408601614999565b9396929550929360600135925050565b6001600160a01b03811681146107ee575f80fd5b5f80828403610140811215614b16575f80fd5b61012080821215614b25575f80fd5b8493508301359050614b3681614aef565b809150509250929050565b6020810161071e82846149fc565b5f5b83811015614b69578181015183820152602001614b51565b50505f910152565b602081525f8251806020840152614b8f816040850160208701614b4f565b601f01601f19169190910160400192915050565b5f60208284031215614bb3575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f82614be857634e487b7160e01b5f52601260045260245ffd5b500490565b6020810160048310614c0157614c016149e8565b91905290565b5f60208284031215614c17575f80fd5b8135611b3f81614aef565b5f808335601e19843603018112614c37575f80fd5b8301803591506001600160401b03821115614c50575f80fd5b6020019150600581901b36038213156133b2575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112614c8f575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715614ccf57614ccf614c99565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614cfd57614cfd614c99565b604052919050565b5f6001600160401b03821115614d1d57614d1d614c99565b50601f01601f191660200190565b5f60608236031215614d3b575f80fd5b614d43614cad565b823581526020614d54818501614999565b8183015260408401356001600160401b03811115614d70575f80fd5b840136601f820112614d80575f80fd5b8035614d93614d8e82614d05565b614cd5565b8181523684838501011115614da6575f80fd5b81848401858301375f9181019093015250604082015292915050565b5f8251614c8f818460208701614b4f565b8082018082111561071e5761071e614bba565b5f63ffffffff808316818103614dfe57614dfe614bba565b6001019392505050565b808202811582820484141761071e5761071e614bba565b600181811c90821680614e3357607f821691505b602082108103614e5157634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208083525f8454614e6981614e1f565b806020870152604060018084165f8114614e8a5760018114614ea657614ed3565b60ff19851660408a0152604084151560051b8a01019550614ed3565b895f5260205f205f5b85811015614eca5781548b8201860152908301908801614eaf565b8a016040019650505b509398975050505050505050565b6001600160401b038281168282160390808211156126b3576126b3614bba565b805161489281614872565b5f8060408385031215614f1d575f80fd5b82516001600160401b0380821115614f33575f80fd5b9084019060608287031215614f46575f80fd5b614f4e614cad565b82518152602080840151614f6181614aef565b82820152604084015183811115614f76575f80fd5b80850194505087601f850112614f8a575f80fd5b83519250614f9a614d8e84614d05565b8381528882858701011115614fad575f80fd5b614fbc84838301848801614b4f565b80604084015250819550614fd1818801614f01565b9450505050509250929050565b6001600160401b038181168382160190808211156126b3576126b3614bba565b8181038181111561071e5761071e614bba565b5f808335601e19843603018112615026575f80fd5b8301803591506001600160401b0382111561503f575f80fd5b6020019150368190038213156133b2575f80fd5b5f8651615064818460208b01614b4f565b820186815260c086901b6001600160c01b0319166020820152838560288301375f9301602801928352509095945050505050565b6001600160401b038181168382160280821691908281146150bb576150bb614bba565b505092915050565b601f82111561050357805f5260205f20601f840160051c810160208510156150e85750805b601f840160051c820191505b818110156115a1575f81556001016150f4565b81516001600160401b0381111561512057615120614c99565b6151348161512e8454614e1f565b846150c3565b602080601f831160018114615167575f84156151505750858301515b5f19600386901b1c1916600185901b178555610920565b5f85815260208120601f198616915b8281101561519557888601518255948401946001909101908401615176565b50858210156151b257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f602082840312156151d2575f80fd5b611b3f82614a79565b5f602082840312156151eb575f80fd5b813560ff81168114611b3f575f80fd5b5f6001600160401b03808316818103614dfe57614dfe614bba565b5f60208284031215615226575f80fd5b8151611b3f81614872565b61ffff60f01b8860f01b16815263ffffffff60e01b8760e01b1660028201528560068201528460268201525f6001600160401b0360c01b808660c01b166046840152845161528681604e860160208901614b4f565b60c09490941b1691909201604e81019190915260560197965050505050505056fe4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d056e5bdfcce15e53c3406ea67bfce37dcd26f5152d5492824e43fd5e3c8ac5ab004317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ERC20_STAKING_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_DELEGATION_FEE_BIPS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_STAKE_MULTIPLIER_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"POS_VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimDelegationFees\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeDelegatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndDelegation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structPoSValidatorManagerSettings\",\"components\":[{\"name\":\"baseSettings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"minimumDelegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"contractIERC20Mintable\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeDelegatorRegistration\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"delegationAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"remainingBalanceOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]},{\"name\":\"disableOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}]},{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendUpdateDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitUptimeProof\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"DelegationEnded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewards\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorAdded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"delegatorAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"delegatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRegistered\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"startTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRemovalInitialized\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UptimeUpdated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"AddressInsufficientBalance\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"DelegatorIneligibleForRewards\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidBLSPublicKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationFee\",\"inputs\":[{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationID\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumDelegatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[{\"name\":\"actual\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"expected\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMinStakeDuration\",\"inputs\":[{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidNonce\",\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidPChainOwnerThreshold\",\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addressesLength\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeAmount\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeMultiplier\",\"inputs\":[{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidTokenAddress\",\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MaxWeightExceeded\",\"inputs\":[{\"name\":\"newValidatorWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MinStakeDurationNotPassed\",\"inputs\":[{\"name\":\"endTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PChainOwnerAddressesNotSorted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SafeERC20FailedOperation\",\"inputs\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnauthorizedOwner\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"type\":\"error\",\"name\":\"ValidatorIneligibleForRewards\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ValidatorNotPoS\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + Bin: "0x608060405234801561000f575f80fd5b50604051615f02380380615f0283398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b615db58061014d5f395ff3fe608060405234801561000f575f80fd5b50600436106101f2575f3560e01c806376f7862111610114578063ba3a4b97116100a9578063d5f20ff611610079578063d5f20ff614610444578063df93d8de14610464578063e4a63c401461046e578063f09969ae14610482578063fd7ac5e714610495575f80fd5b8063ba3a4b9714610402578063bc5fbfec14610415578063bee0a03f14610429578063c974d1b61461043c575f80fd5b80639e1bc4ef116100e45780639e1bc4ef146103a2578063a3a65e48146103b5578063afb98096146103c8578063b771b3bc146103dc575f80fd5b806376f78621146103615780638280a25a1461037457806393e245981461037c57806398f3e2b41461038f575f80fd5b80633a1cfff61161018a57806360305d621161015a57806360305d6214610317578063620658561461033457806366435abf14610347578063732214f81461035a575f80fd5b80633a1cfff6146102bd578063467ef06f146102d05780634bee0040146102e35780635297fae614610304575f80fd5b806320d91b7a116101c557806320d91b7a1461025057806325e1c776146102635780632e2194d81461027657806335455ded146102a1575f80fd5b80630118acc4146101f65780630322ed981461020b578063151d30d11461021e5780631ec447241461023d575b5f80fd5b610209610204366004614fd3565b6104a8565b005b61020961021936600461500e565b6104dd565b610226600a81565b60405160ff90911681526020015b60405180910390f35b61020961024b366004614fd3565b6106eb565b61020961025e366004615025565b6106f6565b610209610271366004615073565b610be2565b61028961028436600461500e565b610c56565b6040516001600160401b039091168152602001610234565b6102aa61271081565b60405161ffff9091168152602001610234565b6102096102cb366004614fd3565b610c6c565b6102096102de366004615094565b610c77565b6102f66102f13660046150d4565b610d39565b604051908152602001610234565b610209610312366004615139565b610d6e565b61031f601481565b60405163ffffffff9091168152602001610234565b6102f6610342366004615161565b610fd9565b61028961035536600461500e565b610ff2565b6102f65f81565b61020961036f366004614fd3565b611006565b610226603081565b61020961038a36600461500e565b611031565b61020961039d366004615139565b6110fc565b6102f66103b036600461517a565b6112d4565b6102096103c3366004615094565b611300565b6102f65f80516020615d2983398151915281565b6103ea6005600160991b0181565b6040516001600160a01b039091168152602001610234565b61020961041036600461500e565b611489565b6102f65f80516020615d4983398151915281565b61020961043736600461500e565b611672565b610226601481565b61045761045236600461500e565b6117af565b604051610234919061520f565b6102896202a30081565b6102f65f80516020615d0983398151915281565b6102096104903660046152a3565b6118fe565b6102f66104a33660046152e1565b6119dd565b6104b3838383611a38565b6104d857604051631036cf9160e11b8152600481018490526024015b60405180910390fd5b505050565b5f8181525f80516020615d898339815191526020526040808220815160e0810190925280545f80516020615d4983398151915293929190829060ff16600581111561052a5761052a61519a565b600581111561053b5761053b61519a565b815260200160018201805461054f9061534c565b80601f016020809104026020016040519081016040528092919081815260200182805461057b9061534c565b80156105c65780601f1061059d576101008083540402835291602001916105c6565b820191905f5260205f20905b8154815290600101906020018083116105a957829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a090910152909150815160058111156106315761063161519a565b14610664575f8381526007830160205260409081902054905163170cc93360e21b81526104cf9160ff1690600401615384565b6005600160991b016001600160a01b031663ee5b48eb6106898584606001515f611cbd565b6040518263ffffffff1660e01b81526004016106a59190615392565b6020604051808303815f875af11580156106c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106e591906153a4565b50505050565b6106e5838383611a38565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f80516020615d498339815191529060ff161561074857604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801561078b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107af91906153a4565b8360200135146107d8576040516372b0a7e760e11b8152602084013560048201526024016104cf565b306107e960608501604086016153bb565b6001600160a01b03161461082c5761080760608401604085016153bb565b604051632f88120d60e21b81526001600160a01b0390911660048201526024016104cf565b5f61083a60608501856153d6565b905090505f805b828163ffffffff161015610b22575f61085d60608801886153d6565b8363ffffffff168181106108735761087361541b565b9050602002810190610885919061542f565b61088e90615553565b80516040519192505f9160088801916108a6916155cc565b908152602001604051809103902054146108d657805160405163a41f772f60e01b81526104cf9190600401615392565b5f6002885f01358460405160200161090592919091825260e01b6001600160e01b031916602082015260240190565b60408051601f198184030181529082905261091f916155cc565b602060405180830381855afa15801561093a573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061095d91906153a4565b90508086600801835f015160405161097591906155cc565b90815260408051602092819003830181209390935560e0830181526002835284518284015284810180516001600160401b03908116858401525f60608601819052915181166080860152421660a085015260c0840181905284815260078a01909252902081518154829060ff191660018360058111156109f7576109f761519a565b021790555060208201516001820190610a109082615621565b506040828101516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff191692841692909217909155830151610ab59116856156f0565b8251604051919550610ac6916155cc565b60408051918290038220908401516001600160401b031682529082907f9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf9060200160405180910390a3505080610b1b90615703565b9050610841565b50600483018190555f610b40610b3786611d0c565b60400151611e22565b90505f610b4c87611faf565b90505f600282604051610b5f91906155cc565b602060405180830381855afa158015610b7a573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610b9d91906153a4565b9050828114610bc957604051631872fc8d60e01b815260048101829052602481018490526044016104cf565b5050506009909201805460ff1916600117905550505050565b610beb82612189565b610c0b576040516330efa98b60e01b8152600481018390526024016104cf565b5f610c15836117af565b5190506002816005811115610c2c57610c2c61519a565b14610c4c578060405163170cc93360e21b81526004016104cf9190615384565b6106e583836121c4565b5f610c6664e8d4a5100083615725565b92915050565b6106e583838361243e565b610c7f612637565b5f80516020615d298339815191525f80610c988461266e565b91509150610ca582612189565b610cb157505050610d20565b5f82815260048085016020526040909120546001600160a01b03169082516005811115610ce057610ce061519a565b03610d05575f83815260078501602052604081208054919055610d0382826129ac565b505b610d1b81610d168460400151610fd9565b612a22565b505050505b610d3660015f80516020615d6983398151915255565b50565b5f610d42612637565b610d4e85858585612a58565b9050610d6660015f80516020615d6983398151915255565b949350505050565b5f8181525f80516020615ce98339815191526020526040808220815160e0810190925280545f80516020615d2983398151915293929190829060ff166003811115610dbb57610dbb61519a565b6003811115610dcc57610dcc61519a565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f610e42826117af565b9050600183516003811115610e5957610e5961519a565b14610e7a578251604051633b0d540d60e21b81526104cf9190600401615744565b600481516005811115610e8f57610e8f61519a565b03610ea557610e9d85612c31565b505050505050565b5f80610ebc610eb389611d0c565b60400151612e18565b5091509150818414610ee957846040015160405163089938b360e11b81526004016104cf91815260200190565b806001600160401b031683606001516001600160401b03161080610f225750806001600160401b03168560a001516001600160401b0316115b15610f4b57604051632e19bc2d60e11b81526001600160401b03821660048201526024016104cf565b5f878152600587016020908152604091829020805460ff1916600290811782550180546001600160401b034216600160401b81026fffffffffffffffff000000000000000019909216919091179091559151918252859189917f047059b465069b8b751836b41f9f1d83daff583d2238cc7fbb461437ec23a4f6910160405180910390a35050505050505050565b5f610c666001600160401b03831664e8d4a5100061575e565b5f610ffc826117af565b6080015192915050565b61101183838361243e565b6104d857604051635bff683f60e11b8152600481018490526024016104cf565b5f80516020615d298339815191525f611049836117af565b51905060048160058111156110605761106061519a565b14611080578060405163170cc93360e21b81526004016104cf9190615384565b5f8381526004830160205260409020546001600160a01b031633146110c657335b604051636e2ccd7560e11b81526001600160a01b0390911660048201526024016104cf565b5f838152600783016020908152604080832080549084905560048601909252909120546106e5906001600160a01b0316826129ac565b611104612637565b5f8181525f80516020615ce98339815191526020526040808220815160e0810190925280545f80516020615d2983398151915293929190829060ff1660038111156111515761115161519a565b60038111156111625761116261519a565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c09091015290506003815160038111156111db576111db61519a565b146111fc578051604051633b0d540d60e21b81526104cf9190600401615744565b600461120b82604001516117af565b51600581111561121d5761121d61519a565b146112af575f61122c85611d0c565b90505f8061123d8360400151612e18565b5091509150818460400151146112695760405163089938b360e11b8152600481018390526024016104cf565b806001600160401b03168460c001516001600160401b031611156112ab57604051632e19bc2d60e11b81526001600160401b03821660048201526024016104cf565b5050505b6112b883612c31565b50506112d060015f80516020615d6983398151915255565b5050565b5f6112dd612637565b6112e883338461306e565b9050610c6660015f80516020615d6983398151915255565b5f80516020615d498339815191525f8061132561131c85611d0c565b60400151613346565b915091508061134b57604051632d07135360e01b815281151560048201526024016104cf565b5f828152600684016020526040902080546113659061534c565b90505f036113895760405163089938b360e11b8152600481018390526024016104cf565b60015f83815260078501602052604090205460ff1660058111156113af576113af61519a565b146113e2575f8281526007840160205260409081902054905163170cc93360e21b81526104cf9160ff1690600401615384565b5f82815260068401602052604081206113fa91614f22565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f8181525f80516020615ce98339815191526020526040808220815160e0810190925280545f80516020615d2983398151915293929190829060ff1660038111156114d6576114d661519a565b60038111156114e7576114e761519a565b8152815461010090046001600160a01b0316602082015260018083015460408301526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c090910152909150815160038111156115605761156061519a565b14158015611581575060038151600381111561157e5761157e61519a565b14155b156115a2578051604051633b0d540d60e21b81526104cf9190600401615744565b5f6115b082604001516117af565b905080606001516001600160401b03165f036115e2576040516339b894f960e21b8152600481018590526024016104cf565b6005600160991b016001600160a01b031663ee5b48eb61160f846040015184606001518560800151611cbd565b6040518263ffffffff1660e01b815260040161162b9190615392565b6020604051808303815f875af1158015611647573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061166b91906153a4565b5050505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f80516020615d4983398151915291906116b99061534c565b90505f036116dd5760405163089938b360e11b8152600481018390526024016104cf565b60015f83815260078301602052604090205460ff1660058111156117035761170361519a565b14611736575f8281526007820160205260409081902054905163170cc93360e21b81526104cf9160ff1690600401615384565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb9161176f9190600401615775565b6020604051808303815f875af115801561178b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d891906153a4565b6117b7614f59565b5f8281525f80516020615d89833981519152602052604090819020815160e0810190925280545f80516020615d49833981519152929190829060ff1660058111156118045761180461519a565b60058111156118155761181561519a565b81526020016001820180546118299061534c565b80601f01602080910402602001604051908101604052809291908181526020018280546118559061534c565b80156118a05780601f10611877576101008083540402835291602001916118a0565b820191905f5260205f20905b81548152906001019060200180831161188357829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b9091048116608083015260039092015490911660a0909101529392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff1680611947575080546001600160401b03808416911610155b156119655760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b1781556119908484613502565b805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6040515f905f80516020615d49833981519152907fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb0890611a2090869086906157ff565b90815260200160405180910390205491505092915050565b5f8381525f80516020615ce98339815191526020526040808220815160e0810190925280545f80516020615d298339815191529284929091829060ff166003811115611a8657611a8661519a565b6003811115611a9757611a9761519a565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f611b0d826117af565b9050600283516003811115611b2457611b2461519a565b14611b45578251604051633b0d540d60e21b81526104cf9190600401615744565b60208301516001600160a01b03163314611b5f57336110a1565b600281516005811115611b7457611b7461519a565b03611c51578615611b8b57611b8982876121c4565b505b5f8881526005850160205260409020805460ff1916600317905560608301516080820151611bc4918491611bbf919061580e565b61351c565b505f898152600586016020526040812060020180546001600160401b03909316600160c01b026001600160c01b0390931692909217909155611c0584613673565b5f8a81526006870160205260408082208390555191925084918b917f366d336c0ab380dc799f095a6f82a26326585c52909cc698b09ba4540709ed5791a315159450611cb69350505050565b600481516005811115611c6657611c6661519a565b03611c9a57611c7483613673565b5f898152600686016020526040902055611c8d88612c31565b6001945050505050611cb6565b805160405163170cc93360e21b81526104cf9190600401615384565b9392505050565b604080515f6020820152600360e01b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015611d70573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611d979190810190615839565b9150915080611db957604051636b2f19e960e01b815260040160405180910390fd5b815115611ddf578151604051636ba589a560e01b815260048101919091526024016104cf565b60208201516001600160a01b031615611e1b576020820151604051624de75d60e31b81526001600160a01b0390911660048201526024016104cf565b5092915050565b5f8151602614611e5757815160405163cc92daa160e01b815263ffffffff9091166004820152602660248201526044016104cf565b5f805b6002811015611ea657611e6e81600161590b565b611e7990600861575e565b61ffff16848281518110611e8f57611e8f61541b565b016020015160f81c901b9190911790600101611e5a565b5061ffff811615611ed05760405163407b587360e01b815261ffff821660048201526024016104cf565b5f805b6004811015611f2b57611ee781600361590b565b611ef290600861575e565b63ffffffff1685611f048360026156f0565b81518110611f1457611f1461541b565b016020015160f81c901b9190911790600101611ed3565b5063ffffffff811615611f5157604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015611fa657611f6881601f61590b565b611f7390600861575e565b86611f7f8360066156f0565b81518110611f8f57611f8f61541b565b016020015160f81c901b9190911790600101611f54565b50949350505050565b60605f80833560208501356014611fcb878701604089016153bb565b611fd860608901896153d6565b60405160f09790971b6001600160f01b0319166020880152602287019590955250604285019290925260e090811b6001600160e01b0319908116606286015260609290921b6bffffffffffffffffffffffff191660668501529190911b16607a820152607e0160405160208183030381529060405290505f5b61205e60608501856153d6565b9050811015611e1b578161207560608601866153d6565b838181106120855761208561541b565b9050602002810190612097919061542f565b6120a1908061591e565b90506120b060608701876153d6565b848181106120c0576120c061541b565b90506020028101906120d2919061542f565b6120dc908061591e565b6120e960608901896153d6565b868181106120f9576120f961541b565b905060200281019061210b919061542f565b61211990602081019061591e565b61212660608b018b6153d6565b888181106121365761213661541b565b9050602002810190612148919061542f565b612159906060810190604001615161565b60405160200161216f9796959493929190615960565b60408051601f198184030181529190529150600101612051565b5f9081527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020546001600160a01b0316151590565b6040516306f8253560e41b815263ffffffff821660048201525f90819081906005600160991b0190636f825350906024015f60405180830381865afa15801561220f573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526122369190810190615839565b915091508061225857604051636b2f19e960e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa15801561229b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122bf91906153a4565b8251146122e5578151604051636ba589a560e01b815260048101919091526024016104cf565b60208201516001600160a01b031615612321576020820151604051624de75d60e31b81526001600160a01b0390911660048201526024016104cf565b5f80612330846040015161381f565b915091508187146123575760405163089938b360e11b8152600481018890526024016104cf565b5f8781527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020600101545f80516020615d29833981519152906001600160401b039081169083161115612414575f888152600482016020908152604091829020600101805467ffffffffffffffff19166001600160401b038616908117909155915191825289917fec44148e8ff271f2d0bacef1142154abacb0abb3a29eb3eb50e2ca97e86d0435910160405180910390a2612433565b5f8881526004820160205260409020600101546001600160401b031691505b509695505050505050565b5f5f80516020615d298339815191528161245786613a10565b905061246286612189565b61247157600192505050611cb6565b5f8681526004830160205260409020546001600160a01b0316331461249657336110a1565b5f86815260048301602052604090205460a08201516124c591600160b01b90046001600160401b0316906159c9565b6001600160401b03168160c001516001600160401b0316101561250c5760c081015160405163fb6ce63f60e01b81526001600160401b0390911660048201526024016104cf565b5f85156125245761251d87866121c4565b9050612542565b505f8681526004830160205260409020600101546001600160401b03165b600383015460408301515f916001600160a01b03169063778c06b59061256790610fd9565b60a086015160c087015160405160e085901b6001600160e01b031916815260048101939093526001600160401b0391821660248401819052604484015281166064830152851660848201525f60a4820181905260c482015260e401602060405180830381865afa1580156125dd573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061260191906153a4565b905080846007015f8a81526020019081526020015f205f82825461262591906156f0565b90915550501515979650505050505050565b5f80516020615d6983398151915280546001190161266857604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f612677614f59565b5f80516020615d498339815191525f8061269361131c87611d0c565b9150915080156126ba57604051632d07135360e01b815281151560048201526024016104cf565b5f828152600784016020526040808220815160e081019092528054829060ff1660058111156126eb576126eb61519a565b60058111156126fc576126fc61519a565b81526020016001820180546127109061534c565b80601f016020809104026020016040519081016040528092919081815260200182805461273c9061534c565b80156127875780601f1061275e57610100808354040283529160200191612787565b820191905f5260205f20905b81548152906001019060200180831161276a57829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a090910152909150815160058111156127f2576127f261519a565b1415801561281357506001815160058111156128105761281061519a565b14155b1561283457805160405163170cc93360e21b81526104cf9190600401615384565b6003815160058111156128495761284961519a565b03612857576004815261285c565b600581525b83600801816020015160405161287291906155cc565b90815260408051602092819003830190205f908190558581526007870190925290208151815483929190829060ff191660018360058111156128b6576128b661519a565b0217905550602082015160018201906128cf9082615621565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff191691909216179055805160058111156129755761297561519a565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b5f5f80516020615d0983398151915280546040516340c10f1960e01b81526001600160a01b038681166004830152602482018690529293509116906340c10f19906044015f604051808303815f87803b158015612a07575f80fd5b505af1158015612a19573d5f803e3d5ffd5b50505050505050565b5f80516020615d09833981519152546112d0906001600160a01b03168383613cf4565b60015f80516020615d6983398151915255565b7f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d02545f905f80516020615d2983398151915290600160401b900461ffff9081169086161080612aac575061271061ffff8616115b15612ad057604051635f12e6c360e11b815261ffff861660048201526024016104cf565b60028101546001600160401b039081169085161015612b0c576040516202a06d60e11b81526001600160401b03851660048201526024016104cf565b8054831080612b1e5750806001015483115b15612b3f5760405163222d164360e21b8152600481018490526024016104cf565b5f612b4984613d53565b90505f612b5582610c56565b90505f612b628983613d76565b90506040518060800160405280612b763390565b6001600160a01b03908116825261ffff808c166020808501919091526001600160401b03808d166040808701919091525f60609687018190528881526004909b018352998a902086518154938801519b8801518316600160b01b0267ffffffffffffffff60b01b199c909516600160a01b026001600160b01b03199094169516949094179190911798909816178155910151600190910180549190951667ffffffffffffffff19909116179093555090915050949350505050565b5f8181525f80516020615ce98339815191526020526040808220815160e0810190925280545f80516020615d2983398151915293929190829060ff166003811115612c7e57612c7e61519a565b6003811115612c8f57612c8f61519a565b8152815461010090046001600160a01b03166020808301919091526001808401546040808501919091526002948501546001600160401b038082166060870152600160401b820481166080870152600160801b8204811660a0870152600160c01b9091041660c090940193909352848301515f89815260058901845284812080546001600160a81b03191681559283018190559190940181905560068701909152908120805490829055929350909190808215612dbd575f84815260048701602052604090205461271090612d6f90600160a01b900461ffff168561575e565b612d799190615725565b915081866007015f8681526020019081526020015f205f828254612d9d91906156f0565b90915550612dad9050828461590b565b9050612dbd8560200151826129ac565b612dd28560200151610d168760600151610fd9565b6040805182815260208101849052859189917f8ececf510070c320d9a55323ffabe350e294ae505fc0c509dc5736da6f5cc993910160405180910390a350505050505050565b5f805f8351603614612e4f57835160405163cc92daa160e01b815263ffffffff9091166004820152603660248201526044016104cf565b5f805b6002811015612e9e57612e6681600161590b565b612e7190600861575e565b61ffff16868281518110612e8757612e8761541b565b016020015160f81c901b9190911790600101612e52565b5061ffff811615612ec85760405163407b587360e01b815261ffff821660048201526024016104cf565b5f805b6004811015612f2357612edf81600361590b565b612eea90600861575e565b63ffffffff1687612efc8360026156f0565b81518110612f0c57612f0c61541b565b016020015160f81c901b9190911790600101612ecb565b5063ffffffff8116600314612f4b57604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612fa057612f6281601f61590b565b612f6d90600861575e565b88612f798360066156f0565b81518110612f8957612f8961541b565b016020015160f81c901b9190911790600101612f4e565b505f805b6008811015612fff57612fb881600761590b565b612fc390600861575e565b6001600160401b031689612fd88360266156f0565b81518110612fe857612fe861541b565b016020015160f81c901b9190911790600101612fa4565b505f805b600881101561305e5761301781600761590b565b61302290600861575e565b6001600160401b03168a61303783602e6156f0565b815181106130475761304761541b565b016020015160f81c901b9190911790600101613003565b5091989097509095509350505050565b5f5f80516020615d298339815191528161308a61028485613d53565b90505f613096876117af565b90506130a187612189565b6130c1576040516330efa98b60e01b8152600481018890526024016104cf565b6002815160058111156130d6576130d661519a565b146130f757805160405163170cc93360e21b81526104cf9190600401615384565b5f82826080015161310891906159c9565b905083600201600a9054906101000a90046001600160401b0316826040015161313191906159e9565b6001600160401b0316816001600160401b0316111561316e57604051636d51fe0560e11b81526001600160401b03821660048201526024016104cf565b5f8061317a8a8461351c565b915091505f8a836040516020016131a892919091825260c01b6001600160c01b031916602082015260280190565b60408051601f19818403018152828252805160209091012060e08301909152915080600181526001600160a01b038c1660208083019190915260408083018f90526001600160401b03808b1660608501525f6080850181905290881660a085015260c090930183905284835260058b01909152902081518154829060ff1916600183600381111561323b5761323b61519a565b02179055506020828101518254610100600160a81b0319166101006001600160a01b039283160217835560408085015160018501556060808601516002909501805460808089015160a08a015160c0909a01516001600160401b03998a166001600160801b031990941693909317600160401b918a1691909102176001600160801b0316600160801b998916999099026001600160c01b031698909817600160c01b91881691909102179055815189861681528a861694810194909452938b1690830152918101859052908c16918d9184917fb0024b263bc3a0b728a6edea50a69efa841189f8d32ee8af9d1c2b1a1a223426910160405180910390a49a9950505050505050505050565b5f80825160271461337c57825160405163cc92daa160e01b815263ffffffff9091166004820152602760248201526044016104cf565b5f805b60028110156133cb5761339381600161590b565b61339e90600861575e565b61ffff168582815181106133b4576133b461541b565b016020015160f81c901b919091179060010161337f565b5061ffff8116156133f55760405163407b587360e01b815261ffff821660048201526024016104cf565b5f805b60048110156134505761340c81600361590b565b61341790600861575e565b63ffffffff16866134298360026156f0565b815181106134395761343961541b565b016020015160f81c901b91909117906001016133f8565b5063ffffffff811660021461347857604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156134cd5761348f81601f61590b565b61349a90600861575e565b876134a68360066156f0565b815181106134b6576134b661541b565b016020015160f81c901b919091179060010161347b565b505f866026815181106134e2576134e261541b565b016020015191976001600160f81b03199092161515965090945050505050565b61350a6142ee565b61351382614339565b6112d0816143a7565b5f8281525f80516020615d89833981519152602052604081206002015481905f80516020615d4983398151915290600160801b90046001600160401b0316613564858261440f565b5f61356e876145e9565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6135be8a858b611cbd565b6040518263ffffffff1660e01b81526004016135da9190615392565b6020604051808303815f875af11580156135f6573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061361a91906153a4565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b5f805f80516020615d2983398151915290505f61369384604001516117af565b90505f6003825160058111156136ab576136ab61519a565b14806136c957506004825160058111156136c7576136c761519a565b145b156136d9575060c0810151613716565b6002825160058111156136ee576136ee61519a565b036136fa575042613716565b815160405163170cc93360e21b81526104cf9190600401615384565b84608001516001600160401b0316816001600160401b03161161373d57505f949350505050565b600383015460608601516001600160a01b039091169063778c06b59061376290610fd9565b60a085015160808901516040808b01515f90815260048a810160205282822060010154925160e088901b6001600160e01b0319168152908101959095526001600160401b0393841660248601529183166044850152828716606485015291909116608483015260a4820181905260c482015260e401602060405180830381865afa1580156137f2573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061381691906153a4565b95945050505050565b5f808251602e1461385557825160405163cc92daa160e01b815263ffffffff9091166004820152602e60248201526044016104cf565b5f805b60028110156138a45761386c81600161590b565b61387790600861575e565b61ffff1685828151811061388d5761388d61541b565b016020015160f81c901b9190911790600101613858565b5061ffff8116156138ce5760405163407b587360e01b815261ffff821660048201526024016104cf565b5f805b6004811015613929576138e581600361590b565b6138f090600861575e565b63ffffffff16866139028360026156f0565b815181106139125761391261541b565b016020015160f81c901b91909117906001016138d1565b5063ffffffff81161561394f57604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156139a45761396681601f61590b565b61397190600861575e565b8761397d8360066156f0565b8151811061398d5761398d61541b565b016020015160f81c901b9190911790600101613952565b505f805b6008811015613a03576139bc81600761590b565b6139c790600861575e565b6001600160401b0316886139dc8360266156f0565b815181106139ec576139ec61541b565b016020015160f81c901b91909117906001016139a8565b5090969095509350505050565b613a18614f59565b5f8281525f80516020615d898339815191526020526040808220815160e0810190925280545f80516020615d4983398151915293929190829060ff166005811115613a6557613a6561519a565b6005811115613a7657613a7661519a565b8152602001600182018054613a8a9061534c565b80601f0160208091040260200160405190810160405280929190818152602001828054613ab69061534c565b8015613b015780601f10613ad857610100808354040283529160200191613b01565b820191905f5260205f20905b815481529060010190602001808311613ae457829003601f168201915b50505091835250506002828101546001600160401b038082166020850152600160401b820481166040850152600160801b820481166060850152600160c01b9091048116608084015260039093015490921660a09091015290915081516005811115613b6f57613b6f61519a565b14613ba2575f8481526007830160205260409081902054905163170cc93360e21b81526104cf9160ff1690600401615384565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff19166001836005811115613be657613be661519a565b021790555060208201516001820190613bff9082615621565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f613c9d858261351c565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b6040516001600160a01b038381166024830152604482018390526104d891859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061465e565b5f610c66825f80516020615d09833981519152546001600160a01b0316906146bf565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff16613dba57604051637fab81e560e01b815260040160405180910390fd5b5f80516020615d4983398151915242613dd96060860160408701615161565b6001600160401b0316111580613e135750613df76202a300426156f0565b613e076060860160408701615161565b6001600160401b031610155b15613e4d57613e286060850160408601615161565b604051635879da1360e11b81526001600160401b0390911660048201526024016104cf565b613e62613e5d6060860186615a14565b614818565b613e72613e5d6080860186615a14565b6030613e81602086018661591e565b905014613eb357613e95602085018561591e565b6040516326475b2f60e11b81526104cf925060040190815260200190565b613ebd848061591e565b90505f03613eea57613ecf848061591e565b604051633e08a12560e11b81526004016104cf929190615a28565b5f60088201613ef9868061591e565b604051613f079291906157ff565b90815260200160405180910390205414613f4057613f25848061591e565b60405163a41f772f60e01b81526004016104cf929190615a28565b613f4a835f61440f565b6040805160e08101909152815481525f9081906140569060208101613f6f898061591e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250602090810190613fb7908a018a61591e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060200161400060608a0160408b01615161565b6001600160401b0316815260200161401b60608a018a615a14565b61402490615a56565b815260200161403660808a018a615a14565b61403f90615a56565b8152602001876001600160401b0316815250614981565b5f828152600686016020526040902091935091506140748282615621565b508160088401614084888061591e565b6040516140929291906157ff565b9081526040519081900360200181209190915563ee5b48eb60e01b81525f906005600160991b019063ee5b48eb906140ce908590600401615392565b6020604051808303815f875af11580156140ea573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061410e91906153a4565b6040805160e08101909152909150806001815260200161412e898061591e565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509385525050506001600160401b0389166020808401829052604080850184905260608501929092526080840183905260a0909301829052868252600788019092522081518154829060ff191660018360058111156141bd576141bd61519a565b0217905550602082015160018201906141d69082615621565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff19169190921617905580614274888061591e565b6040516142829291906157ff565b6040518091039020847fb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430898b60400160208101906142c09190615161565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661433757604051631afcd79f60e31b815260040160405180910390fd5b565b6143416142ee565b61434a81614b6e565b614352614b87565b610d366060820135608083013561436f60c0850160a08601615161565b61437f60e0860160c08701615b1d565b614390610100870160e08801615b36565b6143a2610120880161010089016153bb565b614b97565b6143af6142ee565b5f80516020615d098339815191526001600160a01b0382166143ef57604051637330680360e01b81526001600160a01b03831660048201526024016104cf565b80546001600160a01b0319166001600160a01b0392909216919091179055565b5f80516020615d498339815191525f6001600160401b0380841690851611156144435761443c838561580e565b9050614450565b61444d848461580e565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b03166060820152429115806144b25750600184015481516144ae916001600160401b0316906156f0565b8210155b156144d8576001600160401b0383166060820152818152604081015160208201526144f7565b82816060018181516144ea91906159c9565b6001600160401b03169052505b60608101516145079060646159e9565b602082015160018601546001600160401b0392909216916145329190600160401b900460ff1661575e565b101561456257606081015160405163dfae880160e01b81526001600160401b0390911660048201526024016104cf565b856001600160401b03168160400181815161457d91906156f0565b9052506040810180516001600160401b038716919061459d90839061590b565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f8181525f80516020615d898339815191526020526040812060020180545f80516020615d49833981519152919060089061463390600160401b90046001600160401b0316615b56565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b5f6146726001600160a01b03841683614cc6565b905080515f141580156146965750808060200190518101906146949190615b71565b155b156104d857604051635274afe760e01b81526001600160a01b03841660048201526024016104cf565b6040516370a0823160e01b81523060048201525f9081906001600160a01b038516906370a0823190602401602060405180830381865afa158015614705573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061472991906153a4565b90506147406001600160a01b038516333086614cd3565b6040516370a0823160e01b81523060048201525f906001600160a01b038616906370a0823190602401602060405180830381865afa158015614784573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906147a891906153a4565b905081811161480e5760405162461bcd60e51b815260206004820152602c60248201527f5361666545524332305472616e7366657246726f6d3a2062616c616e6365206e60448201526b1bdd081a5b98dc99585cd95960a21b60648201526084016104cf565b613816828261590b565b6148256020820182615094565b63ffffffff16158015614845575061484060208201826153d6565b151590505b1561488c576148576020820182615094565b61486460208301836153d6565b60405163c08a0f1d60e01b815263ffffffff90931660048401526024830152506044016104cf565b61489960208201826153d6565b90506148a86020830183615094565b63ffffffff1611156148c1576148576020820182615094565b60015b6148d160208301836153d6565b90508110156112d0576148e760208301836153d6565b6148f260018461590b565b8181106149015761490161541b565b905060200201602081019061491691906153bb565b6001600160a01b031661492c60208401846153d6565b8381811061493c5761493c61541b565b905060200201602081019061495191906153bb565b6001600160a01b0316101561497957604051630dbc8d5f60e31b815260040160405180910390fd5b6001016148c4565b5f60608260400151516030146149aa5760405163180ffa0d60e01b815260040160405180910390fd5b82516020808501518051604080880151606089015160808a01518051908701515193515f986149eb988a986001989297929690959094909390929101615b8c565b60405160208183030381529060405290505f5b84608001516020015151811015614a5d57818560800151602001518281518110614a2a57614a2a61541b565b6020026020010151604051602001614a43929190615c46565b60408051601f1981840301815291905291506001016149fe565b5060a0840151805160209182015151604051614a7d938593929101615c7c565b60405160208183030381529060405290505f5b8460a001516020015151811015614aef57818560a00151602001518281518110614abc57614abc61541b565b6020026020010151604051602001614ad5929190615c46565b60408051601f198184030181529190529150600101614a90565b5060c0840151604051614b06918391602001615cb7565b6040516020818303038152906040529050600281604051614b2791906155cc565b602060405180830381855afa158015614b42573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190614b6591906153a4565b94909350915050565b614b766142ee565b614b7e614d0c565b610d3681614d14565b614b8f6142ee565b614337614dfc565b614b9f6142ee565b5f80516020615d2983398151915261ffff84161580614bc3575061271061ffff8516115b15614be757604051635f12e6c360e11b815261ffff851660048201526024016104cf565b85871115614c0b5760405163222d164360e21b8152600481018890526024016104cf565b60ff83161580614c1e5750600a60ff8416115b15614c415760405163170db35960e31b815260ff841660048201526024016104cf565b95865560018601949094556002850180546001600160401b039490941669ffffffffffffffffffff1990941693909317600160401b61ffff93909316929092029190911767ffffffffffffffff60501b191660ff91909116600160501b02179055600390910180546001600160a01b0319166001600160a01b03909216919091179055565b6060611cb683835f614e04565b6040516001600160a01b0384811660248301528381166044830152606482018390526106e59186918216906323b872dd90608401613d21565b6143376142ee565b614d1c6142ee565b80355f80516020615d498339815191529081556014614d416060840160408501615b36565b60ff161180614d605750614d5b6060830160408401615b36565b60ff16155b15614d9457614d756060830160408401615b36565b604051634a59bbff60e11b815260ff90911660048201526024016104cf565b614da46060830160408401615b36565b60018201805460ff92909216600160401b0260ff60401b19909216919091179055614dd56040830160208401615161565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b612a456142ee565b606081471015614e295760405163cd78605960e01b81523060048201526024016104cf565b5f80856001600160a01b03168486604051614e4491906155cc565b5f6040518083038185875af1925050503d805f8114614e7e576040519150601f19603f3d011682016040523d82523d5f602084013e614e83565b606091505b5091509150614e93868383614e9d565b9695505050505050565b606082614eb257614ead82614ef9565b611cb6565b8151158015614ec957506001600160a01b0384163b155b15614ef257604051639996b31560e01b81526001600160a01b03851660048201526024016104cf565b5080611cb6565b805115614f095780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b508054614f2e9061534c565b5f825580601f10614f3d575050565b601f0160209004905f5260205f2090810190610d369190614f96565b6040805160e08101909152805f81526060602082018190525f604083018190529082018190526080820181905260a0820181905260c09091015290565b5b80821115614faa575f8155600101614f97565b5090565b8015158114610d36575f80fd5b803563ffffffff81168114614fce575f80fd5b919050565b5f805f60608486031215614fe5575f80fd5b833592506020840135614ff781614fae565b915061500560408501614fbb565b90509250925092565b5f6020828403121561501e575f80fd5b5035919050565b5f8060408385031215615036575f80fd5b82356001600160401b0381111561504b575f80fd5b83016080818603121561505c575f80fd5b915061506a60208401614fbb565b90509250929050565b5f8060408385031215615084575f80fd5b8235915061506a60208401614fbb565b5f602082840312156150a4575f80fd5b611cb682614fbb565b803561ffff81168114614fce575f80fd5b80356001600160401b0381168114614fce575f80fd5b5f805f80608085870312156150e7575f80fd5b84356001600160401b038111156150fc575f80fd5b850160a0818803121561510d575f80fd5b935061511b602086016150ad565b9250615129604086016150be565b9396929550929360600135925050565b5f806040838503121561514a575f80fd5b61515383614fbb565b946020939093013593505050565b5f60208284031215615171575f80fd5b611cb6826150be565b5f806040838503121561518b575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52602160045260245ffd5b600681106151be576151be61519a565b9052565b5f5b838110156151dc5781810151838201526020016151c4565b50505f910152565b5f81518084526151fb8160208601602086016151c2565b601f01601f19169290920160200192915050565b602081526152216020820183516151ae565b5f602083015160e0604084015261523c6101008401826151e4565b905060408401516001600160401b0380821660608601528060608701511660808601528060808701511660a08601528060a08701511660c08601528060c08701511660e086015250508091505092915050565b6001600160a01b0381168114610d36575f80fd5b5f808284036101408112156152b6575f80fd5b610120808212156152c5575f80fd5b84935083013590506152d68161528f565b809150509250929050565b5f80602083850312156152f2575f80fd5b82356001600160401b0380821115615308575f80fd5b818501915085601f83011261531b575f80fd5b813581811115615329575f80fd5b86602082850101111561533a575f80fd5b60209290920196919550909350505050565b600181811c9082168061536057607f821691505b60208210810361537e57634e487b7160e01b5f52602260045260245ffd5b50919050565b60208101610c6682846151ae565b602081525f611cb660208301846151e4565b5f602082840312156153b4575f80fd5b5051919050565b5f602082840312156153cb575f80fd5b8135611cb68161528f565b5f808335601e198436030181126153eb575f80fd5b8301803591506001600160401b03821115615404575f80fd5b6020019150600581901b360382131561366c575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112615443575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156154835761548361544d565b60405290565b604080519081016001600160401b03811182821017156154835761548361544d565b604051601f8201601f191681016001600160401b03811182821017156154d3576154d361544d565b604052919050565b5f6001600160401b038211156154f3576154f361544d565b50601f01601f191660200190565b5f82601f830112615510575f80fd5b813561552361551e826154db565b6154ab565b818152846020838601011115615537575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60608236031215615563575f80fd5b61556b615461565b82356001600160401b0380821115615581575f80fd5b61558d36838701615501565b835260208501359150808211156155a2575f80fd5b506155af36828601615501565b6020830152506155c1604084016150be565b604082015292915050565b5f82516154438184602087016151c2565b601f8211156104d857805f5260205f20601f840160051c810160208510156156025750805b601f840160051c820191505b8181101561166b575f815560010161560e565b81516001600160401b0381111561563a5761563a61544d565b61564e81615648845461534c565b846155dd565b602080601f831160018114615681575f841561566a5750858301515b5f19600386901b1c1916600185901b178555610e9d565b5f85815260208120601f198616915b828110156156af57888601518255948401946001909101908401615690565b50858210156156cc57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610c6657610c666156dc565b5f63ffffffff80831681810361571b5761571b6156dc565b6001019392505050565b5f8261573f57634e487b7160e01b5f52601260045260245ffd5b500490565b60208101600483106157585761575861519a565b91905290565b8082028115828204841417610c6657610c666156dc565b5f60208083525f84546157878161534c565b806020870152604060018084165f81146157a857600181146157c4576157f1565b60ff19851660408a0152604084151560051b8a010195506157f1565b895f5260205f205f5b858110156157e85781548b82018601529083019088016157cd565b8a016040019650505b509398975050505050505050565b818382375f9101908152919050565b6001600160401b03828116828216039080821115611e1b57611e1b6156dc565b8051614fce81614fae565b5f806040838503121561584a575f80fd5b82516001600160401b0380821115615860575f80fd5b9084019060608287031215615873575f80fd5b61587b615461565b8251815260208084015161588e8161528f565b828201526040840151838111156158a3575f80fd5b80850194505087601f8501126158b7575f80fd5b835192506158c761551e846154db565b83815288828587010111156158da575f80fd5b6158e9848383018488016151c2565b806040840152508195506158fe81880161582e565b9450505050509250929050565b81810381811115610c6657610c666156dc565b5f808335601e19843603018112615933575f80fd5b8301803591506001600160401b0382111561594c575f80fd5b60200191503681900382131561366c575f80fd5b5f8851615971818460208d016151c2565b60e089901b6001600160e01b031916908301908152868860048301378681019050600481015f8152858782375060c09390931b6001600160c01b0319166004939094019283019390935250600c019695505050505050565b6001600160401b03818116838216019080821115611e1b57611e1b6156dc565b6001600160401b03818116838216028082169190828114615a0c57615a0c6156dc565b505092915050565b5f8235603e19833603018112615443575f80fd5b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b5f60408236031215615a66575f80fd5b615a6e615489565b615a7783614fbb565b81526020808401356001600160401b0380821115615a93575f80fd5b9085019036601f830112615aa5575f80fd5b813581811115615ab757615ab761544d565b8060051b9150615ac88483016154ab565b8181529183018401918481019036841115615ae1575f80fd5b938501935b83851015615b0b5784359250615afb8361528f565b8282529385019390850190615ae6565b94860194909452509295945050505050565b5f60208284031215615b2d575f80fd5b611cb6826150ad565b5f60208284031215615b46575f80fd5b813560ff81168114611cb6575f80fd5b5f6001600160401b0380831681810361571b5761571b6156dc565b5f60208284031215615b81575f80fd5b8151611cb681614fae565b61ffff60f01b8a60f01b1681525f63ffffffff60e01b808b60e01b166002840152896006840152808960e01b166026840152508651615bd281602a850160208b016151c2565b865190830190615be981602a840160208b016151c2565b60c087901b6001600160c01b031916602a9290910191820152615c1b603282018660e01b6001600160e01b0319169052565b615c34603682018560e01b6001600160e01b0319169052565b603a019b9a5050505050505050505050565b5f8351615c578184602088016151c2565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b5f8451615c8d8184602089016151c2565b6001600160e01b031960e095861b8116919093019081529290931b16600482015260080192915050565b5f8351615cc88184602088016151c2565b60c09390931b6001600160c01b031916919092019081526008019291505056fe4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d056e5bdfcce15e53c3406ea67bfce37dcd26f5152d5492824e43fd5e3c8ac5ab004317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", } // ERC20TokenStakingManagerABI is the input ABI used to generate the binding from. @@ -596,7 +604,7 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) WARPMESS // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) GetValidator(opts *bind.CallOpts, validationID [32]byte) (Validator, error) { var out []interface{} err := _ERC20TokenStakingManager.contract.Call(opts, &out, "getValidator", validationID) @@ -613,14 +621,14 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) GetValidator(op // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) GetValidator(validationID [32]byte) (Validator, error) { return _ERC20TokenStakingManager.Contract.GetValidator(&_ERC20TokenStakingManager.CallOpts, validationID) } // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) GetValidator(validationID [32]byte) (Validator, error) { return _ERC20TokenStakingManager.Contract.GetValidator(&_ERC20TokenStakingManager.CallOpts, validationID) } @@ -656,10 +664,10 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) GetWeigh return _ERC20TokenStakingManager.Contract.GetWeight(&_ERC20TokenStakingManager.CallOpts, validationID) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID []byte) ([32]byte, error) { var out []interface{} err := _ERC20TokenStakingManager.contract.Call(opts, &out, "registeredValidators", nodeID) @@ -673,17 +681,17 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCaller) RegisteredValid } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _ERC20TokenStakingManager.Contract.RegisteredValidators(&_ERC20TokenStakingManager.CallOpts, nodeID) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerCallerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _ERC20TokenStakingManager.Contract.RegisteredValidators(&_ERC20TokenStakingManager.CallOpts, nodeID) } @@ -980,44 +988,44 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) Init return _ERC20TokenStakingManager.Contract.InitializeEndValidation(&_ERC20TokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xeb0acb89. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x4bee0040. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64, stakeAmount *big.Int) (*types.Transaction, error) { return _ERC20TokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", registrationInput, delegationFeeBips, minStakeDuration, stakeAmount) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xeb0acb89. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x4bee0040. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64, stakeAmount *big.Int) (*types.Transaction, error) { return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, registrationInput, delegationFeeBips, minStakeDuration, stakeAmount) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xeb0acb89. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x4bee0040. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration, uint256 stakeAmount) returns(bytes32 validationID) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64, stakeAmount *big.Int) (*types.Transaction, error) { return _ERC20TokenStakingManager.Contract.InitializeValidatorRegistration(&_ERC20TokenStakingManager.TransactOpts, registrationInput, delegationFeeBips, minStakeDuration, stakeAmount) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactor) InitializeValidatorSet(opts *bind.TransactOpts, subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _ERC20TokenStakingManager.contract.Transact(opts, "initializeValidatorSet", subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_ERC20TokenStakingManager *ERC20TokenStakingManagerSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _ERC20TokenStakingManager.Contract.InitializeValidatorSet(&_ERC20TokenStakingManager.TransactOpts, subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_ERC20TokenStakingManager *ERC20TokenStakingManagerTransactorSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _ERC20TokenStakingManager.Contract.InitializeValidatorSet(&_ERC20TokenStakingManager.TransactOpts, subnetConversionData, messageIndex) } @@ -1804,15 +1812,15 @@ func (it *ERC20TokenStakingManagerInitialValidatorCreatedIterator) Close() error // ERC20TokenStakingManagerInitialValidatorCreated represents a InitialValidatorCreated event raised by the ERC20TokenStakingManager contract. type ERC20TokenStakingManagerInitialValidatorCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash Weight *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte) (*ERC20TokenStakingManagerInitialValidatorCreatedIterator, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte) (*ERC20TokenStakingManagerInitialValidatorCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1830,10 +1838,10 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterInitial return &ERC20TokenStakingManagerInitialValidatorCreatedIterator{contract: _ERC20TokenStakingManager.contract, event: "InitialValidatorCreated", logs: logs, sub: sub}, nil } -// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][32]byte) (event.Subscription, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1876,9 +1884,9 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchInitialV }), nil } -// ParseInitialValidatorCreated is a log parse operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// ParseInitialValidatorCreated is a log parse operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseInitialValidatorCreated(log types.Log) (*ERC20TokenStakingManagerInitialValidatorCreated, error) { event := new(ERC20TokenStakingManagerInitialValidatorCreated) if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "InitialValidatorCreated", log); err != nil { @@ -2237,17 +2245,17 @@ func (it *ERC20TokenStakingManagerValidationPeriodCreatedIterator) Close() error // ERC20TokenStakingManagerValidationPeriodCreated represents a ValidationPeriodCreated event raised by the ERC20TokenStakingManager contract. type ERC20TokenStakingManagerValidationPeriodCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash RegisterValidationMessageID [32]byte Weight *big.Int RegistrationExpiry uint64 Raw types.Log // Blockchain specific contextual infos } -// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (*ERC20TokenStakingManagerValidationPeriodCreatedIterator, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (*ERC20TokenStakingManagerValidationPeriodCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -2269,10 +2277,10 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) FilterValidat return &ERC20TokenStakingManagerValidationPeriodCreatedIterator{contract: _ERC20TokenStakingManager.contract, event: "ValidationPeriodCreated", logs: logs, sub: sub}, nil } -// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *ERC20TokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -2319,9 +2327,9 @@ func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) WatchValidati }), nil } -// ParseValidationPeriodCreated is a log parse operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// ParseValidationPeriodCreated is a log parse operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) func (_ERC20TokenStakingManager *ERC20TokenStakingManagerFilterer) ParseValidationPeriodCreated(log types.Log) (*ERC20TokenStakingManagerValidationPeriodCreated, error) { event := new(ERC20TokenStakingManagerValidationPeriodCreated) if err := _ERC20TokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", log); err != nil { diff --git a/abi-bindings/go/validator-manager/NativeTokenStakingManager/NativeTokenStakingManager.go b/abi-bindings/go/validator-manager/NativeTokenStakingManager/NativeTokenStakingManager.go index fb6167c3d..7abdb2216 100644 --- a/abi-bindings/go/validator-manager/NativeTokenStakingManager/NativeTokenStakingManager.go +++ b/abi-bindings/go/validator-manager/NativeTokenStakingManager/NativeTokenStakingManager.go @@ -31,9 +31,15 @@ var ( // InitialValidator is an auto generated low-level Go binding around an user-defined struct. type InitialValidator struct { - NodeID [32]byte - Weight uint64 + NodeID []byte BlsPublicKey []byte + Weight uint64 +} + +// PChainOwner is an auto generated low-level Go binding around an user-defined struct. +type PChainOwner struct { + Threshold uint32 + Addresses []common.Address } // PoSValidatorManagerSettings is an auto generated low-level Go binding around an user-defined struct. @@ -49,7 +55,7 @@ type PoSValidatorManagerSettings struct { // SubnetConversionData is an auto generated low-level Go binding around an user-defined struct. type SubnetConversionData struct { - ConvertSubnetTxID [32]byte + SubnetID [32]byte ValidatorManagerBlockchainID [32]byte ValidatorManagerAddress common.Address InitialValidators []InitialValidator @@ -58,7 +64,7 @@ type SubnetConversionData struct { // Validator is an auto generated low-level Go binding around an user-defined struct. type Validator struct { Status uint8 - NodeID [32]byte + NodeID []byte StartingWeight uint64 MessageNonce uint64 Weight uint64 @@ -75,15 +81,17 @@ type ValidatorManagerSettings struct { // ValidatorRegistrationInput is an auto generated low-level Go binding around an user-defined struct. type ValidatorRegistrationInput struct { - NodeID [32]byte - RegistrationExpiry uint64 - BlsPublicKey []byte + NodeID []byte + BlsPublicKey []byte + RegistrationExpiry uint64 + RemainingBalanceOwner PChainOwner + DisableOwner PChainOwner } // NativeTokenStakingManagerMetaData contains all meta data concerning the NativeTokenStakingManager contract. var NativeTokenStakingManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_DELEGATION_FEE_BIPS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_STAKE_MULTIPLIER_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"NATIVE_MINTER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINativeMinter\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"POS_VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimDelegationFees\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeDelegatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndDelegation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structPoSValidatorManagerSettings\",\"components\":[{\"name\":\"baseSettings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"minimumDelegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeDelegatorRegistration\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"convertSubnetTxID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendUpdateDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitUptimeProof\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"DelegationEnded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewards\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorAdded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"delegatorAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"delegatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRegistered\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"startTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRemovalInitialized\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UptimeUpdated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressInsufficientBalance\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"DelegatorIneligibleForRewards\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDelegationFee\",\"inputs\":[{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationID\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumDelegatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMinStakeDuration\",\"inputs\":[{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidNonce\",\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeAmount\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeMultiplier\",\"inputs\":[{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MaxWeightExceeded\",\"inputs\":[{\"name\":\"newValidatorWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MinStakeDurationNotPassed\",\"inputs\":[{\"name\":\"endTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedOwner\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"type\":\"error\",\"name\":\"ValidatorIneligibleForRewards\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ValidatorNotPoS\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b506040516151cc3803806151cc83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b61507f8061014d5f395ff3fe6080604052600436106101e6575f3560e01c806366435abf11610108578063b771b3bc1161009d578063c599e24f1161006d578063c599e24f14610582578063c974d1b614610595578063d5f20ff6146105a9578063df93d8de146105d5578063e7d14c1c146105eb575f80fd5b8063b771b3bc1461050a578063ba3a4b9714610524578063bc5fbfec14610543578063bee0a03f14610563575f80fd5b806393e24598116100d857806393e245981461048d57806398f3e2b4146104ac578063a3a65e48146104cb578063afb98096146104ea575f80fd5b806366435abf14610428578063732214f81461044757806376f786211461045a5780638280a25a14610479575f80fd5b806335455ded1161017e5780635297fae61161014e5780635297fae6146103a257806360305d62146103c157806361e2f490146103ea5780636206585614610409575f80fd5b806335455ded1461031b5780633a1cfff61461034357806340034a9314610362578063467ef06f14610383575f80fd5b806320e55565116101b957806320e555651461027457806325e1c776146102935780632e2194d8146102b2578063329c3e12146102e9575f80fd5b80630118acc4146101ea5780630322ed981461020b578063151d30d11461022a5780631ec4472414610255575b5f80fd5b3480156101f5575f80fd5b5061020961020436600461463b565b610635565b005b348015610216575f80fd5b50610209610225366004614676565b61066a565b348015610235575f80fd5b5061023e600a81565b60405160ff90911681526020015b60405180910390f35b348015610260575f80fd5b5061020961026f36600461463b565b6107f1565b34801561027f575f80fd5b5061020961028e36600461468d565b6107fc565b34801561029e575f80fd5b506102096102ad3660046146a4565b6108d9565b3480156102bd575f80fd5b506102d16102cc366004614676565b61094d565b6040516001600160401b03909116815260200161024c565b3480156102f4575f80fd5b506103036001600160991b0181565b6040516001600160a01b03909116815260200161024c565b348015610326575f80fd5b5061033061271081565b60405161ffff909116815260200161024c565b34801561034e575f80fd5b5061020961035d36600461463b565b610963565b6103756103703660046146f5565b61096e565b60405190815260200161024c565b34801561038e575f80fd5b5061020961039d366004614749565b6109a2565b3480156103ad575f80fd5b506102096103bc366004614762565b610a64565b3480156103cc575f80fd5b506103d5601481565b60405163ffffffff909116815260200161024c565b3480156103f5575f80fd5b5061020961040436600461478a565b610ccf565b348015610414575f80fd5b506103756104233660046147cf565b611182565b348015610433575f80fd5b506102d1610442366004614676565b61119b565b348015610452575f80fd5b506103755f81565b348015610465575f80fd5b5061020961047436600461463b565b6111af565b348015610484575f80fd5b5061023e603081565b348015610498575f80fd5b506102096104a7366004614676565b6111da565b3480156104b7575f80fd5b506102096104c6366004614762565b6112a5565b3480156104d6575f80fd5b506102096104e5366004614749565b61147d565b3480156104f5575f80fd5b506103755f80516020614ff383398151915281565b348015610515575f80fd5b506103036005600160991b0181565b34801561052f575f80fd5b5061020961053e366004614676565b611606565b34801561054e575f80fd5b506103755f8051602061501383398151915281565b34801561056e575f80fd5b5061020961057d366004614676565b6117ef565b610375610590366004614676565b61192c565b3480156105a0575f80fd5b5061023e601481565b3480156105b4575f80fd5b506105c86105c3366004614676565b61195d565b60405161024c9190614810565b3480156105e0575f80fd5b506102d16202a30081565b3480156105f6575f80fd5b50610375610605366004614676565b5f9081527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb08602052604090205490565b610640838383611a25565b61066557604051631036cf9160e11b8152600481018490526024015b60405180910390fd5b505050565b5f8181525f805160206150538339815191526020526040808220815160e0810190925280545f8051602061501383398151915293929190829060ff1660058111156106b7576106b76147e8565b60058111156106c8576106c86147e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c09091015290915081516005811115610737576107376147e8565b1461076a575f8381526007830160205260409081902054905163170cc93360e21b815261065c9160ff1690600401614879565b6005600160991b016001600160a01b031663ee5b48eb61078f8584606001515f611ca3565b6040518263ffffffff1660e01b81526004016107ab91906148a9565b6020604051808303815f875af11580156107c7573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107eb91906148db565b50505050565b6107eb838383611a25565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff1680610845575080546001600160401b03808416911610155b156108635760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b17815561088d83611cf2565b805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b6108e282611d03565b610902576040516330efa98b60e01b81526004810183905260240161065c565b5f61090c8361195d565b5190506002816005811115610923576109236147e8565b14610943578060405163170cc93360e21b815260040161065c9190614879565b6107eb8383611d3e565b5f61095d64e8d4a5100083614906565b92915050565b6107eb838383611fb8565b5f6109776121b1565b610983848484346121e8565b905061099b60015f8051602061503383398151915255565b9392505050565b6109aa6121b1565b5f80516020614ff38339815191525f806109c3846123c9565b915091506109d082611d03565b6109dc57505050610a4b565b5f82815260048085016020526040909120546001600160a01b03169082516005811115610a0b57610a0b6147e8565b03610a30575f83815260078501602052604081208054919055610a2e8282612660565b505b610a4681610a418460400151611182565b6126be565b505050505b610a6160015f8051602061503383398151915255565b50565b5f8181525f80516020614fd38339815191526020526040808220815160e0810190925280545f80516020614ff383398151915293929190829060ff166003811115610ab157610ab16147e8565b6003811115610ac257610ac26147e8565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f610b388261195d565b9050600183516003811115610b4f57610b4f6147e8565b14610b70578251604051633b0d540d60e21b815261065c9190600401614925565b600481516005811115610b8557610b856147e8565b03610b9b57610b93856126d1565b505050505050565b5f80610bb2610ba9896128b8565b604001516129ce565b5091509150818414610bdf57846040015160405163089938b360e11b815260040161065c91815260200190565b806001600160401b031683606001516001600160401b03161080610c185750806001600160401b03168560a001516001600160401b0316115b15610c4157604051632e19bc2d60e11b81526001600160401b038216600482015260240161065c565b5f878152600587016020908152604091829020805460ff1916600290811782550180546001600160401b034216600160401b81026fffffffffffffffff000000000000000019909216919091179091559151918252859189917f047059b465069b8b751836b41f9f1d83daff583d2238cc7fbb461437ec23a4f6910160405180910390a35050505050505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f805160206150138339815191529060ff1615610d2157604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d64573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8891906148db565b836020013514610db1576040516372b0a7e760e11b81526020840135600482015260240161065c565b30610dc26060850160408601614953565b6001600160a01b031614610e0557610de06060840160408501614953565b604051632f88120d60e21b81526001600160a01b03909116600482015260240161065c565b5f610e13606085018561496e565b905090505f805b828163ffffffff1610156110c2575f610e36606088018861496e565b8363ffffffff16818110610e4c57610e4c6149b3565b9050602002810190610e5e91906149c7565b610e6790614a77565b80515f8181526008880160205260409020549192509015610e9e57604051631ec583cb60e11b81526004810182905260240161065c565b5f6002895f013585604051602001610ecd92919091825260e01b6001600160e01b031916602082015260240190565b60408051601f1981840301815290829052610ee791614b0e565b602060405180830381855afa158015610f02573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610f2591906148db565b5f8381526008890160209081526040808320849055805160e0810182526002815287518184015287830180516001600160401b039081168385015260608301869052905181166080830152421660a082015260c0810184905284845260078c01909252909120815181549394509192909190829060ff19166001836005811115610fb157610fb16147e8565b0217905550602082810151600183015560408301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff191692841692909217909155840151611064911686614b1f565b83516020808601516040516001600160401b039091168152929750909183917fb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014910160405180910390a3505050806110bb90614b32565b9050610e1a565b50600483018190555f6110e06110d7866128b8565b60400151612c0c565b90505f6110ec87612d81565b90505f6002826040516110ff9190614b0e565b602060405180830381855afa15801561111a573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061113d91906148db565b905082811461116957604051631872fc8d60e01b8152600481018290526024810184905260440161065c565b5050506009909201805460ff1916600117905550505050565b5f61095d6001600160401b03831664e8d4a51000614b54565b5f6111a58261195d565b6080015192915050565b6111ba838383611fb8565b61066557604051635bff683f60e11b81526004810184905260240161065c565b5f80516020614ff38339815191525f6111f28361195d565b5190506004816005811115611209576112096147e8565b14611229578060405163170cc93360e21b815260040161065c9190614879565b5f8381526004830160205260409020546001600160a01b0316331461126f57335b604051636e2ccd7560e11b81526001600160a01b03909116600482015260240161065c565b5f838152600783016020908152604080832080549084905560048601909252909120546107eb906001600160a01b031682612660565b6112ad6121b1565b5f8181525f80516020614fd38339815191526020526040808220815160e0810190925280545f80516020614ff383398151915293929190829060ff1660038111156112fa576112fa6147e8565b600381111561130b5761130b6147e8565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101529050600381516003811115611384576113846147e8565b146113a5578051604051633b0d540d60e21b815261065c9190600401614925565b60046113b4826040015161195d565b5160058111156113c6576113c66147e8565b14611458575f6113d5856128b8565b90505f806113e683604001516129ce565b5091509150818460400151146114125760405163089938b360e11b81526004810183905260240161065c565b806001600160401b03168460c001516001600160401b0316111561145457604051632e19bc2d60e11b81526001600160401b038216600482015260240161065c565b5050505b611461836126d1565b505061147960015f8051602061503383398151915255565b5050565b5f805160206150138339815191525f806114a2611499856128b8565b60400151612f07565b91509150806114c857604051632d07135360e01b8152811515600482015260240161065c565b5f828152600684016020526040902080546114e290614b6b565b90505f036115065760405163089938b360e11b81526004810183905260240161065c565b60015f83815260078501602052604090205460ff16600581111561152c5761152c6147e8565b1461155f575f8281526007840160205260409081902054905163170cc93360e21b815261065c9160ff1690600401614879565b5f828152600684016020526040812061157791614590565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f8181525f80516020614fd38339815191526020526040808220815160e0810190925280545f80516020614ff383398151915293929190829060ff166003811115611653576116536147e8565b6003811115611664576116646147e8565b8152815461010090046001600160a01b0316602082015260018083015460408301526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c090910152909150815160038111156116dd576116dd6147e8565b141580156116fe57506003815160038111156116fb576116fb6147e8565b14155b1561171f578051604051633b0d540d60e21b815261065c9190600401614925565b5f61172d826040015161195d565b905080606001516001600160401b03165f0361175f576040516339b894f960e21b81526004810185905260240161065c565b6005600160991b016001600160a01b031663ee5b48eb61178c846040015184606001518560800151611ca3565b6040518263ffffffff1660e01b81526004016117a891906148a9565b6020604051808303815f875af11580156117c4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117e891906148db565b5050505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f80516020615013833981519152919061183690614b6b565b90505f0361185a5760405163089938b360e11b81526004810183905260240161065c565b60015f83815260078301602052604090205460ff166005811115611880576118806147e8565b146118b3575f8281526007820160205260409081902054905163170cc93360e21b815261065c9160ff1690600401614879565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb916118ec9190600401614b9d565b6020604051808303815f875af1158015611908573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061066591906148db565b5f6119356121b1565b6119408233346130ab565b905061195860015f8051602061503383398151915255565b919050565b6119656145c7565b5f8281525f80516020615053833981519152602052604090819020815160e0810190925280545f80516020615013833981519152929190829060ff1660058111156119b2576119b26147e8565b60058111156119c3576119c36147e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a083015260039092015490911660c0909101529392505050565b5f8381525f80516020614fd38339815191526020526040808220815160e0810190925280545f80516020614ff38339815191529284929091829060ff166003811115611a7357611a736147e8565b6003811115611a8457611a846147e8565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f611afa8261195d565b9050600283516003811115611b1157611b116147e8565b14611b32578251604051633b0d540d60e21b815261065c9190600401614925565b60208301516001600160a01b03163314611b4c573361124a565b600281516005811115611b6157611b616147e8565b03611c3e578615611b7857611b768287611d3e565b505b5f8881526005850160205260409020805460ff1916600317905560608301516080820151611bb1918491611bac9190614c27565b613380565b505f898152600586016020526040812060020180546001600160401b03909316600160c01b026001600160c01b0390931692909217909155611bf2846134d7565b5f8a81526006870160205260408082208390555191925084918b917f366d336c0ab380dc799f095a6f82a26326585c52909cc698b09ba4540709ed5791a31515945061099b9350505050565b600481516005811115611c5357611c536147e8565b03611c8757611c61836134d7565b5f898152600686016020526040902055611c7a886126d1565b600194505050505061099b565b805160405163170cc93360e21b815261065c9190600401614879565b604080515f6020820152600160e11b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b611cfa613683565b610a61816136ce565b5f9081527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020546001600160a01b0316151590565b6040516306f8253560e41b815263ffffffff821660048201525f90819081906005600160991b0190636f825350906024015f60405180830381865afa158015611d89573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611db09190810190614c52565b9150915080611dd257604051636b2f19e960e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611e3991906148db565b825114611e5f578151604051636ba589a560e01b8152600481019190915260240161065c565b60208201516001600160a01b031615611e9b576020820151604051624de75d60e31b81526001600160a01b03909116600482015260240161065c565b5f80611eaa846040015161373c565b91509150818714611ed15760405163089938b360e11b81526004810188905260240161065c565b5f8781527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020600101545f80516020614ff3833981519152906001600160401b039081169083161115611f8e575f888152600482016020908152604091829020600101805467ffffffffffffffff19166001600160401b038616908117909155915191825289917fec44148e8ff271f2d0bacef1142154abacb0abb3a29eb3eb50e2ca97e86d0435910160405180910390a2611fad565b5f8881526004820160205260409020600101546001600160401b031691505b509695505050505050565b5f5f80516020614ff383398151915281611fd186613917565b9050611fdc86611d03565b611feb5760019250505061099b565b5f8681526004830160205260409020546001600160a01b03163314612010573361124a565b5f86815260048301602052604090205460a082015161203f91600160b01b90046001600160401b031690614d24565b6001600160401b03168160c001516001600160401b031610156120865760c081015160405163fb6ce63f60e01b81526001600160401b03909116600482015260240161065c565b5f851561209e576120978786611d3e565b90506120bc565b505f8681526004830160205260409020600101546001600160401b03165b600383015460408301515f916001600160a01b03169063778c06b5906120e190611182565b60a086015160c087015160405160e085901b6001600160e01b031916815260048101939093526001600160401b0391821660248401819052604484015281166064830152851660848201525f60a4820181905260c482015260e401602060405180830381865afa158015612157573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061217b91906148db565b905080846007015f8a81526020019081526020015f205f82825461219f9190614b1f565b90915550501515979650505050505050565b5f805160206150338339815191528054600119016121e257604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b7f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d02545f905f80516020614ff383398151915290600160401b900461ffff908116908616108061223c575061271061ffff8616115b1561226057604051635f12e6c360e11b815261ffff8616600482015260240161065c565b60028101546001600160401b03908116908516101561229c576040516202a06d60e11b81526001600160401b038516600482015260240161065c565b80548310806122ae5750806001015483115b156122cf5760405163222d164360e21b81526004810184905260240161065c565b825f6122da8261094d565b90505f6122e78983613b69565b905060405180608001604052806122fb3390565b6001600160a01b03908116825261ffff808c166020808501919091526001600160401b03808d166040808701919091525f60609687018190528881526004909b018352998a902086518154938801519b8801518316600160b01b0267ffffffffffffffff60b01b199c909516600160a01b026001600160b01b03199094169516949094179190911798909816178155910151600190910180549190951667ffffffffffffffff19909116179093555090915050949350505050565b60015f8051602061503383398151915255565b5f6123d26145c7565b5f805160206150138339815191525f806123ee611499876128b8565b91509150801561241557604051632d07135360e01b8152811515600482015260240161065c565b5f828152600784016020526040808220815160e081019092528054829060ff166005811115612446576124466147e8565b6005811115612457576124576147e8565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c090910152909150815160058111156124c6576124c66147e8565b141580156124e757506001815160058111156124e4576124e46147e8565b14155b1561250857805160405163170cc93360e21b815261065c9190600401614879565b60038151600581111561251d5761251d6147e8565b0361252b5760048152612530565b600581525b6020808201515f908152600886018252604080822082905585825260078701909252208151815483929190829060ff19166001836005811115612575576125756147e8565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff19169190921617905580516005811115612629576126296147e8565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b6040516327ad555d60e11b81526001600160a01b0383166004820152602481018290526001600160991b0190634f5aaaba906044015f604051808303815f87803b1580156126ac575f80fd5b505af1158015610b93573d5f803e3d5ffd5b6114796001600160a01b03831682613f9b565b5f8181525f80516020614fd38339815191526020526040808220815160e0810190925280545f80516020614ff383398151915293929190829060ff16600381111561271e5761271e6147e8565b600381111561272f5761272f6147e8565b8152815461010090046001600160a01b03166020808301919091526001808401546040808501919091526002948501546001600160401b038082166060870152600160401b820481166080870152600160801b8204811660a0870152600160c01b9091041660c090940193909352848301515f89815260058901845284812080546001600160a81b0319168155928301819055919094018190556006870190915290812080549082905592935090919080821561285d575f8481526004870160205260409020546127109061280f90600160a01b900461ffff1685614b54565b6128199190614906565b915081866007015f8681526020019081526020015f205f82825461283d9190614b1f565b9091555061284d90508284614d44565b905061285d856020015182612660565b6128728560200151610a418760600151611182565b6040805182815260208101849052859189917f8ececf510070c320d9a55323ffabe350e294ae505fc0c509dc5736da6f5cc993910160405180910390a350505050505050565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa15801561291c573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526129439190810190614c52565b915091508061296557604051636b2f19e960e01b815260040160405180910390fd5b81511561298b578151604051636ba589a560e01b8152600481019190915260240161065c565b60208201516001600160a01b0316156129c7576020820151604051624de75d60e31b81526001600160a01b03909116600482015260240161065c565b5092915050565b5f805f83516036146129f357604051638d0242c960e01b815260040160405180910390fd5b5f805b6002811015612a4257612a0a816001614d44565b612a15906008614b54565b61ffff16868281518110612a2b57612a2b6149b3565b016020015160f81c901b91909117906001016129f6565b5061ffff811615612a665760405163059510e360e31b815260040160405180910390fd5b5f805b6004811015612ac157612a7d816003614d44565b612a88906008614b54565b63ffffffff1687612a9a836002614b1f565b81518110612aaa57612aaa6149b3565b016020015160f81c901b9190911790600101612a69565b5063ffffffff8116600414612ae957604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612b3e57612b0081601f614d44565b612b0b906008614b54565b88612b17836006614b1f565b81518110612b2757612b276149b3565b016020015160f81c901b9190911790600101612aec565b505f805b6008811015612b9d57612b56816007614d44565b612b61906008614b54565b6001600160401b031689612b76836026614b1f565b81518110612b8657612b866149b3565b016020015160f81c901b9190911790600101612b42565b505f805b6008811015612bfc57612bb5816007614d44565b612bc0906008614b54565b6001600160401b03168a612bd583602e614b1f565b81518110612be557612be56149b3565b016020015160f81c901b9190911790600101612ba1565b5091989097509095509350505050565b5f8151602614612c2f57604051638d0242c960e01b815260040160405180910390fd5b5f805b6002811015612c7e57612c46816001614d44565b612c51906008614b54565b61ffff16848281518110612c6757612c676149b3565b016020015160f81c901b9190911790600101612c32565b5061ffff811615612ca25760405163059510e360e31b815260040160405180910390fd5b5f805b6004811015612cfd57612cb9816003614d44565b612cc4906008614b54565b63ffffffff1685612cd6836002614b1f565b81518110612ce657612ce66149b3565b016020015160f81c901b9190911790600101612ca5565b5063ffffffff811615612d2357604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612d7857612d3a81601f614d44565b612d45906008614b54565b86612d51836006614b1f565b81518110612d6157612d616149b3565b016020015160f81c901b9190911790600101612d26565b50949350505050565b60605f823560208401356014612d9c86860160408801614953565b612da9606088018861496e565b604051612e02969594939250602001948552602085019390935260e091821b6001600160e01b0319908116604086015260609190911b6bffffffffffffffffffffffff1916604485015291901b166058820152605c0190565b60405160208183030381529060405290505f5b612e22606085018561496e565b90508110156129c75781612e39606086018661496e565b83818110612e4957612e496149b3565b9050602002810190612e5b91906149c7565b35612e69606087018761496e565b84818110612e7957612e796149b3565b9050602002810190612e8b91906149c7565b612e9c9060408101906020016147cf565b612ea9606088018861496e565b85818110612eb957612eb96149b3565b9050602002810190612ecb91906149c7565b612ed9906040810190614d57565b604051602001612eed959493929190614d99565b60408051601f198184030181529190529150600101612e15565b5f808251602714612f2b57604051638d0242c960e01b815260040160405180910390fd5b5f805b6002811015612f7a57612f42816001614d44565b612f4d906008614b54565b61ffff16858281518110612f6357612f636149b3565b016020015160f81c901b9190911790600101612f2e565b5061ffff811615612f9e5760405163059510e360e31b815260040160405180910390fd5b5f805b6004811015612ff957612fb5816003614d44565b612fc0906008614b54565b63ffffffff1686612fd2836002614b1f565b81518110612fe257612fe26149b3565b016020015160f81c901b9190911790600101612fa1565b5063ffffffff811660031461302157604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156130765761303881601f614d44565b613043906008614b54565b8761304f836006614b1f565b8151811061305f5761305f6149b3565b016020015160f81c901b9190911790600101613024565b505f8660268151811061308b5761308b6149b3565b016020015191976001600160f81b03199092161515965090945050505050565b5f5f80516020614ff3833981519152816130c48461094d565b90505f6130d08761195d565b90506130db87611d03565b6130fb576040516330efa98b60e01b81526004810188905260240161065c565b600281516005811115613110576131106147e8565b1461313157805160405163170cc93360e21b815261065c9190600401614879565b5f8282608001516131429190614d24565b905083600201600a9054906101000a90046001600160401b0316826040015161316b9190614dde565b6001600160401b0316816001600160401b031611156131a857604051636d51fe0560e11b81526001600160401b038216600482015260240161065c565b5f806131b48a84613380565b915091505f8a836040516020016131e292919091825260c01b6001600160c01b031916602082015260280190565b60408051601f19818403018152828252805160209091012060e08301909152915080600181526001600160a01b038c1660208083019190915260408083018f90526001600160401b03808b1660608501525f6080850181905290881660a085015260c090930183905284835260058b01909152902081518154829060ff19166001836003811115613275576132756147e8565b02179055506020828101518254610100600160a81b0319166101006001600160a01b039283160217835560408085015160018501556060808601516002909501805460808089015160a08a015160c0909a01516001600160401b03998a166001600160801b031990941693909317600160401b918a1691909102176001600160801b0316600160801b998916999099026001600160c01b031698909817600160c01b91881691909102179055815189861681528a861694810194909452938b1690830152918101859052908c16918d9184917fb0024b263bc3a0b728a6edea50a69efa841189f8d32ee8af9d1c2b1a1a223426910160405180910390a49a9950505050505050505050565b5f8281525f80516020615053833981519152602052604081206002015481905f8051602061501383398151915290600160801b90046001600160401b03166133c8858261402e565b5f6133d287614208565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6134228a858b611ca3565b6040518263ffffffff1660e01b815260040161343e91906148a9565b6020604051808303815f875af115801561345a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061347e91906148db565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b5f805f80516020614ff383398151915290505f6134f7846040015161195d565b90505f60038251600581111561350f5761350f6147e8565b148061352d575060048251600581111561352b5761352b6147e8565b145b1561353d575060c081015161357a565b600282516005811115613552576135526147e8565b0361355e57504261357a565b815160405163170cc93360e21b815261065c9190600401614879565b84608001516001600160401b0316816001600160401b0316116135a157505f949350505050565b600383015460608601516001600160a01b039091169063778c06b5906135c690611182565b60a085015160808901516040808b01515f90815260048a810160205282822060010154925160e088901b6001600160e01b0319168152908101959095526001600160401b0393841660248601529183166044850152828716606485015291909116608483015260a4820181905260c482015260e401602060405180830381865afa158015613656573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061367a91906148db565b95945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166136cc57604051631afcd79f60e31b815260040160405180910390fd5b565b6136d6613683565b6136df8161427d565b6136e7614296565b610a616060820135608083013561370460c0850160a086016147cf565b61371460e0860160c08701614e09565b613725610100870160e08801614e22565b61373761012088016101008901614953565b6142a6565b5f808251602e1461376057604051638d0242c960e01b815260040160405180910390fd5b5f805b60028110156137af57613777816001614d44565b613782906008614b54565b61ffff16858281518110613798576137986149b3565b016020015160f81c901b9190911790600101613763565b5061ffff8116156137d35760405163059510e360e31b815260040160405180910390fd5b5f805b600481101561382e576137ea816003614d44565b6137f5906008614b54565b63ffffffff1686613807836002614b1f565b81518110613817576138176149b3565b016020015160f81c901b91909117906001016137d6565b5063ffffffff811660051461385657604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156138ab5761386d81601f614d44565b613878906008614b54565b87613884836006614b1f565b81518110613894576138946149b3565b016020015160f81c901b9190911790600101613859565b505f805b600881101561390a576138c3816007614d44565b6138ce906008614b54565b6001600160401b0316886138e3836026614b1f565b815181106138f3576138f36149b3565b016020015160f81c901b91909117906001016138af565b5090969095509350505050565b61391f6145c7565b5f8281525f805160206150538339815191526020526040808220815160e0810190925280545f8051602061501383398151915293929190829060ff16600581111561396c5761396c6147e8565b600581111561397d5761397d6147e8565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a084015260039093015490921660c090910152909150815160058111156139ef576139ef6147e8565b14613a22575f8481526007830160205260409081902054905163170cc93360e21b815261065c9160ff1690600401614879565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff19166001836005811115613a6657613a666147e8565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f613b128582613380565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff16613bad57604051637fab81e560e01b815260040160405180910390fd5b5f8051602061501383398151915242613bcc60408601602087016147cf565b6001600160401b0316111580613c065750613bea6202a30042614b1f565b613bfa60408601602087016147cf565b6001600160401b031610155b15613c4057613c1b60408501602086016147cf565b604051635879da1360e11b81526001600160401b03909116600482015260240161065c565b6030613c4f6040860186614d57565b905014613c8157613c636040850185614d57565b6040516326475b2f60e11b815261065c925060040190815260200190565b8335613ca35760405163099e922360e21b81528435600482015260240161065c565b83355f90815260088201602052604090205415613cd657604051631ec583cb60e11b81528435600482015260240161065c565b613ce0835f61402e565b5f80613d796040518060a00160405280855f01548152602001885f01358152602001876001600160401b03168152602001886020016020810190613d2491906147cf565b6001600160401b03168152602001613d3f60408a018a614d57565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509152506143d5565b5f82815260068601602052604090209193509150613d978282614e86565b5085355f9081526008840160205260408082208490555163ee5b48eb60e01b81526005600160991b019063ee5b48eb90613dd59085906004016148a9565b6020604051808303815f875af1158015613df1573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613e1591906148db565b6040805160e08101909152909150806001815288356020808301919091526001600160401b03891660408084018290525f60608501819052608085019290925260a0840182905260c0909301819052868152600788019091522081518154829060ff19166001836005811115613e8d57613e8d6147e8565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909401516003909301805467ffffffffffffffff19169390941692909217909255829189359186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e918b91613f6d918e01908e016147cf565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b80471015613fbe5760405163cd78605960e01b815230600482015260240161065c565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114614007576040519150601f19603f3d011682016040523d82523d5f602084013e61400c565b606091505b505090508061066557604051630a12f52160e11b815260040160405180910390fd5b5f805160206150138339815191525f6001600160401b0380841690851611156140625761405b8385614c27565b905061406f565b61406c8484614c27565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b03166060820152429115806140d15750600184015481516140cd916001600160401b031690614b1f565b8210155b156140f7576001600160401b038316606082015281815260408101516020820152614116565b82816060018181516141099190614d24565b6001600160401b03169052505b6060810151614126906064614dde565b602082015160018601546001600160401b0392909216916141519190600160401b900460ff16614b54565b101561418157606081015160405163dfae880160e01b81526001600160401b03909116600482015260240161065c565b856001600160401b03168160400181815161419c9190614b1f565b9052506040810180516001600160401b03871691906141bc908390614d44565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f8181525f805160206150538339815191526020526040812060020180545f80516020615013833981519152919060089061425290600160401b90046001600160401b0316614f41565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b614285613683565b61428d614498565b610a61816144a0565b61429e613683565b6136cc614588565b6142ae613683565b5f80516020614ff383398151915261ffff841615806142d2575061271061ffff8516115b156142f657604051635f12e6c360e11b815261ffff8516600482015260240161065c565b8587111561431a5760405163222d164360e21b81526004810188905260240161065c565b60ff8316158061432d5750600a60ff8416115b156143505760405163170db35960e31b815260ff8416600482015260240161065c565b95865560018601949094556002850180546001600160401b039490941669ffffffffffffffffffff1990941693909317600160401b61ffff93909316929092029190911767ffffffffffffffff60501b191660ff91909116600160501b02179055600390910180546001600160a01b0319166001600160a01b03909216919091179055565b5f60608260800151516030146143fe57604051638d0242c960e01b815260040160405180910390fd5b5f806001855f015186602001518760400151886080015189606001516040516020016144309796959493929190614f5c565b60405160208183030381529060405290506002816040516144519190614b0e565b602060405180830381855afa15801561446c573d5f803e3d5ffd5b5050506040513d601f19601f8201168201806040525081019061448f91906148db565b94909350915050565b6136cc613683565b6144a8613683565b80355f8051602061501383398151915290815560146144cd6060840160408501614e22565b60ff1611806144ec57506144e76060830160408401614e22565b60ff16155b15614520576145016060830160408401614e22565b604051634a59bbff60e11b815260ff909116600482015260240161065c565b6145306060830160408401614e22565b60018201805460ff92909216600160401b0260ff60401b1990921691909117905561456160408301602084016147cf565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b6123b6613683565b50805461459c90614b6b565b5f825580601f106145ab575050565b601f0160209004905f5260205f2090810190610a619190614603565b6040805160e08101909152805f81525f6020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b5b80821115614617575f8155600101614604565b5090565b8015158114610a61575f80fd5b803563ffffffff81168114611958575f80fd5b5f805f6060848603121561464d575f80fd5b83359250602084013561465f8161461b565b915061466d60408501614628565b90509250925092565b5f60208284031215614686575f80fd5b5035919050565b5f610120828403121561469e575f80fd5b50919050565b5f80604083850312156146b5575f80fd5b823591506146c560208401614628565b90509250929050565b803561ffff81168114611958575f80fd5b80356001600160401b0381168114611958575f80fd5b5f805f60608486031215614707575f80fd5b83356001600160401b0381111561471c575f80fd5b84016060818703121561472d575f80fd5b925061473b602085016146ce565b915061466d604085016146df565b5f60208284031215614759575f80fd5b61099b82614628565b5f8060408385031215614773575f80fd5b61477c83614628565b946020939093013593505050565b5f806040838503121561479b575f80fd5b82356001600160401b038111156147b0575f80fd5b8301608081860312156147c1575f80fd5b91506146c560208401614628565b5f602082840312156147df575f80fd5b61099b826146df565b634e487b7160e01b5f52602160045260245ffd5b6006811061480c5761480c6147e8565b9052565b5f60e0820190506148228284516147fc565b6020830151602083015260408301516001600160401b0380821660408501528060608601511660608501528060808601511660808501528060a08601511660a08501528060c08601511660c0850152505092915050565b6020810161095d82846147fc565b5f5b838110156148a1578181015183820152602001614889565b50505f910152565b602081525f82518060208401526148c7816040850160208701614887565b601f01601f19169190910160400192915050565b5f602082840312156148eb575f80fd5b5051919050565b634e487b7160e01b5f52601160045260245ffd5b5f8261492057634e487b7160e01b5f52601260045260245ffd5b500490565b6020810160048310614939576149396147e8565b91905290565b6001600160a01b0381168114610a61575f80fd5b5f60208284031215614963575f80fd5b813561099b8161493f565b5f808335601e19843603018112614983575f80fd5b8301803591506001600160401b0382111561499c575f80fd5b6020019150600581901b36038213156134d0575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e198336030181126149db575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b0381118282101715614a1b57614a1b6149e5565b60405290565b604051601f8201601f191681016001600160401b0381118282101715614a4957614a496149e5565b604052919050565b5f6001600160401b03821115614a6957614a696149e5565b50601f01601f191660200190565b5f60608236031215614a87575f80fd5b614a8f6149f9565b823581526020614aa08185016146df565b8183015260408401356001600160401b03811115614abc575f80fd5b840136601f820112614acc575f80fd5b8035614adf614ada82614a51565b614a21565b8181523684838501011115614af2575f80fd5b81848401858301375f9181019093015250604082015292915050565b5f82516149db818460208701614887565b8082018082111561095d5761095d6148f2565b5f63ffffffff808316818103614b4a57614b4a6148f2565b6001019392505050565b808202811582820484141761095d5761095d6148f2565b600181811c90821680614b7f57607f821691505b60208210810361469e57634e487b7160e01b5f52602260045260245ffd5b5f60208083525f8454614baf81614b6b565b806020870152604060018084165f8114614bd05760018114614bec57614c19565b60ff19851660408a0152604084151560051b8a01019550614c19565b895f5260205f205f5b85811015614c105781548b8201860152908301908801614bf5565b8a016040019650505b509398975050505050505050565b6001600160401b038281168282160390808211156129c7576129c76148f2565b80516119588161461b565b5f8060408385031215614c63575f80fd5b82516001600160401b0380821115614c79575f80fd5b9084019060608287031215614c8c575f80fd5b614c946149f9565b82518152602080840151614ca78161493f565b82820152604084015183811115614cbc575f80fd5b80850194505087601f850112614cd0575f80fd5b83519250614ce0614ada84614a51565b8381528882858701011115614cf3575f80fd5b614d0284838301848801614887565b80604084015250819550614d17818801614c47565b9450505050509250929050565b6001600160401b038181168382160190808211156129c7576129c76148f2565b8181038181111561095d5761095d6148f2565b5f808335601e19843603018112614d6c575f80fd5b8301803591506001600160401b03821115614d85575f80fd5b6020019150368190038213156134d0575f80fd5b5f8651614daa818460208b01614887565b820186815260c086901b6001600160c01b0319166020820152838560288301375f9301602801928352509095945050505050565b6001600160401b03818116838216028082169190828114614e0157614e016148f2565b505092915050565b5f60208284031215614e19575f80fd5b61099b826146ce565b5f60208284031215614e32575f80fd5b813560ff8116811461099b575f80fd5b601f82111561066557805f5260205f20601f840160051c81016020851015614e675750805b601f840160051c820191505b818110156117e8575f8155600101614e73565b81516001600160401b03811115614e9f57614e9f6149e5565b614eb381614ead8454614b6b565b84614e42565b602080601f831160018114614ee6575f8415614ecf5750858301515b5f19600386901b1c1916600185901b178555610b93565b5f85815260208120601f198616915b82811015614f1457888601518255948401946001909101908401614ef5565b5085821015614f3157878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f6001600160401b03808316818103614b4a57614b4a6148f2565b61ffff60f01b8860f01b16815263ffffffff60e01b8760e01b1660028201528560068201528460268201525f6001600160401b0360c01b808660c01b1660468401528451614fb181604e860160208901614887565b60c09490941b1691909201604e81019190915260560197965050505050505056fe4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d054317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_DELEGATION_FEE_BIPS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_STAKE_MULTIPLIER_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"NATIVE_MINTER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractINativeMinter\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"POS_VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"claimDelegationFees\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeDelegatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndDelegation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"forceInitializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structPoSValidatorManagerSettings\",\"components\":[{\"name\":\"baseSettings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"minimumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"maximumStakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minimumStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"minimumDelegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"rewardCalculator\",\"type\":\"address\",\"internalType\":\"contractIRewardCalculator\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeDelegatorRegistration\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initializeEndDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"includeUptimeProof\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"remainingBalanceOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]},{\"name\":\"disableOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}]},{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendUpdateDelegation\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"submitUptimeProof\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"valueToWeight\",\"inputs\":[{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"weightToValue\",\"inputs\":[{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"type\":\"event\",\"name\":\"DelegationEnded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"rewards\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fees\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorAdded\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"delegatorAddress\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"delegatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRegistered\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"startTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DelegatorRemovalInitialized\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"UptimeUpdated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"uptime\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressInsufficientBalance\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"DelegatorIneligibleForRewards\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"FailedInnerCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidBLSPublicKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationFee\",\"inputs\":[{\"name\":\"delegationFeeBips\",\"type\":\"uint16\",\"internalType\":\"uint16\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegationID\",\"inputs\":[{\"name\":\"delegationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidDelegatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumDelegatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[{\"name\":\"actual\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"expected\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMinStakeDuration\",\"inputs\":[{\"name\":\"minStakeDuration\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidNonce\",\"inputs\":[{\"name\":\"nonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidPChainOwnerThreshold\",\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addressesLength\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeAmount\",\"inputs\":[{\"name\":\"stakeAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidStakeMultiplier\",\"inputs\":[{\"name\":\"maximumStakeMultiplier\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MaxWeightExceeded\",\"inputs\":[{\"name\":\"newValidatorWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"MinStakeDurationNotPassed\",\"inputs\":[{\"name\":\"endTime\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"PChainOwnerAddressesNotSorted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReentrancyGuardReentrantCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnauthorizedOwner\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]},{\"type\":\"error\",\"name\":\"ValidatorIneligibleForRewards\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ValidatorNotPoS\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]}]", + Bin: "0x608060405234801561000f575f80fd5b50604051615c0d380380615c0d83398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b615ac08061014d5f395ff3fe6080604052600436106101e6575f3560e01c8063732214f811610108578063b771b3bc1161009d578063c599e24f1161006d578063c599e24f14610582578063c974d1b614610595578063d5f20ff6146105a9578063df93d8de146105d5578063fd7ac5e7146105eb575f80fd5b8063b771b3bc1461050a578063ba3a4b9714610524578063bc5fbfec14610543578063bee0a03f14610563575f80fd5b806398f3e2b4116100d857806398f3e2b414610499578063a3a65e48146104b8578063af2f5feb146104d7578063afb98096146104ea575f80fd5b8063732214f81461043457806376f78621146104475780638280a25a1461046657806393e245981461047a575f80fd5b8063329c3e121161017e5780635297fae61161014e5780635297fae6146103a057806360305d62146103bf57806362065856146103e857806366435abf14610415575f80fd5b8063329c3e121461030857806335455ded1461033a5780633a1cfff614610362578063467ef06f14610381575f80fd5b806320d91b7a116101b957806320d91b7a1461027457806320e555651461029357806325e1c776146102b25780632e2194d8146102d1575f80fd5b80630118acc4146101ea5780630322ed981461020b578063151d30d11461022a5780631ec4472414610255575b5f80fd5b3480156101f5575f80fd5b50610209610204366004614d77565b61060a565b005b348015610216575f80fd5b50610209610225366004614db2565b61063f565b348015610235575f80fd5b5061023e600a81565b60405160ff90911681526020015b60405180910390f35b348015610260575f80fd5b5061020961026f366004614d77565b61084d565b34801561027f575f80fd5b5061020961028e366004614dc9565b610858565b34801561029e575f80fd5b506102096102ad366004614e17565b610d44565b3480156102bd575f80fd5b506102096102cc366004614e2e565b610e21565b3480156102dc575f80fd5b506102f06102eb366004614db2565b610e95565b6040516001600160401b03909116815260200161024c565b348015610313575f80fd5b506103226001600160991b0181565b6040516001600160a01b03909116815260200161024c565b348015610345575f80fd5b5061034f61271081565b60405161ffff909116815260200161024c565b34801561036d575f80fd5b5061020961037c366004614d77565b610eab565b34801561038c575f80fd5b5061020961039b366004614e4f565b610eb6565b3480156103ab575f80fd5b506102096103ba366004614e68565b610f78565b3480156103ca575f80fd5b506103d3601481565b60405163ffffffff909116815260200161024c565b3480156103f3575f80fd5b50610407610402366004614ea6565b6111e3565b60405190815260200161024c565b348015610420575f80fd5b506102f061042f366004614db2565b6111fc565b34801561043f575f80fd5b506104075f81565b348015610452575f80fd5b50610209610461366004614d77565b611210565b348015610471575f80fd5b5061023e603081565b348015610485575f80fd5b50610209610494366004614db2565b61123b565b3480156104a4575f80fd5b506102096104b3366004614e68565b611306565b3480156104c3575f80fd5b506102096104d2366004614e4f565b6114de565b6104076104e5366004614ed0565b611667565b3480156104f5575f80fd5b506104075f80516020615a3483398151915281565b348015610515575f80fd5b506103226005600160991b0181565b34801561052f575f80fd5b5061020961053e366004614db2565b61169b565b34801561054e575f80fd5b506104075f80516020615a5483398151915281565b34801561056e575f80fd5b5061020961057d366004614db2565b611884565b610407610590366004614db2565b6119c1565b3480156105a0575f80fd5b5061023e601481565b3480156105b4575f80fd5b506105c86105c3366004614db2565b6119f2565b60405161024c9190614f99565b3480156105e0575f80fd5b506102f06202a30081565b3480156105f6575f80fd5b50610407610605366004615019565b611b41565b610615838383611b9c565b61063a57604051631036cf9160e11b8152600481018490526024015b60405180910390fd5b505050565b5f8181525f80516020615a948339815191526020526040808220815160e0810190925280545f80516020615a5483398151915293929190829060ff16600581111561068c5761068c614f24565b600581111561069d5761069d614f24565b81526020016001820180546106b190615084565b80601f01602080910402602001604051908101604052809291908181526020018280546106dd90615084565b80156107285780601f106106ff57610100808354040283529160200191610728565b820191905f5260205f20905b81548152906001019060200180831161070b57829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a0909101529091508151600581111561079357610793614f24565b146107c6575f8381526007830160205260409081902054905163170cc93360e21b81526106319160ff16906004016150b6565b6005600160991b016001600160a01b031663ee5b48eb6107eb8584606001515f611e1a565b6040518263ffffffff1660e01b815260040161080791906150c4565b6020604051808303815f875af1158015610823573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061084791906150d6565b50505050565b610847838383611b9c565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f80516020615a548339815191529060ff16156108aa57604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108ed573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061091191906150d6565b83602001351461093a576040516372b0a7e760e11b815260208401356004820152602401610631565b3061094b6060850160408601615101565b6001600160a01b03161461098e576109696060840160408501615101565b604051632f88120d60e21b81526001600160a01b039091166004820152602401610631565b5f61099c606085018561511c565b905090505f805b828163ffffffff161015610c84575f6109bf606088018861511c565b8363ffffffff168181106109d5576109d5615161565b90506020028101906109e79190615175565b6109f090615299565b80516040519192505f916008880191610a0891615312565b90815260200160405180910390205414610a3857805160405163a41f772f60e01b815261063191906004016150c4565b5f6002885f013584604051602001610a6792919091825260e01b6001600160e01b031916602082015260240190565b60408051601f1981840301815290829052610a8191615312565b602060405180830381855afa158015610a9c573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610abf91906150d6565b90508086600801835f0151604051610ad79190615312565b90815260408051602092819003830181209390935560e0830181526002835284518284015284810180516001600160401b03908116858401525f60608601819052915181166080860152421660a085015260c0840181905284815260078a01909252902081518154829060ff19166001836005811115610b5957610b59614f24565b021790555060208201516001820190610b729082615367565b506040828101516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff191692841692909217909155830151610c17911685615436565b8251604051919550610c2891615312565b60408051918290038220908401516001600160401b031682529082907f9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf9060200160405180910390a3505080610c7d90615449565b90506109a3565b50600483018190555f610ca2610c9986611e69565b60400151611f7f565b90505f610cae8761210c565b90505f600282604051610cc19190615312565b602060405180830381855afa158015610cdc573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190610cff91906150d6565b9050828114610d2b57604051631872fc8d60e01b81526004810182905260248101849052604401610631565b5050506009909201805460ff1916600117905550505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460029190600160401b900460ff1680610d8d575080546001600160401b03808416911610155b15610dab5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff19166001600160401b03831617600160401b178155610dd5836122e6565b805460ff60401b191681556040516001600160401b03831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050565b610e2a826122f7565b610e4a576040516330efa98b60e01b815260048101839052602401610631565b5f610e54836119f2565b5190506002816005811115610e6b57610e6b614f24565b14610e8b578060405163170cc93360e21b815260040161063191906150b6565b6108478383612332565b5f610ea564e8d4a510008361546b565b92915050565b6108478383836125ac565b610ebe6127a5565b5f80516020615a348339815191525f80610ed7846127dc565b91509150610ee4826122f7565b610ef057505050610f5f565b5f82815260048085016020526040909120546001600160a01b03169082516005811115610f1f57610f1f614f24565b03610f44575f83815260078501602052604081208054919055610f428282612b1a565b505b610f5a81610f5584604001516111e3565b612b78565b505050505b610f7560015f80516020615a7483398151915255565b50565b5f8181525f80516020615a148339815191526020526040808220815160e0810190925280545f80516020615a3483398151915293929190829060ff166003811115610fc557610fc5614f24565b6003811115610fd657610fd6614f24565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f61104c826119f2565b905060018351600381111561106357611063614f24565b14611084578251604051633b0d540d60e21b8152610631919060040161548a565b60048151600581111561109957611099614f24565b036110af576110a785612b9e565b505050505050565b5f806110c66110bd89611e69565b60400151612d85565b50915091508184146110f357846040015160405163089938b360e11b815260040161063191815260200190565b806001600160401b031683606001516001600160401b0316108061112c5750806001600160401b03168560a001516001600160401b0316115b1561115557604051632e19bc2d60e11b81526001600160401b0382166004820152602401610631565b5f878152600587016020908152604091829020805460ff1916600290811782550180546001600160401b034216600160401b81026fffffffffffffffff000000000000000019909216919091179091559151918252859189917f047059b465069b8b751836b41f9f1d83daff583d2238cc7fbb461437ec23a4f6910160405180910390a35050505050505050565b5f610ea56001600160401b03831664e8d4a510006154a4565b5f611206826119f2565b6080015192915050565b61121b8383836125ac565b61063a57604051635bff683f60e11b815260048101849052602401610631565b5f80516020615a348339815191525f611253836119f2565b519050600481600581111561126a5761126a614f24565b1461128a578060405163170cc93360e21b815260040161063191906150b6565b5f8381526004830160205260409020546001600160a01b031633146112d057335b604051636e2ccd7560e11b81526001600160a01b039091166004820152602401610631565b5f83815260078301602090815260408083208054908490556004860190925290912054610847906001600160a01b031682612b1a565b61130e6127a5565b5f8181525f80516020615a148339815191526020526040808220815160e0810190925280545f80516020615a3483398151915293929190829060ff16600381111561135b5761135b614f24565b600381111561136c5761136c614f24565b8152815461010090046001600160a01b03166020820152600182015460408201526002909101546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c09091015290506003815160038111156113e5576113e5614f24565b14611406578051604051633b0d540d60e21b8152610631919060040161548a565b600461141582604001516119f2565b51600581111561142757611427614f24565b146114b9575f61143685611e69565b90505f806114478360400151612d85565b5091509150818460400151146114735760405163089938b360e11b815260048101839052602401610631565b806001600160401b03168460c001516001600160401b031611156114b557604051632e19bc2d60e11b81526001600160401b0382166004820152602401610631565b5050505b6114c283612b9e565b50506114da60015f80516020615a7483398151915255565b5050565b5f80516020615a548339815191525f806115036114fa85611e69565b60400151612fdb565b915091508061152957604051632d07135360e01b81528115156004820152602401610631565b5f8281526006840160205260409020805461154390615084565b90505f036115675760405163089938b360e11b815260048101839052602401610631565b60015f83815260078501602052604090205460ff16600581111561158d5761158d614f24565b146115c0575f8281526007840160205260409081902054905163170cc93360e21b81526106319160ff16906004016150b6565b5f82815260068401602052604081206115d891614ccb565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f6116706127a5565b61167c84848434613197565b905061169460015f80516020615a7483398151915255565b9392505050565b5f8181525f80516020615a148339815191526020526040808220815160e0810190925280545f80516020615a3483398151915293929190829060ff1660038111156116e8576116e8614f24565b60038111156116f9576116f9614f24565b8152815461010090046001600160a01b0316602082015260018083015460408301526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101529091508151600381111561177257611772614f24565b14158015611793575060038151600381111561179057611790614f24565b14155b156117b4578051604051633b0d540d60e21b8152610631919060040161548a565b5f6117c282604001516119f2565b905080606001516001600160401b03165f036117f4576040516339b894f960e21b815260048101859052602401610631565b6005600160991b016001600160a01b031663ee5b48eb611821846040015184606001518560800151611e1a565b6040518263ffffffff1660e01b815260040161183d91906150c4565b6020604051808303815f875af1158015611859573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061187d91906150d6565b5050505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f80516020615a5483398151915291906118cb90615084565b90505f036118ef5760405163089938b360e11b815260048101839052602401610631565b60015f83815260078301602052604090205460ff16600581111561191557611915614f24565b14611948575f8281526007820160205260409081902054905163170cc93360e21b81526106319160ff16906004016150b6565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb9161198191906004016154bb565b6020604051808303815f875af115801561199d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061063a91906150d6565b5f6119ca6127a5565b6119d5823334613365565b90506119ed60015f80516020615a7483398151915255565b919050565b6119fa614d02565b5f8281525f80516020615a94833981519152602052604090819020815160e0810190925280545f80516020615a54833981519152929190829060ff166005811115611a4757611a47614f24565b6005811115611a5857611a58614f24565b8152602001600182018054611a6c90615084565b80601f0160208091040260200160405190810160405280929190818152602001828054611a9890615084565b8015611ae35780601f10611aba57610100808354040283529160200191611ae3565b820191905f5260205f20905b815481529060010190602001808311611ac657829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b9091048116608083015260039092015490911660a0909101529392505050565b6040515f905f80516020615a54833981519152907fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb0890611b849086908690615545565b90815260200160405180910390205491505092915050565b5f8381525f80516020615a148339815191526020526040808220815160e0810190925280545f80516020615a348339815191529284929091829060ff166003811115611bea57611bea614f24565b6003811115611bfb57611bfb614f24565b8152815461010090046001600160a01b0316602082015260018201546040808301919091526002909201546001600160401b038082166060840152600160401b820481166080840152600160801b8204811660a0840152600160c01b9091041660c0909101528101519091505f611c71826119f2565b9050600283516003811115611c8857611c88614f24565b14611ca9578251604051633b0d540d60e21b8152610631919060040161548a565b60208301516001600160a01b03163314611cc357336112ab565b600281516005811115611cd857611cd8614f24565b03611db5578615611cef57611ced8287612332565b505b5f8881526005850160205260409020805460ff1916600317905560608301516080820151611d28918491611d239190615554565b61363a565b505f898152600586016020526040812060020180546001600160401b03909316600160c01b026001600160c01b0390931692909217909155611d6984613791565b5f8a81526006870160205260408082208390555191925084918b917f366d336c0ab380dc799f095a6f82a26326585c52909cc698b09ba4540709ed5791a3151594506116949350505050565b600481516005811115611dca57611dca614f24565b03611dfe57611dd883613791565b5f898152600686016020526040902055611df188612b9e565b6001945050505050611694565b805160405163170cc93360e21b815261063191906004016150b6565b604080515f6020820152600360e01b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015611ecd573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f19168201604052611ef4919081019061557f565b9150915080611f1657604051636b2f19e960e01b815260040160405180910390fd5b815115611f3c578151604051636ba589a560e01b81526004810191909152602401610631565b60208201516001600160a01b031615611f78576020820151604051624de75d60e31b81526001600160a01b039091166004820152602401610631565b5092915050565b5f8151602614611fb457815160405163cc92daa160e01b815263ffffffff909116600482015260266024820152604401610631565b5f805b600281101561200357611fcb816001615651565b611fd69060086154a4565b61ffff16848281518110611fec57611fec615161565b016020015160f81c901b9190911790600101611fb7565b5061ffff81161561202d5760405163407b587360e01b815261ffff82166004820152602401610631565b5f805b600481101561208857612044816003615651565b61204f9060086154a4565b63ffffffff1685612061836002615436565b8151811061207157612071615161565b016020015160f81c901b9190911790600101612030565b5063ffffffff8116156120ae57604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612103576120c581601f615651565b6120d09060086154a4565b866120dc836006615436565b815181106120ec576120ec615161565b016020015160f81c901b91909117906001016120b1565b50949350505050565b60605f8083356020850135601461212887870160408901615101565b612135606089018961511c565b60405160f09790971b6001600160f01b0319166020880152602287019590955250604285019290925260e090811b6001600160e01b0319908116606286015260609290921b6bffffffffffffffffffffffff191660668501529190911b16607a820152607e0160405160208183030381529060405290505f5b6121bb606085018561511c565b9050811015611f7857816121d2606086018661511c565b838181106121e2576121e2615161565b90506020028101906121f49190615175565b6121fe9080615664565b905061220d606087018761511c565b8481811061221d5761221d615161565b905060200281019061222f9190615175565b6122399080615664565b612246606089018961511c565b8681811061225657612256615161565b90506020028101906122689190615175565b612276906020810190615664565b61228360608b018b61511c565b8881811061229357612293615161565b90506020028101906122a59190615175565b6122b6906060810190604001614ea6565b6040516020016122cc97969594939291906156a6565b60408051601f1981840301815291905291506001016121ae565b6122ee61393d565b610f7581613988565b5f9081527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020546001600160a01b0316151590565b6040516306f8253560e41b815263ffffffff821660048201525f90819081906005600160991b0190636f825350906024015f60405180830381865afa15801561237d573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526123a4919081019061557f565b91509150806123c657604051636b2f19e960e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015612409573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061242d91906150d6565b825114612453578151604051636ba589a560e01b81526004810191909152602401610631565b60208201516001600160a01b03161561248f576020820151604051624de75d60e31b81526001600160a01b039091166004820152602401610631565b5f8061249e84604001516139f6565b915091508187146124c55760405163089938b360e11b815260048101889052602401610631565b5f8781527f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d0460205260409020600101545f80516020615a34833981519152906001600160401b039081169083161115612582575f888152600482016020908152604091829020600101805467ffffffffffffffff19166001600160401b038616908117909155915191825289917fec44148e8ff271f2d0bacef1142154abacb0abb3a29eb3eb50e2ca97e86d0435910160405180910390a26125a1565b5f8881526004820160205260409020600101546001600160401b031691505b509695505050505050565b5f5f80516020615a34833981519152816125c586613be7565b90506125d0866122f7565b6125df57600192505050611694565b5f8681526004830160205260409020546001600160a01b0316331461260457336112ab565b5f86815260048301602052604090205460a082015161263391600160b01b90046001600160401b03169061570f565b6001600160401b03168160c001516001600160401b0316101561267a5760c081015160405163fb6ce63f60e01b81526001600160401b039091166004820152602401610631565b5f85156126925761268b8786612332565b90506126b0565b505f8681526004830160205260409020600101546001600160401b03165b600383015460408301515f916001600160a01b03169063778c06b5906126d5906111e3565b60a086015160c087015160405160e085901b6001600160e01b031916815260048101939093526001600160401b0391821660248401819052604484015281166064830152851660848201525f60a4820181905260c482015260e401602060405180830381865afa15801561274b573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061276f91906150d6565b905080846007015f8a81526020019081526020015f205f8282546127939190615436565b90915550501515979650505050505050565b5f80516020615a748339815191528054600119016127d657604051633ee5aeb560e01b815260040160405180910390fd5b60029055565b5f6127e5614d02565b5f80516020615a548339815191525f806128016114fa87611e69565b91509150801561282857604051632d07135360e01b81528115156004820152602401610631565b5f828152600784016020526040808220815160e081019092528054829060ff16600581111561285957612859614f24565b600581111561286a5761286a614f24565b815260200160018201805461287e90615084565b80601f01602080910402602001604051908101604052809291908181526020018280546128aa90615084565b80156128f55780601f106128cc576101008083540402835291602001916128f5565b820191905f5260205f20905b8154815290600101906020018083116128d857829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a0909101529091508151600581111561296057612960614f24565b14158015612981575060018151600581111561297e5761297e614f24565b14155b156129a257805160405163170cc93360e21b815261063191906004016150b6565b6003815160058111156129b7576129b7614f24565b036129c557600481526129ca565b600581525b8360080181602001516040516129e09190615312565b90815260408051602092819003830190205f908190558581526007870190925290208151815483929190829060ff19166001836005811115612a2457612a24614f24565b021790555060208201516001820190612a3d9082615367565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff19169190921617905580516005811115612ae357612ae3614f24565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b6040516327ad555d60e11b81526001600160a01b0383166004820152602481018290526001600160991b0190634f5aaaba906044015f604051808303815f87803b158015612b66575f80fd5b505af11580156110a7573d5f803e3d5ffd5b6114da6001600160a01b03831682613ecb565b60015f80516020615a7483398151915255565b5f8181525f80516020615a148339815191526020526040808220815160e0810190925280545f80516020615a3483398151915293929190829060ff166003811115612beb57612beb614f24565b6003811115612bfc57612bfc614f24565b8152815461010090046001600160a01b03166020808301919091526001808401546040808501919091526002948501546001600160401b038082166060870152600160401b820481166080870152600160801b8204811660a0870152600160c01b9091041660c090940193909352848301515f89815260058901845284812080546001600160a81b03191681559283018190559190940181905560068701909152908120805490829055929350909190808215612d2a575f84815260048701602052604090205461271090612cdc90600160a01b900461ffff16856154a4565b612ce6919061546b565b915081866007015f8681526020019081526020015f205f828254612d0a9190615436565b90915550612d1a90508284615651565b9050612d2a856020015182612b1a565b612d3f8560200151610f5587606001516111e3565b6040805182815260208101849052859189917f8ececf510070c320d9a55323ffabe350e294ae505fc0c509dc5736da6f5cc993910160405180910390a350505050505050565b5f805f8351603614612dbc57835160405163cc92daa160e01b815263ffffffff909116600482015260366024820152604401610631565b5f805b6002811015612e0b57612dd3816001615651565b612dde9060086154a4565b61ffff16868281518110612df457612df4615161565b016020015160f81c901b9190911790600101612dbf565b5061ffff811615612e355760405163407b587360e01b815261ffff82166004820152602401610631565b5f805b6004811015612e9057612e4c816003615651565b612e579060086154a4565b63ffffffff1687612e69836002615436565b81518110612e7957612e79615161565b016020015160f81c901b9190911790600101612e38565b5063ffffffff8116600314612eb857604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015612f0d57612ecf81601f615651565b612eda9060086154a4565b88612ee6836006615436565b81518110612ef657612ef6615161565b016020015160f81c901b9190911790600101612ebb565b505f805b6008811015612f6c57612f25816007615651565b612f309060086154a4565b6001600160401b031689612f45836026615436565b81518110612f5557612f55615161565b016020015160f81c901b9190911790600101612f11565b505f805b6008811015612fcb57612f84816007615651565b612f8f9060086154a4565b6001600160401b03168a612fa483602e615436565b81518110612fb457612fb4615161565b016020015160f81c901b9190911790600101612f70565b5091989097509095509350505050565b5f80825160271461301157825160405163cc92daa160e01b815263ffffffff909116600482015260276024820152604401610631565b5f805b600281101561306057613028816001615651565b6130339060086154a4565b61ffff1685828151811061304957613049615161565b016020015160f81c901b9190911790600101613014565b5061ffff81161561308a5760405163407b587360e01b815261ffff82166004820152602401610631565b5f805b60048110156130e5576130a1816003615651565b6130ac9060086154a4565b63ffffffff16866130be836002615436565b815181106130ce576130ce615161565b016020015160f81c901b919091179060010161308d565b5063ffffffff811660021461310d57604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156131625761312481601f615651565b61312f9060086154a4565b8761313b836006615436565b8151811061314b5761314b615161565b016020015160f81c901b9190911790600101613110565b505f8660268151811061317757613177615161565b016020015191976001600160f81b03199092161515965090945050505050565b7f4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d02545f905f80516020615a3483398151915290600160401b900461ffff90811690861610806131eb575061271061ffff8616115b1561320f57604051635f12e6c360e11b815261ffff86166004820152602401610631565b60028101546001600160401b03908116908516101561324b576040516202a06d60e11b81526001600160401b0385166004820152602401610631565b805483108061325d5750806001015483115b1561327e5760405163222d164360e21b815260048101849052602401610631565b825f61328982610e95565b90505f6132968983613f5e565b905060405180608001604052806132aa3390565b6001600160a01b03908116825261ffff808c166020808501919091526001600160401b03808d166040808701919091525f60609687018190528881526004909b018352998a902086518154938801519b8801518316600160b01b0267ffffffffffffffff60b01b199c909516600160a01b026001600160b01b03199094169516949094179190911798909816178155910151600190910180549190951667ffffffffffffffff19909116179093555090915050949350505050565b5f5f80516020615a348339815191528161337e84610e95565b90505f61338a876119f2565b9050613395876122f7565b6133b5576040516330efa98b60e01b815260048101889052602401610631565b6002815160058111156133ca576133ca614f24565b146133eb57805160405163170cc93360e21b815261063191906004016150b6565b5f8282608001516133fc919061570f565b905083600201600a9054906101000a90046001600160401b03168260400151613425919061572f565b6001600160401b0316816001600160401b0316111561346257604051636d51fe0560e11b81526001600160401b0382166004820152602401610631565b5f8061346e8a8461363a565b915091505f8a8360405160200161349c92919091825260c01b6001600160c01b031916602082015260280190565b60408051601f19818403018152828252805160209091012060e08301909152915080600181526001600160a01b038c1660208083019190915260408083018f90526001600160401b03808b1660608501525f6080850181905290881660a085015260c090930183905284835260058b01909152902081518154829060ff1916600183600381111561352f5761352f614f24565b02179055506020828101518254610100600160a81b0319166101006001600160a01b039283160217835560408085015160018501556060808601516002909501805460808089015160a08a015160c0909a01516001600160401b03998a166001600160801b031990941693909317600160401b918a1691909102176001600160801b0316600160801b998916999099026001600160c01b031698909817600160c01b91881691909102179055815189861681528a861694810194909452938b1690830152918101859052908c16918d9184917fb0024b263bc3a0b728a6edea50a69efa841189f8d32ee8af9d1c2b1a1a223426910160405180910390a49a9950505050505050505050565b5f8281525f80516020615a94833981519152602052604081206002015481905f80516020615a5483398151915290600160801b90046001600160401b031661368285826144d6565b5f61368c876146b0565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6136dc8a858b611e1a565b6040518263ffffffff1660e01b81526004016136f891906150c4565b6020604051808303815f875af1158015613714573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061373891906150d6565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b5f805f80516020615a3483398151915290505f6137b184604001516119f2565b90505f6003825160058111156137c9576137c9614f24565b14806137e757506004825160058111156137e5576137e5614f24565b145b156137f7575060c0810151613834565b60028251600581111561380c5761380c614f24565b03613818575042613834565b815160405163170cc93360e21b815261063191906004016150b6565b84608001516001600160401b0316816001600160401b03161161385b57505f949350505050565b600383015460608601516001600160a01b039091169063778c06b590613880906111e3565b60a085015160808901516040808b01515f90815260048a810160205282822060010154925160e088901b6001600160e01b0319168152908101959095526001600160401b0393841660248601529183166044850152828716606485015291909116608483015260a4820181905260c482015260e401602060405180830381865afa158015613910573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061393491906150d6565b95945050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661398657604051631afcd79f60e31b815260040160405180910390fd5b565b61399061393d565b61399981614725565b6139a161473e565b610f75606082013560808301356139be60c0850160a08601614ea6565b6139ce60e0860160c0870161575a565b6139df610100870160e08801615773565b6139f161012088016101008901615101565b61474e565b5f808251602e14613a2c57825160405163cc92daa160e01b815263ffffffff9091166004820152602e6024820152604401610631565b5f805b6002811015613a7b57613a43816001615651565b613a4e9060086154a4565b61ffff16858281518110613a6457613a64615161565b016020015160f81c901b9190911790600101613a2f565b5061ffff811615613aa55760405163407b587360e01b815261ffff82166004820152602401610631565b5f805b6004811015613b0057613abc816003615651565b613ac79060086154a4565b63ffffffff1686613ad9836002615436565b81518110613ae957613ae9615161565b016020015160f81c901b9190911790600101613aa8565b5063ffffffff811615613b2657604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015613b7b57613b3d81601f615651565b613b489060086154a4565b87613b54836006615436565b81518110613b6457613b64615161565b016020015160f81c901b9190911790600101613b29565b505f805b6008811015613bda57613b93816007615651565b613b9e9060086154a4565b6001600160401b031688613bb3836026615436565b81518110613bc357613bc3615161565b016020015160f81c901b9190911790600101613b7f565b5090969095509350505050565b613bef614d02565b5f8281525f80516020615a948339815191526020526040808220815160e0810190925280545f80516020615a5483398151915293929190829060ff166005811115613c3c57613c3c614f24565b6005811115613c4d57613c4d614f24565b8152602001600182018054613c6190615084565b80601f0160208091040260200160405190810160405280929190818152602001828054613c8d90615084565b8015613cd85780601f10613caf57610100808354040283529160200191613cd8565b820191905f5260205f20905b815481529060010190602001808311613cbb57829003601f168201915b50505091835250506002828101546001600160401b038082166020850152600160401b820481166040850152600160801b820481166060850152600160c01b9091048116608084015260039093015490921660a09091015290915081516005811115613d4657613d46614f24565b14613d79575f8481526007830160205260409081902054905163170cc93360e21b81526106319160ff16906004016150b6565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff19166001836005811115613dbd57613dbd614f24565b021790555060208201516001820190613dd69082615367565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f613e74858261363a565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b80471015613eee5760405163cd78605960e01b8152306004820152602401610631565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f8114613f37576040519150601f19603f3d011682016040523d82523d5f602084013e613f3c565b606091505b505090508061063a57604051630a12f52160e11b815260040160405180910390fd5b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff16613fa257604051637fab81e560e01b815260040160405180910390fd5b5f80516020615a5483398151915242613fc16060860160408701614ea6565b6001600160401b0316111580613ffb5750613fdf6202a30042615436565b613fef6060860160408701614ea6565b6001600160401b031610155b15614035576140106060850160408601614ea6565b604051635879da1360e11b81526001600160401b039091166004820152602401610631565b61404a6140456060860186615793565b61487d565b61405a6140456080860186615793565b60306140696020860186615664565b90501461409b5761407d6020850185615664565b6040516326475b2f60e11b8152610631925060040190815260200190565b6140a58480615664565b90505f036140d2576140b78480615664565b604051633e08a12560e11b81526004016106319291906157a7565b5f600882016140e18680615664565b6040516140ef929190615545565b908152602001604051809103902054146141285761410d8480615664565b60405163a41f772f60e01b81526004016106319291906157a7565b614132835f6144d6565b6040805160e08101909152815481525f90819061423e90602081016141578980615664565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525050509082525060209081019061419f908a018a615664565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152505050908252506020016141e860608a0160408b01614ea6565b6001600160401b0316815260200161420360608a018a615793565b61420c906157d5565b815260200161421e60808a018a615793565b614227906157d5565b8152602001876001600160401b03168152506149e6565b5f8281526006860160205260409020919350915061425c8282615367565b50816008840161426c8880615664565b60405161427a929190615545565b9081526040519081900360200181209190915563ee5b48eb60e01b81525f906005600160991b019063ee5b48eb906142b69085906004016150c4565b6020604051808303815f875af11580156142d2573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906142f691906150d6565b6040805160e0810190915290915080600181526020016143168980615664565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509385525050506001600160401b0389166020808401829052604080850184905260608501929092526080840183905260a0909301829052868252600788019092522081518154829060ff191660018360058111156143a5576143a5614f24565b0217905550602082015160018201906143be9082615367565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790558061445c8880615664565b60405161446a929190615545565b6040518091039020847fb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430898b60400160208101906144a89190614ea6565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b5f80516020615a548339815191525f6001600160401b03808416908516111561450a576145038385615554565b9050614517565b6145148484615554565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b0316606082015242911580614579575060018401548151614575916001600160401b031690615436565b8210155b1561459f576001600160401b0383166060820152818152604081015160208201526145be565b82816060018181516145b1919061570f565b6001600160401b03169052505b60608101516145ce90606461572f565b602082015160018601546001600160401b0392909216916145f99190600160401b900460ff166154a4565b101561462957606081015160405163dfae880160e01b81526001600160401b039091166004820152602401610631565b856001600160401b0316816040018181516146449190615436565b9052506040810180516001600160401b0387169190614664908390615651565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f8181525f80516020615a948339815191526020526040812060020180545f80516020615a5483398151915291906008906146fa90600160401b90046001600160401b031661589c565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b61472d61393d565b614735614bd3565b610f7581614bdb565b61474661393d565b613986614cc3565b61475661393d565b5f80516020615a3483398151915261ffff8416158061477a575061271061ffff8516115b1561479e57604051635f12e6c360e11b815261ffff85166004820152602401610631565b858711156147c25760405163222d164360e21b815260048101889052602401610631565b60ff831615806147d55750600a60ff8416115b156147f85760405163170db35960e31b815260ff84166004820152602401610631565b95865560018601949094556002850180546001600160401b039490941669ffffffffffffffffffff1990941693909317600160401b61ffff93909316929092029190911767ffffffffffffffff60501b191660ff91909116600160501b02179055600390910180546001600160a01b0319166001600160a01b03909216919091179055565b61488a6020820182614e4f565b63ffffffff161580156148aa57506148a5602082018261511c565b151590505b156148f1576148bc6020820182614e4f565b6148c9602083018361511c565b60405163c08a0f1d60e01b815263ffffffff9093166004840152602483015250604401610631565b6148fe602082018261511c565b905061490d6020830183614e4f565b63ffffffff161115614926576148bc6020820182614e4f565b60015b614936602083018361511c565b90508110156114da5761494c602083018361511c565b614957600184615651565b81811061496657614966615161565b905060200201602081019061497b9190615101565b6001600160a01b0316614991602084018461511c565b838181106149a1576149a1615161565b90506020020160208101906149b69190615101565b6001600160a01b031610156149de57604051630dbc8d5f60e31b815260040160405180910390fd5b600101614929565b5f6060826040015151603014614a0f5760405163180ffa0d60e01b815260040160405180910390fd5b82516020808501518051604080880151606089015160808a01518051908701515193515f98614a50988a9860019892979296909590949093909291016158b7565b60405160208183030381529060405290505f5b84608001516020015151811015614ac257818560800151602001518281518110614a8f57614a8f615161565b6020026020010151604051602001614aa8929190615971565b60408051601f198184030181529190529150600101614a63565b5060a0840151805160209182015151604051614ae29385939291016159a7565b60405160208183030381529060405290505f5b8460a001516020015151811015614b5457818560a00151602001518281518110614b2157614b21615161565b6020026020010151604051602001614b3a929190615971565b60408051601f198184030181529190529150600101614af5565b5060c0840151604051614b6b9183916020016159e2565b6040516020818303038152906040529050600281604051614b8c9190615312565b602060405180830381855afa158015614ba7573d5f803e3d5ffd5b5050506040513d601f19601f82011682018060405250810190614bca91906150d6565b94909350915050565b61398661393d565b614be361393d565b80355f80516020615a548339815191529081556014614c086060840160408501615773565b60ff161180614c275750614c226060830160408401615773565b60ff16155b15614c5b57614c3c6060830160408401615773565b604051634a59bbff60e11b815260ff9091166004820152602401610631565b614c6b6060830160408401615773565b60018201805460ff92909216600160401b0260ff60401b19909216919091179055614c9c6040830160208401614ea6565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b612b8b61393d565b508054614cd790615084565b5f825580601f10614ce6575050565b601f0160209004905f5260205f2090810190610f759190614d3f565b6040805160e08101909152805f81526060602082018190525f604083018190529082018190526080820181905260a0820181905260c09091015290565b5b80821115614d53575f8155600101614d40565b5090565b8015158114610f75575f80fd5b803563ffffffff811681146119ed575f80fd5b5f805f60608486031215614d89575f80fd5b833592506020840135614d9b81614d57565b9150614da960408501614d64565b90509250925092565b5f60208284031215614dc2575f80fd5b5035919050565b5f8060408385031215614dda575f80fd5b82356001600160401b03811115614def575f80fd5b830160808186031215614e00575f80fd5b9150614e0e60208401614d64565b90509250929050565b5f6101208284031215614e28575f80fd5b50919050565b5f8060408385031215614e3f575f80fd5b82359150614e0e60208401614d64565b5f60208284031215614e5f575f80fd5b61169482614d64565b5f8060408385031215614e79575f80fd5b614e8283614d64565b946020939093013593505050565b80356001600160401b03811681146119ed575f80fd5b5f60208284031215614eb6575f80fd5b61169482614e90565b803561ffff811681146119ed575f80fd5b5f805f60608486031215614ee2575f80fd5b83356001600160401b03811115614ef7575f80fd5b840160a08187031215614f08575f80fd5b9250614f1660208501614ebf565b9150614da960408501614e90565b634e487b7160e01b5f52602160045260245ffd5b60068110614f4857614f48614f24565b9052565b5f5b83811015614f66578181015183820152602001614f4e565b50505f910152565b5f8151808452614f85816020860160208601614f4c565b601f01601f19169290920160200192915050565b60208152614fab602082018351614f38565b5f602083015160e06040840152614fc6610100840182614f6e565b905060408401516001600160401b0380821660608601528060608701511660808601528060808701511660a08601528060a08701511660c08601528060c08701511660e086015250508091505092915050565b5f806020838503121561502a575f80fd5b82356001600160401b0380821115615040575f80fd5b818501915085601f830112615053575f80fd5b813581811115615061575f80fd5b866020828501011115615072575f80fd5b60209290920196919550909350505050565b600181811c9082168061509857607f821691505b602082108103614e2857634e487b7160e01b5f52602260045260245ffd5b60208101610ea58284614f38565b602081525f6116946020830184614f6e565b5f602082840312156150e6575f80fd5b5051919050565b6001600160a01b0381168114610f75575f80fd5b5f60208284031215615111575f80fd5b8135611694816150ed565b5f808335601e19843603018112615131575f80fd5b8301803591506001600160401b0382111561514a575f80fd5b6020019150600581901b360382131561378a575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112615189575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156151c9576151c9615193565b60405290565b604080519081016001600160401b03811182821017156151c9576151c9615193565b604051601f8201601f191681016001600160401b038111828210171561521957615219615193565b604052919050565b5f6001600160401b0382111561523957615239615193565b50601f01601f191660200190565b5f82601f830112615256575f80fd5b813561526961526482615221565b6151f1565b81815284602083860101111561527d575f80fd5b816020850160208301375f918101602001919091529392505050565b5f606082360312156152a9575f80fd5b6152b16151a7565b82356001600160401b03808211156152c7575f80fd5b6152d336838701615247565b835260208501359150808211156152e8575f80fd5b506152f536828601615247565b60208301525061530760408401614e90565b604082015292915050565b5f8251615189818460208701614f4c565b601f82111561063a57805f5260205f20601f840160051c810160208510156153485750805b601f840160051c820191505b8181101561187d575f8155600101615354565b81516001600160401b0381111561538057615380615193565b6153948161538e8454615084565b84615323565b602080601f8311600181146153c7575f84156153b05750858301515b5f19600386901b1c1916600185901b1785556110a7565b5f85815260208120601f198616915b828110156153f5578886015182559484019460019091019084016153d6565b508582101561541257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610ea557610ea5615422565b5f63ffffffff80831681810361546157615461615422565b6001019392505050565b5f8261548557634e487b7160e01b5f52601260045260245ffd5b500490565b602081016004831061549e5761549e614f24565b91905290565b8082028115828204841417610ea557610ea5615422565b5f60208083525f84546154cd81615084565b806020870152604060018084165f81146154ee576001811461550a57615537565b60ff19851660408a0152604084151560051b8a01019550615537565b895f5260205f205f5b8581101561552e5781548b8201860152908301908801615513565b8a016040019650505b509398975050505050505050565b818382375f9101908152919050565b6001600160401b03828116828216039080821115611f7857611f78615422565b80516119ed81614d57565b5f8060408385031215615590575f80fd5b82516001600160401b03808211156155a6575f80fd5b90840190606082870312156155b9575f80fd5b6155c16151a7565b825181526020808401516155d4816150ed565b828201526040840151838111156155e9575f80fd5b80850194505087601f8501126155fd575f80fd5b8351925061560d61526484615221565b8381528882858701011115615620575f80fd5b61562f84838301848801614f4c565b80604084015250819550615644818801615574565b9450505050509250929050565b81810381811115610ea557610ea5615422565b5f808335601e19843603018112615679575f80fd5b8301803591506001600160401b03821115615692575f80fd5b60200191503681900382131561378a575f80fd5b5f88516156b7818460208d01614f4c565b60e089901b6001600160e01b031916908301908152868860048301378681019050600481015f8152858782375060c09390931b6001600160c01b0319166004939094019283019390935250600c019695505050505050565b6001600160401b03818116838216019080821115611f7857611f78615422565b6001600160401b0381811683821602808216919082811461575257615752615422565b505092915050565b5f6020828403121561576a575f80fd5b61169482614ebf565b5f60208284031215615783575f80fd5b813560ff81168114611694575f80fd5b5f8235603e19833603018112615189575f80fd5b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b5f604082360312156157e5575f80fd5b6157ed6151cf565b6157f683614d64565b81526020808401356001600160401b0380821115615812575f80fd5b9085019036601f830112615824575f80fd5b81358181111561583657615836615193565b8060051b91506158478483016151f1565b8181529183018401918481019036841115615860575f80fd5b938501935b8385101561588a578435925061587a836150ed565b8282529385019390850190615865565b94860194909452509295945050505050565b5f6001600160401b0380831681810361546157615461615422565b61ffff60f01b8a60f01b1681525f63ffffffff60e01b808b60e01b166002840152896006840152808960e01b1660268401525086516158fd81602a850160208b01614f4c565b86519083019061591481602a840160208b01614f4c565b60c087901b6001600160c01b031916602a9290910191820152615946603282018660e01b6001600160e01b0319169052565b61595f603682018560e01b6001600160e01b0319169052565b603a019b9a5050505050505050505050565b5f8351615982818460208801614f4c565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b5f84516159b8818460208901614f4c565b6001600160e01b031960e095861b8116919093019081529290931b16600482015260080192915050565b5f83516159f3818460208801614f4c565b60c09390931b6001600160c01b031916919092019081526008019291505056fe4317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d054317713f7ecbdddd4bc99e95d903adedaa883b2e7c2551610bd13e2c7e473d00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", } // NativeTokenStakingManagerABI is the input ABI used to generate the binding from. @@ -596,7 +604,7 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) WARPME // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) GetValidator(opts *bind.CallOpts, validationID [32]byte) (Validator, error) { var out []interface{} err := _NativeTokenStakingManager.contract.Call(opts, &out, "getValidator", validationID) @@ -613,14 +621,14 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) GetValidator( // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) GetValidator(validationID [32]byte) (Validator, error) { return _NativeTokenStakingManager.Contract.GetValidator(&_NativeTokenStakingManager.CallOpts, validationID) } // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) GetValidator(validationID [32]byte) (Validator, error) { return _NativeTokenStakingManager.Contract.GetValidator(&_NativeTokenStakingManager.CallOpts, validationID) } @@ -656,10 +664,10 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) GetWei return _NativeTokenStakingManager.Contract.GetWeight(&_NativeTokenStakingManager.CallOpts, validationID) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID []byte) ([32]byte, error) { var out []interface{} err := _NativeTokenStakingManager.contract.Call(opts, &out, "registeredValidators", nodeID) @@ -673,17 +681,17 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerCaller) RegisteredVal } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _NativeTokenStakingManager.Contract.RegisteredValidators(&_NativeTokenStakingManager.CallOpts, nodeID) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_NativeTokenStakingManager *NativeTokenStakingManagerCallerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _NativeTokenStakingManager.Contract.RegisteredValidators(&_NativeTokenStakingManager.CallOpts, nodeID) } @@ -980,44 +988,44 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) In return _NativeTokenStakingManager.Contract.InitializeEndValidation(&_NativeTokenStakingManager.TransactOpts, validationID, includeUptimeProof, messageIndex) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x40034a93. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xaf2f5feb. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64) (*types.Transaction, error) { return _NativeTokenStakingManager.contract.Transact(opts, "initializeValidatorRegistration", registrationInput, delegationFeeBips, minStakeDuration) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x40034a93. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xaf2f5feb. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.InitializeValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, registrationInput, delegationFeeBips, minStakeDuration) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x40034a93. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0xaf2f5feb. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint16 delegationFeeBips, uint64 minStakeDuration) payable returns(bytes32) func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, delegationFeeBips uint16, minStakeDuration uint64) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.InitializeValidatorRegistration(&_NativeTokenStakingManager.TransactOpts, registrationInput, delegationFeeBips, minStakeDuration) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactor) InitializeValidatorSet(opts *bind.TransactOpts, subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _NativeTokenStakingManager.contract.Transact(opts, "initializeValidatorSet", subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.InitializeValidatorSet(&_NativeTokenStakingManager.TransactOpts, subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_NativeTokenStakingManager *NativeTokenStakingManagerTransactorSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _NativeTokenStakingManager.Contract.InitializeValidatorSet(&_NativeTokenStakingManager.TransactOpts, subnetConversionData, messageIndex) } @@ -1804,15 +1812,15 @@ func (it *NativeTokenStakingManagerInitialValidatorCreatedIterator) Close() erro // NativeTokenStakingManagerInitialValidatorCreated represents a InitialValidatorCreated event raised by the NativeTokenStakingManager contract. type NativeTokenStakingManagerInitialValidatorCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash Weight *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte) (*NativeTokenStakingManagerInitialValidatorCreatedIterator, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte) (*NativeTokenStakingManagerInitialValidatorCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1830,10 +1838,10 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterIniti return &NativeTokenStakingManagerInitialValidatorCreatedIterator{contract: _NativeTokenStakingManager.contract, event: "InitialValidatorCreated", logs: logs, sub: sub}, nil } -// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][32]byte) (event.Subscription, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1876,9 +1884,9 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchInitia }), nil } -// ParseInitialValidatorCreated is a log parse operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// ParseInitialValidatorCreated is a log parse operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseInitialValidatorCreated(log types.Log) (*NativeTokenStakingManagerInitialValidatorCreated, error) { event := new(NativeTokenStakingManagerInitialValidatorCreated) if err := _NativeTokenStakingManager.contract.UnpackLog(event, "InitialValidatorCreated", log); err != nil { @@ -2237,17 +2245,17 @@ func (it *NativeTokenStakingManagerValidationPeriodCreatedIterator) Close() erro // NativeTokenStakingManagerValidationPeriodCreated represents a ValidationPeriodCreated event raised by the NativeTokenStakingManager contract. type NativeTokenStakingManagerValidationPeriodCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash RegisterValidationMessageID [32]byte Weight *big.Int RegistrationExpiry uint64 Raw types.Log // Blockchain specific contextual infos } -// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (*NativeTokenStakingManagerValidationPeriodCreatedIterator, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (*NativeTokenStakingManagerValidationPeriodCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -2269,10 +2277,10 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) FilterValid return &NativeTokenStakingManagerValidationPeriodCreatedIterator{contract: _NativeTokenStakingManager.contract, event: "ValidationPeriodCreated", logs: logs, sub: sub}, nil } -// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *NativeTokenStakingManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -2319,9 +2327,9 @@ func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) WatchValida }), nil } -// ParseValidationPeriodCreated is a log parse operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// ParseValidationPeriodCreated is a log parse operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) func (_NativeTokenStakingManager *NativeTokenStakingManagerFilterer) ParseValidationPeriodCreated(log types.Log) (*NativeTokenStakingManagerValidationPeriodCreated, error) { event := new(NativeTokenStakingManagerValidationPeriodCreated) if err := _NativeTokenStakingManager.contract.UnpackLog(event, "ValidationPeriodCreated", log); err != nil { diff --git a/abi-bindings/go/validator-manager/PoAValidatorManager/PoAValidatorManager.go b/abi-bindings/go/validator-manager/PoAValidatorManager/PoAValidatorManager.go index 307bd6449..6db96b902 100644 --- a/abi-bindings/go/validator-manager/PoAValidatorManager/PoAValidatorManager.go +++ b/abi-bindings/go/validator-manager/PoAValidatorManager/PoAValidatorManager.go @@ -31,14 +31,20 @@ var ( // InitialValidator is an auto generated low-level Go binding around an user-defined struct. type InitialValidator struct { - NodeID [32]byte - Weight uint64 + NodeID []byte BlsPublicKey []byte + Weight uint64 +} + +// PChainOwner is an auto generated low-level Go binding around an user-defined struct. +type PChainOwner struct { + Threshold uint32 + Addresses []common.Address } // SubnetConversionData is an auto generated low-level Go binding around an user-defined struct. type SubnetConversionData struct { - ConvertSubnetTxID [32]byte + SubnetID [32]byte ValidatorManagerBlockchainID [32]byte ValidatorManagerAddress common.Address InitialValidators []InitialValidator @@ -47,7 +53,7 @@ type SubnetConversionData struct { // Validator is an auto generated low-level Go binding around an user-defined struct. type Validator struct { Status uint8 - NodeID [32]byte + NodeID []byte StartingWeight uint64 MessageNonce uint64 Weight uint64 @@ -64,15 +70,17 @@ type ValidatorManagerSettings struct { // ValidatorRegistrationInput is an auto generated low-level Go binding around an user-defined struct. type ValidatorRegistrationInput struct { - NodeID [32]byte - RegistrationExpiry uint64 - BlsPublicKey []byte + NodeID []byte + BlsPublicKey []byte + RegistrationExpiry uint64 + RemainingBalanceOwner PChainOwner + DisableOwner PChainOwner } // PoAValidatorManagerMetaData contains all meta data concerning the PoAValidatorManager contract. var PoAValidatorManagerMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"convertSubnetTxID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]", - Bin: "0x608060405234801561000f575f80fd5b50604051612fc8380380612fc883398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b612e7b8061014d5f395ff3fe608060405234801561000f575f80fd5b5060043610610132575f3560e01c806397fb70d4116100b4578063c974d1b611610079578063c974d1b6146102a7578063d588c18f146102af578063d5f20ff6146102c2578063df93d8de146102e2578063e7d14c1c146102ec578063f2fde38b1461032a575f80fd5b806397fb70d41461024c578063a3a65e481461025f578063b771b3bc14610272578063bc5fbfec14610280578063bee0a03f14610294575f80fd5b8063715018a6116100fa578063715018a6146101be578063732214f8146101c65780638280a25a146101db5780638994ab49146101f55780638da5cb5b14610208575f80fd5b80630322ed9814610136578063467ef06f1461014b57806360305d621461015e57806361e2f4901461018057806366435abf14610193575b5f80fd5b610149610144366004612522565b61033d565b005b610149610159366004612551565b6104cd565b610166601481565b60405163ffffffff90911681526020015b60405180910390f35b61014961018e36600461256a565b6104db565b6101a66101a1366004612522565b61098e565b6040516001600160401b039091168152602001610177565b6101496109a2565b6101cd5f81565b604051908152602001610177565b6101e3603081565b60405160ff9091168152602001610177565b6101cd6102033660046125e4565b6109b5565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03165b6040516001600160a01b039091168152602001610177565b61014961025a366004612522565b6109d1565b61014961026d366004612551565b6109e6565b6102346005600160991b0181565b6101cd5f80516020612e2f83398151915281565b6101496102a2366004612522565b610b6f565b6101e3601481565b6101496102bd366004612639565b610cac565b6102d56102d0366004612522565b610dba565b60405161017791906126a3565b6101a66202a30081565b6101cd6102fa366004612522565b5f9081527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb08602052604090205490565b61014961033836600461270c565b610e82565b5f8181525f80516020612e4f8339815191526020526040808220815160e0810190925280545f80516020612e2f83398151915293929190829060ff16600581111561038a5761038a61266f565b600581111561039b5761039b61266f565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c0909101529091508151600581111561040a5761040a61266f565b14610446575f8381526007830160205260409081902054905163170cc93360e21b815261043d9160ff169060040161272e565b60405180910390fd5b6005600160991b016001600160a01b031663ee5b48eb61046b8584606001515f610ebf565b6040518263ffffffff1660e01b8152600401610487919061275e565b6020604051808303815f875af11580156104a3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104c79190612790565b50505050565b6104d681610f0e565b505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f80516020612e2f8339815191529060ff161561052d57604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa158015610570573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105949190612790565b8360200135146105bd576040516372b0a7e760e11b81526020840135600482015260240161043d565b306105ce606085016040860161270c565b6001600160a01b031614610611576105ec606084016040850161270c565b604051632f88120d60e21b81526001600160a01b03909116600482015260240161043d565b5f61061f60608501856127a7565b905090505f805b828163ffffffff1610156108ce575f61064260608801886127a7565b8363ffffffff16818110610658576106586127ec565b905060200281019061066a9190612800565b610673906128b0565b80515f81815260088801602052604090205491925090156106aa57604051631ec583cb60e11b81526004810182905260240161043d565b5f6002895f0135856040516020016106d992919091825260e01b6001600160e01b031916602082015260240190565b60408051601f19818403018152908290526106f391612947565b602060405180830381855afa15801561070e573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906107319190612790565b5f8381526008890160209081526040808320849055805160e0810182526002815287518184015287830180516001600160401b039081168385015260608301869052905181166080830152421660a082015260c0810184905284845260078c01909252909120815181549394509192909190829060ff191660018360058111156107bd576107bd61266f565b0217905550602082810151600183015560408301516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff19169284169290921790915584015161087091168661296c565b83516020808601516040516001600160401b039091168152929750909183917fb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014910160405180910390a3505050806108c79061297f565b9050610626565b50600483018190555f6108ec6108e3866111a5565b604001516112bb565b90505f6108f887611430565b90505f60028260405161090b9190612947565b602060405180830381855afa158015610926573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906109499190612790565b905082811461097557604051631872fc8d60e01b8152600481018290526024810184905260440161043d565b5050506009909201805460ff1916600117905550505050565b5f61099882610dba565b6080015192915050565b6109aa6115b6565b6109b35f611611565b565b5f6109be6115b6565b6109c88383611681565b90505b92915050565b6109d96115b6565b6109e281611ab3565b5050565b5f80516020612e2f8339815191525f80610a0b610a02856111a5565b60400151611d05565b9150915080610a3157604051632d07135360e01b8152811515600482015260240161043d565b5f82815260068401602052604090208054610a4b906129a1565b90505f03610a6f5760405163089938b360e11b81526004810183905260240161043d565b60015f83815260078501602052604090205460ff166005811115610a9557610a9561266f565b14610ac8575f8281526007840160205260409081902054905163170cc93360e21b815261043d9160ff169060040161272e565b5f8281526006840160205260408120610ae091612497565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f80516020612e2f8339815191529190610bb6906129a1565b90505f03610bda5760405163089938b360e11b81526004810183905260240161043d565b60015f83815260078301602052604090205460ff166005811115610c0057610c0061266f565b14610c33575f8281526007820160205260409081902054905163170cc93360e21b815261043d9160ff169060040161272e565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610c6c91906004016129d3565b6020604051808303815f875af1158015610c88573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104d69190612790565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f81158015610cf05750825b90505f826001600160401b03166001148015610d0b5750303b155b905081158015610d19575080155b15610d375760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610d6157845460ff60401b1916600160401b1785555b610d6b8787611ea9565b8315610db157845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b610dc26124ce565b5f8281525f80516020612e4f833981519152602052604090819020815160e0810190925280545f80516020612e2f833981519152929190829060ff166005811115610e0f57610e0f61266f565b6005811115610e2057610e2061266f565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a083015260039092015490911660c0909101529392505050565b610e8a6115b6565b6001600160a01b038116610eb357604051631e4fbdf760e01b81525f600482015260240161043d565b610ebc81611611565b50565b604080515f6020820152600160e11b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b5f610f176124ce565b5f80516020612e2f8339815191525f80610f33610a02876111a5565b915091508015610f5a57604051632d07135360e01b8152811515600482015260240161043d565b5f828152600784016020526040808220815160e081019092528054829060ff166005811115610f8b57610f8b61266f565b6005811115610f9c57610f9c61266f565b81526001820154602082015260028201546001600160401b038082166040840152600160401b820481166060840152600160801b820481166080840152600160c01b909104811660a08301526003928301541660c0909101529091508151600581111561100b5761100b61266f565b1415801561102c57506001815160058111156110295761102961266f565b14155b1561104d57805160405163170cc93360e21b815261043d919060040161272e565b6003815160058111156110625761106261266f565b036110705760048152611075565b600581525b6020808201515f908152600886018252604080822082905585825260078701909252208151815483929190829060ff191660018360058111156110ba576110ba61266f565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790558051600581111561116e5761116e61266f565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa158015611209573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526112309190810190612a6c565b915091508061125257604051636b2f19e960e01b815260040160405180910390fd5b815115611278578151604051636ba589a560e01b8152600481019190915260240161043d565b60208201516001600160a01b0316156112b4576020820151604051624de75d60e31b81526001600160a01b03909116600482015260240161043d565b5092915050565b5f81516026146112de57604051638d0242c960e01b815260040160405180910390fd5b5f805b600281101561132d576112f5816001612b3e565b611300906008612b51565b61ffff16848281518110611316576113166127ec565b016020015160f81c901b91909117906001016112e1565b5061ffff8116156113515760405163059510e360e31b815260040160405180910390fd5b5f805b60048110156113ac57611368816003612b3e565b611373906008612b51565b63ffffffff168561138583600261296c565b81518110611395576113956127ec565b016020015160f81c901b9190911790600101611354565b5063ffffffff8116156113d257604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015611427576113e981601f612b3e565b6113f4906008612b51565b8661140083600661296c565b81518110611410576114106127ec565b016020015160f81c901b91909117906001016113d5565b50949350505050565b60605f82356020840135601461144b8686016040880161270c565b61145860608801886127a7565b6040516114b1969594939250602001948552602085019390935260e091821b6001600160e01b0319908116604086015260609190911b6bffffffffffffffffffffffff1916604485015291901b166058820152605c0190565b60405160208183030381529060405290505f5b6114d160608501856127a7565b90508110156112b457816114e860608601866127a7565b838181106114f8576114f86127ec565b905060200281019061150a9190612800565b3561151860608701876127a7565b84818110611528576115286127ec565b905060200281019061153a9190612800565b61154b906040810190602001612b68565b61155860608801886127a7565b85818110611568576115686127ec565b905060200281019061157a9190612800565b611588906040810190612b81565b60405160200161159c959493929190612bc3565b60408051601f1981840301815291905291506001016114c4565b336115e87f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146109b35760405163118cdaa760e01b815233600482015260240161043d565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff166116c557604051637fab81e560e01b815260040160405180910390fd5b5f80516020612e2f833981519152426116e46040860160208701612b68565b6001600160401b031611158061171e57506117026202a3004261296c565b6117126040860160208701612b68565b6001600160401b031610155b15611758576117336040850160208601612b68565b604051635879da1360e11b81526001600160401b03909116600482015260240161043d565b60306117676040860186612b81565b9050146117995761177b6040850185612b81565b6040516326475b2f60e11b815261043d925060040190815260200190565b83356117bb5760405163099e922360e21b81528435600482015260240161043d565b83355f908152600882016020526040902054156117ee57604051631ec583cb60e11b81528435600482015260240161043d565b6117f8835f611ec3565b5f806118916040518060a00160405280855f01548152602001885f01358152602001876001600160401b0316815260200188602001602081019061183c9190612b68565b6001600160401b0316815260200161185760408a018a612b81565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505091525061209d565b5f828152600686016020526040902091935091506118af8282612c53565b5085355f9081526008840160205260408082208490555163ee5b48eb60e01b81526005600160991b019063ee5b48eb906118ed90859060040161275e565b6020604051808303815f875af1158015611909573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061192d9190612790565b6040805160e08101909152909150806001815288356020808301919091526001600160401b03891660408084018290525f60608501819052608085019290925260a0840182905260c0909301819052868152600788019091522081518154829060ff191660018360058111156119a5576119a561266f565b021790555060208281015160018301556040808401516002840180546060870151608088015160a08901516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909401516003909301805467ffffffffffffffff19169390941692909217909255829189359186917f79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e918b91611a85918e01908e01612b68565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b611abb6124ce565b5f8281525f80516020612e4f8339815191526020526040808220815160e0810190925280545f80516020612e2f83398151915293929190829060ff166005811115611b0857611b0861266f565b6005811115611b1957611b1961266f565b8152600182015460208201526002808301546001600160401b038082166040850152600160401b820481166060850152600160801b820481166080850152600160c01b909104811660a084015260039093015490921660c09091015290915081516005811115611b8b57611b8b61266f565b14611bbe575f8481526007830160205260409081902054905163170cc93360e21b815261043d9160ff169060040161272e565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff19166001836005811115611c0257611c0261266f565b02179055506020820151600182015560408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f611cae8582612160565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b5f808251602714611d2957604051638d0242c960e01b815260040160405180910390fd5b5f805b6002811015611d7857611d40816001612b3e565b611d4b906008612b51565b61ffff16858281518110611d6157611d616127ec565b016020015160f81c901b9190911790600101611d2c565b5061ffff811615611d9c5760405163059510e360e31b815260040160405180910390fd5b5f805b6004811015611df757611db3816003612b3e565b611dbe906008612b51565b63ffffffff1686611dd083600261296c565b81518110611de057611de06127ec565b016020015160f81c901b9190911790600101611d9f565b5063ffffffff8116600314611e1f57604051635b60892f60e01b815260040160405180910390fd5b5f805b6020811015611e7457611e3681601f612b3e565b611e41906008612b51565b87611e4d83600661296c565b81518110611e5d57611e5d6127ec565b016020015160f81c901b9190911790600101611e22565b505f86602681518110611e8957611e896127ec565b016020015191976001600160f81b03199092161515965090945050505050565b611eb16122b7565b611eba82612300565b6109e281612319565b5f80516020612e2f8339815191525f6001600160401b038084169085161115611ef757611ef08385612d12565b9050611f04565b611f018484612d12565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b0316606082015242911580611f66575060018401548151611f62916001600160401b03169061296c565b8210155b15611f8c576001600160401b038316606082015281815260408101516020820152611fab565b8281606001818151611f9e9190612d32565b6001600160401b03169052505b6060810151611fbb906064612d52565b602082015160018601546001600160401b039290921691611fe69190600160401b900460ff16612b51565b101561201657606081015160405163dfae880160e01b81526001600160401b03909116600482015260240161043d565b856001600160401b031681604001818151612031919061296c565b9052506040810180516001600160401b0387169190612051908390612b3e565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f60608260800151516030146120c657604051638d0242c960e01b815260040160405180910390fd5b5f806001855f015186602001518760400151886080015189606001516040516020016120f89796959493929190612d7d565b60405160208183030381529060405290506002816040516121199190612947565b602060405180830381855afa158015612134573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906121579190612790565b94909350915050565b5f8281525f80516020612e4f833981519152602052604081206002015481905f80516020612e2f83398151915290600160801b90046001600160401b03166121a88582611ec3565b5f6121b28761232a565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6122028a858b610ebf565b6040518263ffffffff1660e01b815260040161221e919061275e565b6020604051808303815f875af115801561223a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061225e9190612790565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166109b357604051631afcd79f60e31b815260040160405180910390fd5b6123086122b7565b61231061239f565b610ebc816123a7565b6123216122b7565b610ebc8161248f565b5f8181525f80516020612e4f8339815191526020526040812060020180545f80516020612e2f833981519152919060089061237490600160401b90046001600160401b0316612df3565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b6109b36122b7565b6123af6122b7565b80355f80516020612e2f83398151915290815560146123d46060840160408501612e0e565b60ff1611806123f357506123ee6060830160408401612e0e565b60ff16155b15612427576124086060830160408401612e0e565b604051634a59bbff60e11b815260ff909116600482015260240161043d565b6124376060830160408401612e0e565b60018201805460ff92909216600160401b0260ff60401b199092169190911790556124686040830160208401612b68565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b610e8a6122b7565b5080546124a3906129a1565b5f825580601f106124b2575050565b601f0160209004905f5260205f2090810190610ebc919061250a565b6040805160e08101909152805f81525f6020820181905260408201819052606082018190526080820181905260a0820181905260c09091015290565b5b8082111561251e575f815560010161250b565b5090565b5f60208284031215612532575f80fd5b5035919050565b803563ffffffff8116811461254c575f80fd5b919050565b5f60208284031215612561575f80fd5b6109c882612539565b5f806040838503121561257b575f80fd5b82356001600160401b03811115612590575f80fd5b8301608081860312156125a1575f80fd5b91506125af60208401612539565b90509250929050565b5f606082840312156125c8575f80fd5b50919050565b80356001600160401b038116811461254c575f80fd5b5f80604083850312156125f5575f80fd5b82356001600160401b0381111561260a575f80fd5b612616858286016125b8565b9250506125af602084016125ce565b6001600160a01b0381168114610ebc575f80fd5b5f806080838503121561264a575f80fd5b61265484846125b8565b9150606083013561266481612625565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b6006811061269f57634e487b7160e01b5f52602160045260245ffd5b9052565b5f60e0820190506126b5828451612683565b6020830151602083015260408301516001600160401b0380821660408501528060608601511660608501528060808601511660808501528060a08601511660a08501528060c08601511660c0850152505092915050565b5f6020828403121561271c575f80fd5b813561272781612625565b9392505050565b602081016109cb8284612683565b5f5b8381101561275657818101518382015260200161273e565b50505f910152565b602081525f825180602084015261277c81604085016020870161273c565b601f01601f19169190910160400192915050565b5f602082840312156127a0575f80fd5b5051919050565b5f808335601e198436030181126127bc575f80fd5b8301803591506001600160401b038211156127d5575f80fd5b6020019150600581901b36038213156122b0575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112612814575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b03811182821017156128545761285461281e565b60405290565b604051601f8201601f191681016001600160401b03811182821017156128825761288261281e565b604052919050565b5f6001600160401b038211156128a2576128a261281e565b50601f01601f191660200190565b5f606082360312156128c0575f80fd5b6128c8612832565b8235815260206128d98185016125ce565b8183015260408401356001600160401b038111156128f5575f80fd5b840136601f820112612905575f80fd5b80356129186129138261288a565b61285a565b818152368483850101111561292b575f80fd5b81848401858301375f9181019093015250604082015292915050565b5f825161281481846020870161273c565b634e487b7160e01b5f52601160045260245ffd5b808201808211156109cb576109cb612958565b5f63ffffffff80831681810361299757612997612958565b6001019392505050565b600181811c908216806129b557607f821691505b6020821081036125c857634e487b7160e01b5f52602260045260245ffd5b5f60208083525f84546129e5816129a1565b806020870152604060018084165f8114612a065760018114612a2257612a4f565b60ff19851660408a0152604084151560051b8a01019550612a4f565b895f5260205f205f5b85811015612a465781548b8201860152908301908801612a2b565b8a016040019650505b509398975050505050505050565b8051801515811461254c575f80fd5b5f8060408385031215612a7d575f80fd5b82516001600160401b0380821115612a93575f80fd5b9084019060608287031215612aa6575f80fd5b612aae612832565b82518152602080840151612ac181612625565b82820152604084015183811115612ad6575f80fd5b80850194505087601f850112612aea575f80fd5b83519250612afa6129138461288a565b8381528882858701011115612b0d575f80fd5b612b1c8483830184880161273c565b80604084015250819550612b31818801612a5d565b9450505050509250929050565b818103818111156109cb576109cb612958565b80820281158282048414176109cb576109cb612958565b5f60208284031215612b78575f80fd5b6109c8826125ce565b5f808335601e19843603018112612b96575f80fd5b8301803591506001600160401b03821115612baf575f80fd5b6020019150368190038213156122b0575f80fd5b5f8651612bd4818460208b0161273c565b820186815260c086901b6001600160c01b0319166020820152838560288301375f9301602801928352509095945050505050565b601f8211156104d657805f5260205f20601f840160051c81016020851015612c2d5750805b601f840160051c820191505b81811015612c4c575f8155600101612c39565b5050505050565b81516001600160401b03811115612c6c57612c6c61281e565b612c8081612c7a84546129a1565b84612c08565b602080601f831160018114612cb3575f8415612c9c5750858301515b5f19600386901b1c1916600185901b178555612d0a565b5f85815260208120601f198616915b82811015612ce157888601518255948401946001909101908401612cc2565b5085821015612cfe57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b6001600160401b038281168282160390808211156112b4576112b4612958565b6001600160401b038181168382160190808211156112b4576112b4612958565b6001600160401b03818116838216028082169190828114612d7557612d75612958565b505092915050565b61ffff60f01b8860f01b16815263ffffffff60e01b8760e01b1660028201528560068201528460268201525f6001600160401b0360c01b808660c01b1660468401528451612dd281604e86016020890161273c565b60c09490941b1691909201604e810191909152605601979650505050505050565b5f6001600160401b0380831681810361299757612997612958565b5f60208284031215612e1e575f80fd5b813560ff81168114612727575f80fdfee92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"init\",\"type\":\"uint8\",\"internalType\":\"enumICMInitializable\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ADDRESS_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"BLS_PUBLIC_KEY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_CHURN_PERCENTAGE_LIMIT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAXIMUM_REGISTRATION_EXPIRY_LENGTH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"P_CHAIN_BLOCKCHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"VALIDATOR_MANAGER_STORAGE_LOCATION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"WARP_MESSENGER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIWarpMessenger\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"completeEndValidation\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeValidatorRegistration\",\"inputs\":[{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValidator\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structValidator\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"startingWeight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"messageNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"startedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"endedAt\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getWeight\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"settings\",\"type\":\"tuple\",\"internalType\":\"structValidatorManagerSettings\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"churnPeriodSeconds\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeEndValidation\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorRegistration\",\"inputs\":[{\"name\":\"registrationInput\",\"type\":\"tuple\",\"internalType\":\"structValidatorRegistrationInput\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"remainingBalanceOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]},{\"name\":\"disableOwner\",\"type\":\"tuple\",\"internalType\":\"structPChainOwner\",\"components\":[{\"name\":\"threshold\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"addresses\",\"type\":\"address[]\",\"internalType\":\"address[]\"}]}]},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"initializeValidatorSet\",\"inputs\":[{\"name\":\"subnetConversionData\",\"type\":\"tuple\",\"internalType\":\"structSubnetConversionData\",\"components\":[{\"name\":\"subnetID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerBlockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initialValidators\",\"type\":\"tuple[]\",\"internalType\":\"structInitialValidator[]\",\"components\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"blsPublicKey\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]}]},{\"name\":\"messageIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"registeredValidators\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendEndValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"resendRegisterValidatorMessage\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"InitialValidatorCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodCreated\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nodeID\",\"type\":\"bytes\",\"indexed\":true,\"internalType\":\"bytes\"},{\"name\":\"registerValidationMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodEnded\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"status\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumValidatorStatus\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidationPeriodRegistered\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorRemovalInitialized\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"weight\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"endTime\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValidatorWeightUpdate\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"nonce\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"validatorWeight\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"},{\"name\":\"setWeightMessageID\",\"type\":\"bytes32\",\"indexed\":false,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"InvalidBLSKeyLength\",\"inputs\":[{\"name\":\"length\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidBLSPublicKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCodecID\",\"inputs\":[{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitializationStatus\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMaximumChurnPercentage\",\"inputs\":[{\"name\":\"maximumChurnPercentage\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageLength\",\"inputs\":[{\"name\":\"actual\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"expected\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"type\":\"error\",\"name\":\"InvalidMessageType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidNodeID\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"InvalidPChainOwnerThreshold\",\"inputs\":[{\"name\":\"threshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"addressesLength\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"InvalidRegistrationExpiry\",\"inputs\":[{\"name\":\"registrationExpiry\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"InvalidSubnetConversionID\",\"inputs\":[{\"name\":\"encodedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"expectedSubnetConversionID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidationID\",\"inputs\":[{\"name\":\"validationID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerAddress\",\"inputs\":[{\"name\":\"validatorManagerAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorManagerBlockchainID\",\"inputs\":[{\"name\":\"blockchainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"InvalidValidatorStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumValidatorStatus\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpMessage\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidWarpOriginSenderAddress\",\"inputs\":[{\"name\":\"senderAddress\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"InvalidWarpSourceChainID\",\"inputs\":[{\"name\":\"sourceChainID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"MaxChurnRateExceeded\",\"inputs\":[{\"name\":\"churnAmount\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"type\":\"error\",\"name\":\"NodeAlreadyRegistered\",\"inputs\":[{\"name\":\"nodeID\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"PChainOwnerAddressesNotSorted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UnexpectedRegistrationStatus\",\"inputs\":[{\"name\":\"validRegistration\",\"type\":\"bool\",\"internalType\":\"bool\"}]}]", + Bin: "0x608060405234801561000f575f80fd5b506040516139d53803806139d583398101604081905261002e91610107565b60018160018111156100425761004261012c565b0361004f5761004f610055565b50610140565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff16156100a55760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146101045780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b5f60208284031215610117575f80fd5b815160028110610125575f80fd5b9392505050565b634e487b7160e01b5f52602160045260245ffd5b6138888061014d5f395ff3fe608060405234801561000f575f80fd5b5060043610610132575f3560e01c80639ba96b86116100b4578063c974d1b611610079578063c974d1b6146102a7578063d588c18f146102af578063d5f20ff6146102c2578063df93d8de146102e2578063f2fde38b146102ec578063fd7ac5e7146102ff575f80fd5b80639ba96b861461024c578063a3a65e481461025f578063b771b3bc14610272578063bc5fbfec14610280578063bee0a03f14610294575f80fd5b8063715018a6116100fa578063715018a6146101be578063732214f8146101c65780638280a25a146101db5780638da5cb5b146101f557806397fb70d414610239575f80fd5b80630322ed981461013657806320d91b7a1461014b578063467ef06f1461015e57806360305d621461017157806366435abf14610193575b5f80fd5b610149610144366004612c30565b610312565b005b610149610159366004612c5f565b610529565b61014961016c366004612cad565b610a15565b610179601481565b60405163ffffffff90911681526020015b60405180910390f35b6101a66101a1366004612c30565b610a23565b6040516001600160401b03909116815260200161018a565b610149610a37565b6101cd5f81565b60405190815260200161018a565b6101e3603081565b60405160ff909116815260200161018a565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03165b6040516001600160a01b03909116815260200161018a565b610149610247366004612c30565b610a4a565b6101cd61025a366004612cdc565b610a5f565b61014961026d366004612cad565b610a7b565b6102216005600160991b0181565b6101cd5f8051602061383c83398151915281565b6101496102a2366004612c30565b610c04565b6101e3601481565b6101496102bd366004612d35565b610d41565b6102d56102d0366004612c30565b610e4f565b60405161018a9190612df2565b6101a66202a30081565b6101496102fa366004612e72565b610f9e565b6101cd61030d366004612e94565b610fdb565b5f8181525f8051602061385c8339815191526020526040808220815160e0810190925280545f8051602061383c83398151915293929190829060ff16600581111561035f5761035f612d71565b600581111561037057610370612d71565b815260200160018201805461038490612eff565b80601f01602080910402602001604051908101604052809291908181526020018280546103b090612eff565b80156103fb5780601f106103d2576101008083540402835291602001916103fb565b820191905f5260205f20905b8154815290600101906020018083116103de57829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a0909101529091508151600581111561046657610466612d71565b146104a2575f8381526007830160205260409081902054905163170cc93360e21b81526104999160ff1690600401612f37565b60405180910390fd5b6005600160991b016001600160a01b031663ee5b48eb6104c78584606001515f611036565b6040518263ffffffff1660e01b81526004016104e39190612f45565b6020604051808303815f875af11580156104ff573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105239190612f57565b50505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f8051602061383c8339815191529060ff161561057b57604051637fab81e560e01b815260040160405180910390fd5b6005600160991b016001600160a01b0316634213cf786040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105be573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105e29190612f57565b83602001351461060b576040516372b0a7e760e11b815260208401356004820152602401610499565b3061061c6060850160408601612e72565b6001600160a01b03161461065f5761063a6060840160408501612e72565b604051632f88120d60e21b81526001600160a01b039091166004820152602401610499565b5f61066d6060850185612f6e565b905090505f805b828163ffffffff161015610955575f6106906060880188612f6e565b8363ffffffff168181106106a6576106a6612fb3565b90506020028101906106b89190612fc7565b6106c1906130eb565b80516040519192505f9160088801916106d991613164565b9081526020016040518091039020541461070957805160405163a41f772f60e01b81526104999190600401612f45565b5f6002885f01358460405160200161073892919091825260e01b6001600160e01b031916602082015260240190565b60408051601f198184030181529082905261075291613164565b602060405180830381855afa15801561076d573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906107909190612f57565b90508086600801835f01516040516107a89190613164565b90815260408051602092819003830181209390935560e0830181526002835284518284015284810180516001600160401b03908116858401525f60608601819052915181166080860152421660a085015260c0840181905284815260078a01909252902081518154829060ff1916600183600581111561082a5761082a612d71565b02179055506020820151600182019061084390826131c0565b506040828101516002830180546060860151608087015160a08801516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909301516003909201805467ffffffffffffffff1916928416929092179091558301516108e8911685613293565b82516040519195506108f991613164565b60408051918290038220908401516001600160401b031682529082907f9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf9060200160405180910390a350508061094e906132a6565b9050610674565b50600483018190555f61097361096a86611085565b6040015161119b565b90505f61097f87611328565b90505f6002826040516109929190613164565b602060405180830381855afa1580156109ad573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906109d09190612f57565b90508281146109fc57604051631872fc8d60e01b81526004810182905260248101849052604401610499565b5050506009909201805460ff1916600117905550505050565b610a1e81611502565b505050565b5f610a2d82610e4f565b6080015192915050565b610a3f611840565b610a485f61189b565b565b610a52611840565b610a5b8161190b565b5050565b5f610a68611840565b610a728383611bef565b90505b92915050565b5f8051602061383c8339815191525f80610aa0610a9785611085565b60400151612167565b9150915080610ac657604051632d07135360e01b81528115156004820152602401610499565b5f82815260068401602052604090208054610ae090612eff565b90505f03610b045760405163089938b360e11b815260048101839052602401610499565b60015f83815260078501602052604090205460ff166005811115610b2a57610b2a612d71565b14610b5d575f8281526007840160205260409081902054905163170cc93360e21b81526104999160ff1690600401612f37565b5f8281526006840160205260408120610b7591612ba4565b5f828152600784016020908152604091829020805460ff1916600290811782550180546001600160401b0342818116600160c01b026001600160c01b0390931692909217928390558451600160801b9093041682529181019190915283917ff8fd1c90fb9cfa2ca2358fdf5806b086ad43315d92b221c929efc7f105ce7568910160405180910390a250505050565b5f8181527fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb066020526040902080545f8051602061383c8339815191529190610c4b90612eff565b90505f03610c6f5760405163089938b360e11b815260048101839052602401610499565b60015f83815260078301602052604090205460ff166005811115610c9557610c95612d71565b14610cc8575f8281526007820160205260409081902054905163170cc93360e21b81526104999160ff1690600401612f37565b5f82815260068201602052604090819020905163ee5b48eb60e01b81526005600160991b019163ee5b48eb91610d0191906004016132c8565b6020604051808303815f875af1158015610d1d573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a1e9190612f57565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03165f81158015610d855750825b90505f826001600160401b03166001148015610da05750303b155b905081158015610dae575080155b15610dcc5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610df657845460ff60401b1916600160401b1785555b610e008787612323565b8315610e4657845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b610e57612bdb565b5f8281525f8051602061385c833981519152602052604090819020815160e0810190925280545f8051602061383c833981519152929190829060ff166005811115610ea457610ea4612d71565b6005811115610eb557610eb5612d71565b8152602001600182018054610ec990612eff565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef590612eff565b8015610f405780601f10610f1757610100808354040283529160200191610f40565b820191905f5260205f20905b815481529060010190602001808311610f2357829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b9091048116608083015260039092015490911660a0909101529392505050565b610fa6611840565b6001600160a01b038116610fcf57604051631e4fbdf760e01b81525f6004820152602401610499565b610fd88161189b565b50565b6040515f905f8051602061383c833981519152907fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb089061101e9086908690613352565b90815260200160405180910390205491505092915050565b604080515f6020820152600360e01b602282015260268101949094526001600160c01b031960c093841b811660468601529190921b16604e830152805180830360360181526056909201905290565b60408051606080820183525f8083526020830152918101919091526040516306f8253560e41b815263ffffffff831660048201525f9081906005600160991b0190636f825350906024015f60405180830381865afa1580156110e9573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111109190810190613370565b915091508061113257604051636b2f19e960e01b815260040160405180910390fd5b815115611158578151604051636ba589a560e01b81526004810191909152602401610499565b60208201516001600160a01b031615611194576020820151604051624de75d60e31b81526001600160a01b039091166004820152602401610499565b5092915050565b5f81516026146111d057815160405163cc92daa160e01b815263ffffffff909116600482015260266024820152604401610499565b5f805b600281101561121f576111e7816001613442565b6111f2906008613455565b61ffff1684828151811061120857611208612fb3565b016020015160f81c901b91909117906001016111d3565b5061ffff8116156112495760405163407b587360e01b815261ffff82166004820152602401610499565b5f805b60048110156112a457611260816003613442565b61126b906008613455565b63ffffffff168561127d836002613293565b8151811061128d5761128d612fb3565b016020015160f81c901b919091179060010161124c565b5063ffffffff8116156112ca57604051635b60892f60e01b815260040160405180910390fd5b5f805b602081101561131f576112e181601f613442565b6112ec906008613455565b866112f8836006613293565b8151811061130857611308612fb3565b016020015160f81c901b91909117906001016112cd565b50949350505050565b60605f8083356020850135601461134487870160408901612e72565b6113516060890189612f6e565b60405160f09790971b6001600160f01b0319166020880152602287019590955250604285019290925260e090811b6001600160e01b0319908116606286015260609290921b6bffffffffffffffffffffffff191660668501529190911b16607a820152607e0160405160208183030381529060405290505f5b6113d76060850185612f6e565b905081101561119457816113ee6060860186612f6e565b838181106113fe576113fe612fb3565b90506020028101906114109190612fc7565b61141a908061346c565b90506114296060870187612f6e565b8481811061143957611439612fb3565b905060200281019061144b9190612fc7565b611455908061346c565b6114626060890189612f6e565b8681811061147257611472612fb3565b90506020028101906114849190612fc7565b61149290602081019061346c565b61149f60608b018b612f6e565b888181106114af576114af612fb3565b90506020028101906114c19190612fc7565b6114d29060608101906040016134ae565b6040516020016114e897969594939291906134c7565b60408051601f1981840301815291905291506001016113ca565b5f61150b612bdb565b5f8051602061383c8339815191525f80611527610a9787611085565b91509150801561154e57604051632d07135360e01b81528115156004820152602401610499565b5f828152600784016020526040808220815160e081019092528054829060ff16600581111561157f5761157f612d71565b600581111561159057611590612d71565b81526020016001820180546115a490612eff565b80601f01602080910402602001604051908101604052809291908181526020018280546115d090612eff565b801561161b5780601f106115f25761010080835404028352916020019161161b565b820191905f5260205f20905b8154815290600101906020018083116115fe57829003601f168201915b505050918352505060028201546001600160401b038082166020840152600160401b820481166040840152600160801b820481166060840152600160c01b909104811660808301526003928301541660a0909101529091508151600581111561168657611686612d71565b141580156116a757506001815160058111156116a4576116a4612d71565b14155b156116c857805160405163170cc93360e21b81526104999190600401612f37565b6003815160058111156116dd576116dd612d71565b036116eb57600481526116f0565b600581525b8360080181602001516040516117069190613164565b90815260408051602092819003830190205f908190558581526007870190925290208151815483929190829060ff1916600183600581111561174a5761174a612d71565b02179055506020820151600182019061176390826131c0565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790558051600581111561180957611809612d71565b60405184907f1c08e59656f1a18dc2da76826cdc52805c43e897a17c50faefb8ab3c1526cc16905f90a39196919550909350505050565b336118727f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b031614610a485760405163118cdaa760e01b8152336004820152602401610499565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b611913612bdb565b5f8281525f8051602061385c8339815191526020526040808220815160e0810190925280545f8051602061383c83398151915293929190829060ff16600581111561196057611960612d71565b600581111561197157611971612d71565b815260200160018201805461198590612eff565b80601f01602080910402602001604051908101604052809291908181526020018280546119b190612eff565b80156119fc5780601f106119d3576101008083540402835291602001916119fc565b820191905f5260205f20905b8154815290600101906020018083116119df57829003601f168201915b50505091835250506002828101546001600160401b038082166020850152600160401b820481166040850152600160801b820481166060850152600160c01b9091048116608084015260039093015490921660a09091015290915081516005811115611a6a57611a6a612d71565b14611a9d575f8481526007830160205260409081902054905163170cc93360e21b81526104999160ff1690600401612f37565b60038152426001600160401b031660c08201525f84815260078301602052604090208151815483929190829060ff19166001836005811115611ae157611ae1612d71565b021790555060208201516001820190611afa90826131c0565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff1916919092161790555f611b98858261233d565b6080840151604080516001600160401b03909216825242602083015291935083925087917f13d58394cf269d48bcf927959a29a5ffee7c9924dafff8927ecdf3c48ffa7c67910160405180910390a3509392505050565b7fe92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb09545f9060ff16611c3357604051637fab81e560e01b815260040160405180910390fd5b5f8051602061383c83398151915242611c5260608601604087016134ae565b6001600160401b0316111580611c8c5750611c706202a30042613293565b611c8060608601604087016134ae565b6001600160401b031610155b15611cc657611ca160608501604086016134ae565b604051635879da1360e11b81526001600160401b039091166004820152602401610499565b611cdb611cd66060860186613530565b612494565b611ceb611cd66080860186613530565b6030611cfa602086018661346c565b905014611d2c57611d0e602085018561346c565b6040516326475b2f60e11b8152610499925060040190815260200190565b611d36848061346c565b90505f03611d6357611d48848061346c565b604051633e08a12560e11b8152600401610499929190613544565b5f60088201611d72868061346c565b604051611d80929190613352565b90815260200160405180910390205414611db957611d9e848061346c565b60405163a41f772f60e01b8152600401610499929190613544565b611dc3835f6125fd565b6040805160e08101909152815481525f908190611ecf9060208101611de8898061346c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250602090810190611e30908a018a61346c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f92019190915250505090825250602001611e7960608a0160408b016134ae565b6001600160401b03168152602001611e9460608a018a613530565b611e9d90613572565b8152602001611eaf60808a018a613530565b611eb890613572565b8152602001876001600160401b03168152506127d7565b5f82815260068601602052604090209193509150611eed82826131c0565b508160088401611efd888061346c565b604051611f0b929190613352565b9081526040519081900360200181209190915563ee5b48eb60e01b81525f906005600160991b019063ee5b48eb90611f47908590600401612f45565b6020604051808303815f875af1158015611f63573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f879190612f57565b6040805160e081019091529091508060018152602001611fa7898061346c565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201829052509385525050506001600160401b0389166020808401829052604080850184905260608501929092526080840183905260a0909301829052868252600788019092522081518154829060ff1916600183600581111561203657612036612d71565b02179055506020820151600182019061204f90826131c0565b5060408201516002820180546060850151608086015160a08701516001600160401b039586166001600160801b031990941693909317600160401b92861692909202919091176001600160801b0316600160801b918516919091026001600160c01b031617600160c01b9184169190910217905560c0909201516003909101805467ffffffffffffffff191691909216179055806120ed888061346c565b6040516120fb929190613352565b6040518091039020847fb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430898b604001602081019061213991906134ae565b604080516001600160401b0393841681529290911660208301520160405180910390a4509095945050505050565b5f80825160271461219d57825160405163cc92daa160e01b815263ffffffff909116600482015260276024820152604401610499565b5f805b60028110156121ec576121b4816001613442565b6121bf906008613455565b61ffff168582815181106121d5576121d5612fb3565b016020015160f81c901b91909117906001016121a0565b5061ffff8116156122165760405163407b587360e01b815261ffff82166004820152602401610499565b5f805b60048110156122715761222d816003613442565b612238906008613455565b63ffffffff168661224a836002613293565b8151811061225a5761225a612fb3565b016020015160f81c901b9190911790600101612219565b5063ffffffff811660021461229957604051635b60892f60e01b815260040160405180910390fd5b5f805b60208110156122ee576122b081601f613442565b6122bb906008613455565b876122c7836006613293565b815181106122d7576122d7612fb3565b016020015160f81c901b919091179060010161229c565b505f8660268151811061230357612303612fb3565b016020015191976001600160f81b03199092161515965090945050505050565b61232b6129c4565b61233482612a0d565b610a5b81612a26565b5f8281525f8051602061385c833981519152602052604081206002015481905f8051602061383c83398151915290600160801b90046001600160401b031661238585826125fd565b5f61238f87612a37565b5f8881526007850160205260408120600201805467ffffffffffffffff60801b1916600160801b6001600160401b038b16021790559091506005600160991b0163ee5b48eb6123df8a858b611036565b6040518263ffffffff1660e01b81526004016123fb9190612f45565b6020604051808303815f875af1158015612417573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061243b9190612f57565b604080516001600160401b038a811682526020820184905282519394508516928b927f07de5ff35a674a8005e661f3333c907ca6333462808762d19dc7b3abb1a8c1df928290030190a3909450925050505b9250929050565b6124a16020820182612cad565b63ffffffff161580156124c157506124bc6020820182612f6e565b151590505b15612508576124d36020820182612cad565b6124e06020830183612f6e565b60405163c08a0f1d60e01b815263ffffffff9093166004840152602483015250604401610499565b6125156020820182612f6e565b90506125246020830183612cad565b63ffffffff16111561253d576124d36020820182612cad565b60015b61254d6020830183612f6e565b9050811015610a5b576125636020830183612f6e565b61256e600184613442565b81811061257d5761257d612fb3565b90506020020160208101906125929190612e72565b6001600160a01b03166125a86020840184612f6e565b838181106125b8576125b8612fb3565b90506020020160208101906125cd9190612e72565b6001600160a01b031610156125f557604051630dbc8d5f60e31b815260040160405180910390fd5b600101612540565b5f8051602061383c8339815191525f6001600160401b0380841690851611156126315761262a8385613639565b905061263e565b61263b8484613639565b90505b6040805160808101825260028401548082526003850154602083015260048501549282019290925260058401546001600160401b03166060820152429115806126a057506001840154815161269c916001600160401b031690613293565b8210155b156126c6576001600160401b0383166060820152818152604081015160208201526126e5565b82816060018181516126d89190613659565b6001600160401b03169052505b60608101516126f5906064613679565b602082015160018601546001600160401b0392909216916127209190600160401b900460ff16613455565b101561275057606081015160405163dfae880160e01b81526001600160401b039091166004820152602401610499565b856001600160401b03168160400181815161276b9190613293565b9052506040810180516001600160401b038716919061278b908390613442565b905250805160028501556020810151600385015560408101516004850155606001516005909301805467ffffffffffffffff19166001600160401b039094169390931790925550505050565b5f60608260400151516030146128005760405163180ffa0d60e01b815260040160405180910390fd5b82516020808501518051604080880151606089015160808a01518051908701515193515f98612841988a9860019892979296909590949093909291016136a4565b60405160208183030381529060405290505f5b846080015160200151518110156128b35781856080015160200151828151811061288057612880612fb3565b602002602001015160405160200161289992919061375e565b60408051601f198184030181529190529150600101612854565b5060a08401518051602091820151516040516128d3938593929101613794565b60405160208183030381529060405290505f5b8460a00151602001515181101561294557818560a0015160200151828151811061291257612912612fb3565b602002602001015160405160200161292b92919061375e565b60408051601f1981840301815291905291506001016128e6565b5060c084015160405161295c9183916020016137cf565b604051602081830303815290604052905060028160405161297d9190613164565b602060405180830381855afa158015612998573d5f803e3d5ffd5b5050506040513d601f19601f820116820180604052508101906129bb9190612f57565b94909350915050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff16610a4857604051631afcd79f60e31b815260040160405180910390fd5b612a156129c4565b612a1d612aac565b610fd881612ab4565b612a2e6129c4565b610fd881612b9c565b5f8181525f8051602061385c8339815191526020526040812060020180545f8051602061383c8339815191529190600890612a8190600160401b90046001600160401b0316613800565b91906101000a8154816001600160401b0302191690836001600160401b031602179055915050919050565b610a486129c4565b612abc6129c4565b80355f8051602061383c8339815191529081556014612ae1606084016040850161381b565b60ff161180612b005750612afb606083016040840161381b565b60ff16155b15612b3457612b15606083016040840161381b565b604051634a59bbff60e11b815260ff9091166004820152602401610499565b612b44606083016040840161381b565b60018201805460ff92909216600160401b0260ff60401b19909216919091179055612b7560408301602084016134ae565b600191909101805467ffffffffffffffff19166001600160401b0390921691909117905550565b610fa66129c4565b508054612bb090612eff565b5f825580601f10612bbf575050565b601f0160209004905f5260205f2090810190610fd89190612c18565b6040805160e08101909152805f81526060602082018190525f604083018190529082018190526080820181905260a0820181905260c09091015290565b5b80821115612c2c575f8155600101612c19565b5090565b5f60208284031215612c40575f80fd5b5035919050565b803563ffffffff81168114612c5a575f80fd5b919050565b5f8060408385031215612c70575f80fd5b82356001600160401b03811115612c85575f80fd5b830160808186031215612c96575f80fd5b9150612ca460208401612c47565b90509250929050565b5f60208284031215612cbd575f80fd5b610a7282612c47565b80356001600160401b0381168114612c5a575f80fd5b5f8060408385031215612ced575f80fd5b82356001600160401b03811115612d02575f80fd5b830160a08186031215612d13575f80fd5b9150612ca460208401612cc6565b6001600160a01b0381168114610fd8575f80fd5b5f808284036080811215612d47575f80fd5b6060811215612d54575f80fd5b508291506060830135612d6681612d21565b809150509250929050565b634e487b7160e01b5f52602160045260245ffd5b60068110612da157634e487b7160e01b5f52602160045260245ffd5b9052565b5f5b83811015612dbf578181015183820152602001612da7565b50505f910152565b5f8151808452612dde816020860160208601612da5565b601f01601f19169290920160200192915050565b60208152612e04602082018351612d85565b5f602083015160e06040840152612e1f610100840182612dc7565b905060408401516001600160401b0380821660608601528060608701511660808601528060808701511660a08601528060a08701511660c08601528060c08701511660e086015250508091505092915050565b5f60208284031215612e82575f80fd5b8135612e8d81612d21565b9392505050565b5f8060208385031215612ea5575f80fd5b82356001600160401b0380821115612ebb575f80fd5b818501915085601f830112612ece575f80fd5b813581811115612edc575f80fd5b866020828501011115612eed575f80fd5b60209290920196919550909350505050565b600181811c90821680612f1357607f821691505b602082108103612f3157634e487b7160e01b5f52602260045260245ffd5b50919050565b60208101610a758284612d85565b602081525f610a726020830184612dc7565b5f60208284031215612f67575f80fd5b5051919050565b5f808335601e19843603018112612f83575f80fd5b8301803591506001600160401b03821115612f9c575f80fd5b6020019150600581901b360382131561248d575f80fd5b634e487b7160e01b5f52603260045260245ffd5b5f8235605e19833603018112612fdb575f80fd5b9190910192915050565b634e487b7160e01b5f52604160045260245ffd5b604051606081016001600160401b038111828210171561301b5761301b612fe5565b60405290565b604080519081016001600160401b038111828210171561301b5761301b612fe5565b604051601f8201601f191681016001600160401b038111828210171561306b5761306b612fe5565b604052919050565b5f6001600160401b0382111561308b5761308b612fe5565b50601f01601f191660200190565b5f82601f8301126130a8575f80fd5b81356130bb6130b682613073565b613043565b8181528460208386010111156130cf575f80fd5b816020850160208301375f918101602001919091529392505050565b5f606082360312156130fb575f80fd5b613103612ff9565b82356001600160401b0380821115613119575f80fd5b61312536838701613099565b8352602085013591508082111561313a575f80fd5b5061314736828601613099565b60208301525061315960408401612cc6565b604082015292915050565b5f8251612fdb818460208701612da5565b601f821115610a1e57805f5260205f20601f840160051c8101602085101561319a5750805b601f840160051c820191505b818110156131b9575f81556001016131a6565b5050505050565b81516001600160401b038111156131d9576131d9612fe5565b6131ed816131e78454612eff565b84613175565b602080601f831160018114613220575f84156132095750858301515b5f19600386901b1c1916600185901b178555613277565b5f85815260208120601f198616915b8281101561324e5788860151825594840194600190910190840161322f565b508582101561326b57878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b80820180821115610a7557610a7561327f565b5f63ffffffff8083168181036132be576132be61327f565b6001019392505050565b5f60208083525f84546132da81612eff565b806020870152604060018084165f81146132fb576001811461331757613344565b60ff19851660408a0152604084151560051b8a01019550613344565b895f5260205f205f5b8581101561333b5781548b8201860152908301908801613320565b8a016040019650505b509398975050505050505050565b818382375f9101908152919050565b80518015158114612c5a575f80fd5b5f8060408385031215613381575f80fd5b82516001600160401b0380821115613397575f80fd5b90840190606082870312156133aa575f80fd5b6133b2612ff9565b825181526020808401516133c581612d21565b828201526040840151838111156133da575f80fd5b80850194505087601f8501126133ee575f80fd5b835192506133fe6130b684613073565b8381528882858701011115613411575f80fd5b61342084838301848801612da5565b80604084015250819550613435818801613361565b9450505050509250929050565b81810381811115610a7557610a7561327f565b8082028115828204841417610a7557610a7561327f565b5f808335601e19843603018112613481575f80fd5b8301803591506001600160401b0382111561349a575f80fd5b60200191503681900382131561248d575f80fd5b5f602082840312156134be575f80fd5b610a7282612cc6565b5f88516134d8818460208d01612da5565b60e089901b6001600160e01b031916908301908152868860048301378681019050600481015f8152858782375060c09390931b6001600160c01b0319166004939094019283019390935250600c019695505050505050565b5f8235603e19833603018112612fdb575f80fd5b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b5f60408236031215613582575f80fd5b61358a613021565b61359383612c47565b81526020808401356001600160401b03808211156135af575f80fd5b9085019036601f8301126135c1575f80fd5b8135818111156135d3576135d3612fe5565b8060051b91506135e4848301613043565b81815291830184019184810190368411156135fd575f80fd5b938501935b83851015613627578435925061361783612d21565b8282529385019390850190613602565b94860194909452509295945050505050565b6001600160401b038281168282160390808211156111945761119461327f565b6001600160401b038181168382160190808211156111945761119461327f565b6001600160401b0381811683821602808216919082811461369c5761369c61327f565b505092915050565b61ffff60f01b8a60f01b1681525f63ffffffff60e01b808b60e01b166002840152896006840152808960e01b1660268401525086516136ea81602a850160208b01612da5565b86519083019061370181602a840160208b01612da5565b60c087901b6001600160c01b031916602a9290910191820152613733603282018660e01b6001600160e01b0319169052565b61374c603682018560e01b6001600160e01b0319169052565b603a019b9a5050505050505050505050565b5f835161376f818460208801612da5565b60609390931b6bffffffffffffffffffffffff19169190920190815260140192915050565b5f84516137a5818460208901612da5565b6001600160e01b031960e095861b8116919093019081529290931b16600482015260080192915050565b5f83516137e0818460208801612da5565b60c09390931b6001600160c01b0319169190920190815260080192915050565b5f6001600160401b038083168181036132be576132be61327f565b5f6020828403121561382b575f80fd5b813560ff81168114612e8d575f80fdfee92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb00e92546d698950ddd38910d2e15ed1d923cd0a7b3dde9e2a6a3f380565559cb07a164736f6c6343000819000a", } // PoAValidatorManagerABI is the input ABI used to generate the binding from. @@ -461,7 +469,7 @@ func (_PoAValidatorManager *PoAValidatorManagerCallerSession) WARPMESSENGER() (c // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_PoAValidatorManager *PoAValidatorManagerCaller) GetValidator(opts *bind.CallOpts, validationID [32]byte) (Validator, error) { var out []interface{} err := _PoAValidatorManager.contract.Call(opts, &out, "getValidator", validationID) @@ -478,14 +486,14 @@ func (_PoAValidatorManager *PoAValidatorManagerCaller) GetValidator(opts *bind.C // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_PoAValidatorManager *PoAValidatorManagerSession) GetValidator(validationID [32]byte) (Validator, error) { return _PoAValidatorManager.Contract.GetValidator(&_PoAValidatorManager.CallOpts, validationID) } // GetValidator is a free data retrieval call binding the contract method 0xd5f20ff6. // -// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes32,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getValidator(bytes32 validationID) view returns((uint8,bytes,uint64,uint64,uint64,uint64,uint64)) func (_PoAValidatorManager *PoAValidatorManagerCallerSession) GetValidator(validationID [32]byte) (Validator, error) { return _PoAValidatorManager.Contract.GetValidator(&_PoAValidatorManager.CallOpts, validationID) } @@ -552,10 +560,10 @@ func (_PoAValidatorManager *PoAValidatorManagerCallerSession) Owner() (common.Ad return _PoAValidatorManager.Contract.Owner(&_PoAValidatorManager.CallOpts) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_PoAValidatorManager *PoAValidatorManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_PoAValidatorManager *PoAValidatorManagerCaller) RegisteredValidators(opts *bind.CallOpts, nodeID []byte) ([32]byte, error) { var out []interface{} err := _PoAValidatorManager.contract.Call(opts, &out, "registeredValidators", nodeID) @@ -569,17 +577,17 @@ func (_PoAValidatorManager *PoAValidatorManagerCaller) RegisteredValidators(opts } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_PoAValidatorManager *PoAValidatorManagerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_PoAValidatorManager *PoAValidatorManagerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _PoAValidatorManager.Contract.RegisteredValidators(&_PoAValidatorManager.CallOpts, nodeID) } -// RegisteredValidators is a free data retrieval call binding the contract method 0xe7d14c1c. +// RegisteredValidators is a free data retrieval call binding the contract method 0xfd7ac5e7. // -// Solidity: function registeredValidators(bytes32 nodeID) view returns(bytes32) -func (_PoAValidatorManager *PoAValidatorManagerCallerSession) RegisteredValidators(nodeID [32]byte) ([32]byte, error) { +// Solidity: function registeredValidators(bytes nodeID) view returns(bytes32) +func (_PoAValidatorManager *PoAValidatorManagerCallerSession) RegisteredValidators(nodeID []byte) ([32]byte, error) { return _PoAValidatorManager.Contract.RegisteredValidators(&_PoAValidatorManager.CallOpts, nodeID) } @@ -667,44 +675,44 @@ func (_PoAValidatorManager *PoAValidatorManagerTransactorSession) InitializeEndV return _PoAValidatorManager.Contract.InitializeEndValidation(&_PoAValidatorManager.TransactOpts, validationID) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x8994ab49. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x9ba96b86. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint64 weight) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint64 weight) returns(bytes32 validationID) func (_PoAValidatorManager *PoAValidatorManagerTransactor) InitializeValidatorRegistration(opts *bind.TransactOpts, registrationInput ValidatorRegistrationInput, weight uint64) (*types.Transaction, error) { return _PoAValidatorManager.contract.Transact(opts, "initializeValidatorRegistration", registrationInput, weight) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x8994ab49. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x9ba96b86. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint64 weight) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint64 weight) returns(bytes32 validationID) func (_PoAValidatorManager *PoAValidatorManagerSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, weight uint64) (*types.Transaction, error) { return _PoAValidatorManager.Contract.InitializeValidatorRegistration(&_PoAValidatorManager.TransactOpts, registrationInput, weight) } -// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x8994ab49. +// InitializeValidatorRegistration is a paid mutator transaction binding the contract method 0x9ba96b86. // -// Solidity: function initializeValidatorRegistration((bytes32,uint64,bytes) registrationInput, uint64 weight) returns(bytes32 validationID) +// Solidity: function initializeValidatorRegistration((bytes,bytes,uint64,(uint32,address[]),(uint32,address[])) registrationInput, uint64 weight) returns(bytes32 validationID) func (_PoAValidatorManager *PoAValidatorManagerTransactorSession) InitializeValidatorRegistration(registrationInput ValidatorRegistrationInput, weight uint64) (*types.Transaction, error) { return _PoAValidatorManager.Contract.InitializeValidatorRegistration(&_PoAValidatorManager.TransactOpts, registrationInput, weight) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_PoAValidatorManager *PoAValidatorManagerTransactor) InitializeValidatorSet(opts *bind.TransactOpts, subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _PoAValidatorManager.contract.Transact(opts, "initializeValidatorSet", subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_PoAValidatorManager *PoAValidatorManagerSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _PoAValidatorManager.Contract.InitializeValidatorSet(&_PoAValidatorManager.TransactOpts, subnetConversionData, messageIndex) } -// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x61e2f490. +// InitializeValidatorSet is a paid mutator transaction binding the contract method 0x20d91b7a. // -// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes32,uint64,bytes)[]) subnetConversionData, uint32 messageIndex) returns() +// Solidity: function initializeValidatorSet((bytes32,bytes32,address,(bytes,bytes,uint64)[]) subnetConversionData, uint32 messageIndex) returns() func (_PoAValidatorManager *PoAValidatorManagerTransactorSession) InitializeValidatorSet(subnetConversionData SubnetConversionData, messageIndex uint32) (*types.Transaction, error) { return _PoAValidatorManager.Contract.InitializeValidatorSet(&_PoAValidatorManager.TransactOpts, subnetConversionData, messageIndex) } @@ -863,15 +871,15 @@ func (it *PoAValidatorManagerInitialValidatorCreatedIterator) Close() error { // PoAValidatorManagerInitialValidatorCreated represents a InitialValidatorCreated event raised by the PoAValidatorManager contract. type PoAValidatorManagerInitialValidatorCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash Weight *big.Int Raw types.Log // Blockchain specific contextual infos } -// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// FilterInitialValidatorCreated is a free log retrieval operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte) (*PoAValidatorManagerInitialValidatorCreatedIterator, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterInitialValidatorCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte) (*PoAValidatorManagerInitialValidatorCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -889,10 +897,10 @@ func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterInitialValidatorC return &PoAValidatorManagerInitialValidatorCreatedIterator{contract: _PoAValidatorManager.contract, event: "InitialValidatorCreated", logs: logs, sub: sub}, nil } -// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// WatchInitialValidatorCreated is a free log subscription operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) -func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *PoAValidatorManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][32]byte) (event.Subscription, error) { +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) +func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchInitialValidatorCreated(opts *bind.WatchOpts, sink chan<- *PoAValidatorManagerInitialValidatorCreated, validationID [][32]byte, nodeID [][]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -935,9 +943,9 @@ func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchInitialValidatorCr }), nil } -// ParseInitialValidatorCreated is a log parse operation binding the contract event 0xb815f891730222788b3f8d66249b3a287ce680c3df13866fd9a4f37743ae1014. +// ParseInitialValidatorCreated is a log parse operation binding the contract event 0x9d47fef9da077661546e646d61830bfcbda90506c2e5eed38195e82c4eb1cbdf. // -// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight) +// Solidity: event InitialValidatorCreated(bytes32 indexed validationID, bytes indexed nodeID, uint256 weight) func (_PoAValidatorManager *PoAValidatorManagerFilterer) ParseInitialValidatorCreated(log types.Log) (*PoAValidatorManagerInitialValidatorCreated, error) { event := new(PoAValidatorManagerInitialValidatorCreated) if err := _PoAValidatorManager.contract.UnpackLog(event, "InitialValidatorCreated", log); err != nil { @@ -1304,17 +1312,17 @@ func (it *PoAValidatorManagerValidationPeriodCreatedIterator) Close() error { // PoAValidatorManagerValidationPeriodCreated represents a ValidationPeriodCreated event raised by the PoAValidatorManager contract. type PoAValidatorManagerValidationPeriodCreated struct { ValidationID [32]byte - NodeID [32]byte + NodeID common.Hash RegisterValidationMessageID [32]byte Weight *big.Int RegistrationExpiry uint64 Raw types.Log // Blockchain specific contextual infos } -// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// FilterValidationPeriodCreated is a free log retrieval operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (*PoAValidatorManagerValidationPeriodCreatedIterator, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterValidationPeriodCreated(opts *bind.FilterOpts, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (*PoAValidatorManagerValidationPeriodCreatedIterator, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1336,10 +1344,10 @@ func (_PoAValidatorManager *PoAValidatorManagerFilterer) FilterValidationPeriodC return &PoAValidatorManagerValidationPeriodCreatedIterator{contract: _PoAValidatorManager.contract, event: "ValidationPeriodCreated", logs: logs, sub: sub}, nil } -// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// WatchValidationPeriodCreated is a free log subscription operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) -func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *PoAValidatorManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][32]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchValidationPeriodCreated(opts *bind.WatchOpts, sink chan<- *PoAValidatorManagerValidationPeriodCreated, validationID [][32]byte, nodeID [][]byte, registerValidationMessageID [][32]byte) (event.Subscription, error) { var validationIDRule []interface{} for _, validationIDItem := range validationID { @@ -1386,9 +1394,9 @@ func (_PoAValidatorManager *PoAValidatorManagerFilterer) WatchValidationPeriodCr }), nil } -// ParseValidationPeriodCreated is a log parse operation binding the contract event 0x79b81620b81daf2c08cd5bb3dbb79e75d2d7a87f52171fde5aadc8c47823026e. +// ParseValidationPeriodCreated is a log parse operation binding the contract event 0xb77297e3befc691bfc864a81e241f83e2ef722b6e7becaa2ecec250c6d52b430. // -// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes32 indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) +// Solidity: event ValidationPeriodCreated(bytes32 indexed validationID, bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry) func (_PoAValidatorManager *PoAValidatorManagerFilterer) ParseValidationPeriodCreated(log types.Log) (*PoAValidatorManagerValidationPeriodCreated, error) { event := new(PoAValidatorManagerValidationPeriodCreated) if err := _PoAValidatorManager.contract.UnpackLog(event, "ValidationPeriodCreated", log); err != nil { diff --git a/contracts/validator-manager/MessageSpec.md b/contracts/validator-manager/MessageSpec.md index 62a063b92..f4b44d2ed 100644 --- a/contracts/validator-manager/MessageSpec.md +++ b/contracts/validator-manager/MessageSpec.md @@ -1,45 +1,115 @@ ## Warp Message Format Reference +### `SubnetConversionMessage` + +- Description: Confirms conversion to a Permissionless Subnet on the P-Chain + +- Signed by: P-Chain + +- Consumed by: Validator Manager contract + +Specification: + +``` +SubnetConversionMessage ++--------------------+----------+----------+ +| codecID : uint16 | 2 bytes | ++--------------------+----------+----------+ +| typeID : uint32 | 4 bytes | ++--------------------+----------+----------+ +| subnetConversionID : [32]byte | 32 bytes | ++--------------------+----------+----------+ + | 38 bytes | + +----------+ +``` + +where `subnetConversionID` is defined as the `sha256` hash of the serialization of the `SubnetConversionData`, defined as follows: + +``` +ValidatorData ++--------------+----------+------------------------+ +| nodeID : []byte | 4 + len(nodeID) bytes | ++--------------+----------+------------------------+ +| blsPublicKey : [48]byte | 48 bytes | ++--------------+----------+------------------------+ +| weight : uint64 | 8 bytes | ++--------------+----------+------------------------+ + | 60 + len(nodeID) bytes | + +------------------------+ + +SubnetConversionData ++----------------+-----------------+--------------------------------------------------------+ +| codecID : uint16 | 2 bytes | ++----------------+-----------------+--------------------------------------------------------+ +| subnetID : [32]byte | 32 bytes | ++----------------+-----------------+--------------------------------------------------------+ +| managerChainID : [32]byte | 32 bytes | ++----------------+-----------------+--------------------------------------------------------+ +| managerAddress : []byte | 4 + len(managerAddress) bytes | ++----------------+-----------------+--------------------------------------------------------+ +| validators : []ValidatorData | 4 + sum(validatorLengths) bytes | ++----------------+-----------------+--------------------------------------------------------+ + | 74 + len(managerAddress) + len(validatorLengths) bytes | + +--------------------------------------------------------+ +``` + ### `RegisterSubnetValidatorMessage` -Description: Register a Subnet Validator on the P-Chain +- Description: Registers a Subnet Validator on the P-Chain -Signed by: Subnet -Consumed by: P-Chain +- Signed by: Subnet + +- Consumed by: P-Chain Specification: ``` -+--------------+----------+-----------+ -| codecID : uint16 | 2 bytes | -+--------------+----------+-----------+ -| typeID : uint32 | 4 bytes | -+--------------+----------+-----------+ -| subnetID : [32]byte | 32 bytes | -+--------------+----------+-----------+ -| nodeID : [32]byte | 32 bytes | -+--------------+----------+-----------+ -| weight : uint64 | 8 bytes | -+--------------+----------+-----------+ -| blsPublicKey : [48]byte | 48 bytes | -+--------------+----------+-----------+ -| expiry : uint64 | 8 bytes | -+--------------+----------+-----------+ - | 134 bytes | - +-----------+ +PChainOwner ++-----------+------------+-------------------------------+ +| threshold : uint32 | 4 bytes | ++-----------+------------+-------------------------------+ +| addresses : [][20]byte | 4 + len(addresses) * 20 bytes | ++-----------+------------+-------------------------------+ + | 8 + len(addresses) * 20 bytes | + +-------------------------------+ + +RegisterSubnetValidatorMessage ++-----------------------+-------------+--------------------------------------------------------------------+ +| codecID : uint16 | 2 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| typeID : uint32 | 4 bytes | ++-----------------------+-------------+-------------------------------------------------------------------+ +| subnetID : [32]byte | 32 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| nodeID : []byte | 4 + len(nodeID) bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| blsPublicKey : [48]byte | 48 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| expiry : uint64 | 8 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| remainingBalanceOwner : PChainOwner | 4 + len(addresses) * 20 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| disableOwner : PChainOwner | 4 + len(addresses) * 20 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ +| weight : uint64 | 8 bytes | ++-----------------------+-------------+--------------------------------------------------------------------+ + | 114 + len(nodeID) + (len(addresses1) + len(addresses2)) * 20 bytes | + +--------------------------------------------------------------------+ ``` ### `SubnetValidatorRegistrationMessage` -Description: Confirms a Subnet Validator's registration validity on the P-Chain +- Description: Confirms a Subnet Validator's registration validity on the P-Chain + +- Signed by: P-Chain -Signed by: P-Chain -Consumed by: Validator Manager contract +- Consumed by: Validator Manager contract Specification: ``` +SubnetValidatorRegistrationMessage +--------------+----------+----------+ | codecID : uint16 | 2 bytes | +--------------+----------+----------+ @@ -53,39 +123,27 @@ Specification: +----------+ ``` -### `ValidationUptimeMessage` +### `SubnetValidatorWeightMessage` -Description: Provides a Validator's uptime for calculating staking rewards +- Description: Used to set and acknowledge a Validator's stake weight on another chain -Signed by: Subnet -Consumed by: Validator Manager contract +- To effect a weight change: -Specification: + - Signed by: Subnet -``` -+--------------+----------+----------+ -| codecID : uint16 | 2 bytes | -+--------------+----------+----------+ -| typeID : uint32 | 4 bytes | -+--------------+----------+----------+ -| validationID : [32]byte | 32 bytes | -+--------------+----------+----------+ -| uptime : uint64 | 8 bytes | -+--------------+----------+----------+ - | 46 bytes | - +----------+ -``` + - Consumed by: P-Chain -### `SetSubnetValidatorWeightMessage` +- To acknowledge the weight change: -Description: Used to set a Validator's stake weight on another chain + - Signed by P-Chain -Signed by: Subnet -Consumed by: P-Chain + + - Consumed by Subnet Specification: ``` +SubnetValidatorWeightMessage +--------------+----------+----------+ | codecID : uint16 | 2 bytes | +--------------+----------+----------+ @@ -101,16 +159,18 @@ Specification: +----------+ ``` -### `SubnetValidatorWeightUpdateMessage` +### `ValidationUptimeMessage` + +- Description: Provides a Validator's uptime for calculating staking rewards -Description: Acknowledges a Validator weight update +- Signed by: Subnet -Signed by: P-Chain -Consumed by: Validator Manager contract +- Consumed by: Validator Manager contract Specification: ``` +ValidationUptimeMessage +--------------+----------+----------+ | codecID : uint16 | 2 bytes | +--------------+----------+----------+ @@ -118,10 +178,8 @@ Specification: +--------------+----------+----------+ | validationID : [32]byte | 32 bytes | +--------------+----------+----------+ -| nonce : uint64 | 8 bytes | -+--------------+----------+----------+ -| weight : uint64 | 8 bytes | +| uptime : uint64 | 8 bytes | +--------------+----------+----------+ - | 54 bytes | + | 46 bytes | +----------+ ``` \ No newline at end of file diff --git a/contracts/validator-manager/PoSValidatorManager.sol b/contracts/validator-manager/PoSValidatorManager.sol index a078d086f..e9f598152 100644 --- a/contracts/validator-manager/PoSValidatorManager.sol +++ b/contracts/validator-manager/PoSValidatorManager.sol @@ -429,7 +429,7 @@ abstract contract PoSValidatorManager is // Unpack the Warp message (bytes32 messageValidationID, uint64 nonce,) = ValidatorMessages - .unpackSubnetValidatorWeightUpdateMessage(_getPChainWarpMessage(messageIndex).payload); + .unpackSubnetValidatorWeightMessage(_getPChainWarpMessage(messageIndex).payload); if (validationID != messageValidationID) { revert InvalidValidationID(delegator.validationID); @@ -589,7 +589,7 @@ abstract contract PoSValidatorManager is // Submit the message to the Warp precompile. WARP_MESSENGER.sendWarpMessage( - ValidatorMessages.packSetSubnetValidatorWeightMessage( + ValidatorMessages.packSubnetValidatorWeightMessage( delegator.validationID, validator.messageNonce, validator.weight ) ); @@ -613,7 +613,7 @@ abstract contract PoSValidatorManager is // Unpack the Warp message WarpMessage memory warpMessage = _getPChainWarpMessage(messageIndex); (bytes32 validationID, uint64 nonce,) = - ValidatorMessages.unpackSubnetValidatorWeightUpdateMessage(warpMessage.payload); + ValidatorMessages.unpackSubnetValidatorWeightMessage(warpMessage.payload); if (delegator.validationID != validationID) { revert InvalidValidationID(validationID); diff --git a/contracts/validator-manager/ValidatorManager.sol b/contracts/validator-manager/ValidatorManager.sol index 8881d7812..03c87e8f2 100644 --- a/contracts/validator-manager/ValidatorManager.sol +++ b/contracts/validator-manager/ValidatorManager.sol @@ -14,7 +14,8 @@ import { ValidatorChurnPeriod, SubnetConversionData, InitialValidator, - ValidatorRegistrationInput + ValidatorRegistrationInput, + PChainOwner } from "./interfaces/IValidatorManager.sol"; import { WarpMessage, @@ -49,7 +50,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida /// @notice Maps the validationID to the validator information. mapping(bytes32 => Validator) _validationPeriods; /// @notice Maps the nodeID to the validationID for validation periods that have not ended. - mapping(bytes32 => bytes32) _registeredValidators; + mapping(bytes => bytes32) _registeredValidators; /// @notice Boolean that indicates if the initial validator set has been set. bool _initializedValidatorSet; } @@ -73,7 +74,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida error InvalidInitializationStatus(); error InvalidMaximumChurnPercentage(uint8 maximumChurnPercentage); error InvalidBLSKeyLength(uint256 length); - error InvalidNodeID(bytes32 nodeID); + error InvalidNodeID(bytes nodeID); error InvalidSubnetConversionID( bytes32 encodedSubnetConversionID, bytes32 expectedSubnetConversionID ); @@ -81,8 +82,10 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida error InvalidValidatorStatus(ValidatorStatus status); error InvalidWarpMessage(); error MaxChurnRateExceeded(uint64 churnAmount); - error NodeAlreadyRegistered(bytes32 nodeID); + error NodeAlreadyRegistered(bytes nodeID); error UnexpectedRegistrationStatus(bool validRegistration); + error InvalidPChainOwnerThreshold(uint256 threshold, uint256 addressesLength); + error PChainOwnerAddressesNotSorted(); // solhint-disable ordering function _getValidatorManagerStorage() @@ -166,20 +169,17 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida uint256 totalWeight; for (uint32 i; i < numInitialValidators; ++i) { InitialValidator memory initialValidator = subnetConversionData.initialValidators[i]; - bytes32 nodeID = initialValidator.nodeID; - - if ($._registeredValidators[nodeID] != bytes32(0)) { - revert NodeAlreadyRegistered(nodeID); + if ($._registeredValidators[initialValidator.nodeID] != bytes32(0)) { + revert NodeAlreadyRegistered(initialValidator.nodeID); } // Validation ID of the initial validators is the sha256 hash of the // convert Subnet tx ID and the index of the initial validator. - bytes32 validationID = - sha256(abi.encodePacked(subnetConversionData.convertSubnetTxID, i)); + bytes32 validationID = sha256(abi.encodePacked(subnetConversionData.subnetID, i)); // Save the initial validator as an active validator. - $._registeredValidators[nodeID] = validationID; + $._registeredValidators[initialValidator.nodeID] = validationID; $._validationPeriods[validationID] = Validator({ status: ValidatorStatus.Active, nodeID: initialValidator.nodeID, @@ -211,6 +211,24 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida $._initializedValidatorSet = true; } + function _validatePChainOwner(PChainOwner calldata pChainOwner) internal pure { + // If threshold is 0, addresses must be empty. + if (pChainOwner.threshold == 0 && pChainOwner.addresses.length != 0) { + revert InvalidPChainOwnerThreshold(pChainOwner.threshold, pChainOwner.addresses.length); + } + // Threshold must be less than or equal to the number of addresses. + if (pChainOwner.threshold > pChainOwner.addresses.length) { + revert InvalidPChainOwnerThreshold(pChainOwner.threshold, pChainOwner.addresses.length); + } + // Addresses must be sorted in ascending order + for (uint256 i = 1; i < pChainOwner.addresses.length; i++) { + // Compare current address with the previous one + if (pChainOwner.addresses[i] < pChainOwner.addresses[i - 1]) { + revert PChainOwnerAddressesNotSorted(); + } + } + } + /** * @notice Begins the validator registration process, and sets the initial weight for the validator. * This is the only method related to validator registration and removal that needs the initializedValidatorSet @@ -231,12 +249,15 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida revert InvalidRegistrationExpiry(input.registrationExpiry); } + _validatePChainOwner(input.remainingBalanceOwner); + _validatePChainOwner(input.disableOwner); + // Ensure the nodeID is not the zero address, and is not already an active validator. if (input.blsPublicKey.length != BLS_PUBLIC_KEY_LENGTH) { revert InvalidBLSKeyLength(input.blsPublicKey.length); } - if (input.nodeID == bytes32(0)) { + if (input.nodeID.length == 0) { revert InvalidNodeID(input.nodeID); } if ($._registeredValidators[input.nodeID] != bytes32(0)) { @@ -251,9 +272,11 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida ValidatorMessages.ValidationPeriod({ subnetID: $._subnetID, nodeID: input.nodeID, - weight: weight, blsPublicKey: input.blsPublicKey, - registrationExpiry: input.registrationExpiry + remainingBalanceOwner: input.remainingBalanceOwner, + disableOwner: input.disableOwner, + registrationExpiry: input.registrationExpiry, + weight: weight }) ); $._pendingRegisterValidationMessages[validationID] = registerSubnetValidatorMessage; @@ -325,7 +348,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida ); } - function registeredValidators(bytes32 nodeID) public view returns (bytes32) { + function registeredValidators(bytes calldata nodeID) public view returns (bytes32) { ValidatorManagerStorage storage $ = _getValidatorManagerStorage(); return $._registeredValidators[nodeID]; } @@ -390,7 +413,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida } WARP_MESSENGER.sendWarpMessage( - ValidatorMessages.packSetSubnetValidatorWeightMessage( + ValidatorMessages.packSubnetValidatorWeightMessage( validationID, validator.messageNonce, 0 ) ); @@ -496,7 +519,7 @@ abstract contract ValidatorManager is Initializable, ContextUpgradeable, IValida // Submit the message to the Warp precompile. bytes32 messageID = WARP_MESSENGER.sendWarpMessage( - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, nonce, newWeight) + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, nonce, newWeight) ); emit ValidatorWeightUpdate({ diff --git a/contracts/validator-manager/ValidatorMessages.sol b/contracts/validator-manager/ValidatorMessages.sol index 3f8fcd949..272edf795 100644 --- a/contracts/validator-manager/ValidatorMessages.sol +++ b/contracts/validator-manager/ValidatorMessages.sol @@ -4,7 +4,7 @@ // SPDX-License-Identifier: Ecosystem pragma solidity 0.8.25; -import {SubnetConversionData} from "./interfaces/IValidatorManager.sol"; +import {SubnetConversionData, PChainOwner} from "./interfaces/IValidatorManager.sol"; /** * @dev Packing utilities for the Warp message types used by the Validator Manager contracts, as specified in ACP-77: @@ -16,10 +16,12 @@ library ValidatorMessages { // REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID, and the concatenated ValidationPeriod fields. struct ValidationPeriod { bytes32 subnetID; - bytes32 nodeID; - uint64 weight; - uint64 registrationExpiry; + bytes nodeID; bytes blsPublicKey; + uint64 registrationExpiry; + PChainOwner remainingBalanceOwner; + PChainOwner disableOwner; + uint64 weight; } // The P-Chain uses a hardcoded codecID of 0 for all messages. @@ -31,26 +33,22 @@ library ValidatorMessages { // Subnets send a RegisterSubnetValidator message to the P-Chain to register a validator. uint32 internal constant REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID = 1; - // Subnets can send a SetSubnetValidatorWeight message to the P-Chain to update a validator's weight. - // The P-Chain responds with a SetSubnetValidatorWeight message acknowledging the weight update. - uint32 internal constant SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID = 2; - // The P-Chain responds with a RegisterSubnetValidator message indicating whether the registration was successful // for the given validation ID. - uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 3; + uint32 internal constant SUBNET_VALIDATOR_REGISTRATION_MESSAGE_TYPE_ID = 2; - // The P-Chain responds with a SubnetValidatorWeightUpdateMessage message indicating whether the weight update was successful - // for the given validation ID. - uint32 internal constant SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID = 4; + // Subnets can send a SubnetValidatorWeight message to the P-Chain to update a validator's weight. + // The P-Chain responds with another SubnetValidatorWeight message acknowledging the weight update. + uint32 internal constant SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID = 3; // The Subnet will self-sign a ValidationUptimeMessage to be provided when a validator is initiating // the end of their validation period. - uint32 internal constant VALIDATION_UPTIME_MESSAGE_TYPE_ID = 5; + uint32 internal constant VALIDATION_UPTIME_MESSAGE_TYPE_ID = 0; - error InvalidMessageLength(); - error InvalidCodecID(); + error InvalidMessageLength(uint32 actual, uint32 expected); + error InvalidCodecID(uint32 id); error InvalidMessageType(); - error InvalidSignatureLength(); + error InvalidBLSPublicKey(); /** * @notice Packs a SubnetConversionMessage message into a byte array. @@ -85,7 +83,7 @@ library ValidatorMessages { */ function unpackSubnetConversionMessage(bytes memory input) internal pure returns (bytes32) { if (input.length != 38) { - revert InvalidMessageLength(); + revert InvalidMessageLength(uint32(input.length), 38); } // Unpack the codec ID @@ -94,7 +92,7 @@ library ValidatorMessages { codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); } if (codecID != CODEC_ID) { - revert InvalidCodecID(); + revert InvalidCodecID(codecID); } // Unpack the type ID @@ -120,28 +118,33 @@ library ValidatorMessages { * This byte array is the SHA256 pre-image of the subnetConversionID hash * The message format specification is: * - * +-------------------+---------------+---------------------------------------------------------+ - * | convertSubnetTxID : [32]byte | 32 bytes | - * +-------------------+-----------------+-------------------------------------------------------+ - * | managerChainID : [32]byte | 32 bytes | - * +-------------------+-----------------+-------------------------------------------------------+ - * | managerAddress : []byte | 4 + len(managerAddress) bytes | - * +-------------------+-----------------+-------------------------------------------------------+ - * | validators : []ValidatorData | 4 + len(validators) * 88 bytes | - * +-------------------+-----------------+-------------------------------------------------------+ - * | 72 + len(managerAddress) + len(validators) * 88 bytes | - * +-------------------------------------------------------+ - * And ValidatorData: - * +--------------+----------+-----------+ - * | nodeID : [32]byte | 32 bytes | - * +--------------+----------+-----------+ - * | weight : uint64 | 8 bytes | - * +--------------+----------+-----------+ - * | blsPublicKey : [48]byte | 48 bytes | - * +--------------+----------+-----------+ - * | 88 bytes | - * +-----------+ + * SubnetConversionData: + * +----------------+-----------------+--------------------------------------------------------+ + * | codecID : uint16 | 2 bytes | + * +----------------+-----------------+--------------------------------------------------------+ + * | subnetID : [32]byte | 32 bytes | + * +----------------+-----------------+--------------------------------------------------------+ + * | managerChainID : [32]byte | 32 bytes | + * +----------------+-----------------+--------------------------------------------------------+ + * | managerAddress : []byte | 4 + len(managerAddress) bytes | + * +----------------+-----------------+--------------------------------------------------------+ + * | validators : []ValidatorData | 4 + sum(validatorLengths) bytes | + * +----------------+-----------------+--------------------------------------------------------+ + * | 74 + len(managerAddress) + len(validatorLengths) bytes | + * +--------------------------------------------------------+ + * ValidatorData: + * +--------------+----------+------------------------+ + * | nodeID : []byte | 4 + len(nodeID) bytes | + * +--------------+----------+------------------------+ + * | blsPublicKey : [48]byte | 48 bytes | + * +--------------+----------+------------------------+ + * | weight : uint64 | 8 bytes | + * +--------------+----------+------------------------+ + * | 60 + len(nodeID) bytes | + * +------------------------+ * + * @dev Input validation is skipped, since the returned value is intended to be compared + * directly with an authenticated Warp message. * @param subnetConversionData The struct representing data to pack into the message. * @return The packed message. */ @@ -150,9 +153,11 @@ library ValidatorMessages { pure returns (bytes memory) { - // Hardcoded 20 is for length of the managerAddress + // Hardcoded 20 is for length of the managerAddress on EVM chains + // solhint-disable-next-line func-named-parameters bytes memory res = abi.encodePacked( - subnetConversionData.convertSubnetTxID, + CODEC_ID, + subnetConversionData.subnetID, subnetConversionData.validatorManagerBlockchainID, uint32(20), subnetConversionData.validatorManagerAddress, @@ -164,9 +169,10 @@ library ValidatorMessages { for (uint256 i = 0; i < subnetConversionData.initialValidators.length; i++) { res = abi.encodePacked( res, + uint32(subnetConversionData.initialValidators[i].nodeID.length), subnetConversionData.initialValidators[i].nodeID, - subnetConversionData.initialValidators[i].weight, - subnetConversionData.initialValidators[i].blsPublicKey + subnetConversionData.initialValidators[i].blsPublicKey, + subnetConversionData.initialValidators[i].weight ); } return res; @@ -175,23 +181,38 @@ library ValidatorMessages { /** * @notice Packs a RegisterSubnetValidatorMessage message into a byte array. * The message format specification is: - * +--------------+----------+-----------+ - * | codecID : uint16 | 2 bytes | - * +--------------+----------+-----------+ - * | typeID : uint32 | 4 bytes | - * +--------------+----------+-----------+ - * | subnetID : [32]byte | 32 bytes | - * +--------------+----------+-----------+ - * | nodeID : [32]byte | 32 bytes | - * +--------------+----------+-----------+ - * | weight : uint64 | 8 bytes | - * +--------------+----------+-----------+ - * | blsPublicKey : [48]byte | 48 bytes | - * +--------------+----------+-----------+ - * | expiry : uint64 | 8 bytes | - * +--------------+----------+-----------+ - * | 134 bytes | - * +-----------+ + * + * RegisterSubnetValidatorMessage: + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | codecID : uint16 | 2 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | typeID : uint32 | 4 bytes | + * +-----------------------+-------------+-------------------------------------------------------------------+ + * | subnetID : [32]byte | 32 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | nodeID : []byte | 4 + len(nodeID) bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | blsPublicKey : [48]byte | 48 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | expiry : uint64 | 8 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | remainingBalanceOwner : PChainOwner | 4 + len(addresses) * 20 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | disableOwner : PChainOwner | 4 + len(addresses) * 20 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | weight : uint64 | 8 bytes | + * +-----------------------+-------------+--------------------------------------------------------------------+ + * | 122 + len(nodeID) + (len(addresses1) + len(addresses2)) * 20 bytes | + * +--------------------------------------------------------------------+ + * + * PChainOwner: + * +-----------+------------+-------------------------------+ + * | threshold : uint32 | 4 bytes | + * +-----------+------------+-------------------------------+ + * | addresses : [][20]byte | 4 + len(addresses) * 20 bytes | + * +-----------+------------+-------------------------------+ + * | 8 + len(addresses) * 20 bytes | + * +-------------------------------+ * * @param validationPeriod The information to pack into the message. * @return The validationID and the packed message. @@ -202,7 +223,7 @@ library ValidatorMessages { returns (bytes32, bytes memory) { if (validationPeriod.blsPublicKey.length != 48) { - revert InvalidMessageLength(); + revert InvalidBLSPublicKey(); } // solhint-disable-next-line func-named-parameters @@ -210,11 +231,26 @@ library ValidatorMessages { CODEC_ID, REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID, validationPeriod.subnetID, + uint32(validationPeriod.nodeID.length), validationPeriod.nodeID, - validationPeriod.weight, validationPeriod.blsPublicKey, - validationPeriod.registrationExpiry + validationPeriod.registrationExpiry, + validationPeriod.remainingBalanceOwner.threshold, + uint32(validationPeriod.remainingBalanceOwner.addresses.length) ); + for (uint256 i = 0; i < validationPeriod.remainingBalanceOwner.addresses.length; i++) { + res = abi.encodePacked(res, validationPeriod.remainingBalanceOwner.addresses[i]); + } + res = abi.encodePacked( + res, + validationPeriod.disableOwner.threshold, + uint32(validationPeriod.disableOwner.addresses.length) + ); + for (uint256 i = 0; i < validationPeriod.disableOwner.addresses.length; i++) { + res = abi.encodePacked(res, validationPeriod.disableOwner.addresses[i]); + } + res = abi.encodePacked(res, validationPeriod.weight); + return (sha256(res), res); } @@ -230,65 +266,170 @@ library ValidatorMessages { pure returns (ValidationPeriod memory) { - if (input.length != 134) { - revert InvalidMessageLength(); - } + uint32 index = 0; + ValidationPeriod memory validation; // Unpack the codec ID - uint16 codecID; - for (uint256 i; i < 2; ++i) { - codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); - } - if (codecID != CODEC_ID) { - revert InvalidCodecID(); + // Individual fields are unpacked in their own scopes to avoid stack too deep errors. + { + uint16 codecID; + for (uint256 i; i < 2; ++i) { + codecID |= uint16(uint8(input[i + index])) << uint16((8 * (1 - i))); + } + if (codecID != CODEC_ID) { + revert InvalidCodecID(codecID); + } + index += 2; } // Unpack the type ID - uint32 typeID; - for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); - } - if (typeID != REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID) { - revert InvalidMessageType(); + { + uint32 typeID; + for (uint256 i; i < 4; ++i) { + typeID |= uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + if (typeID != REGISTER_SUBNET_VALIDATOR_MESSAGE_TYPE_ID) { + revert InvalidMessageType(); + } + index += 4; } // Unpack the subnetID - bytes32 subnetID; - for (uint256 i; i < 32; ++i) { - subnetID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); - } - - // Unpack the nodeID - bytes32 nodeID; - for (uint256 i; i < 32; ++i) { - nodeID |= bytes32(uint256(uint8(input[i + 38])) << (8 * (31 - i))); - } - - // Unpack the weight - uint64 weight; - for (uint256 i; i < 8; ++i) { - weight |= uint64(uint8(input[i + 70])) << uint64((8 * (7 - i))); + { + bytes32 subnetID; + for (uint256 i; i < 32; ++i) { + subnetID |= bytes32(uint256(uint8(input[i + index])) << (8 * (31 - i))); + } + validation.subnetID = subnetID; + index += 32; + } + + // Unpack the nodeID length + uint32 nodeIDLength; + { + for (uint256 i; i < 4; ++i) { + nodeIDLength |= uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + index += 4; + + // Unpack the nodeID + bytes memory nodeID = new bytes(nodeIDLength); + for (uint256 i; i < nodeIDLength; ++i) { + nodeID[i] = input[i + index]; + } + validation.nodeID = nodeID; + index += nodeIDLength; } // Unpack the blsPublicKey - bytes memory blsPublicKey = new bytes(48); - for (uint256 i; i < 48; ++i) { - blsPublicKey[i] = input[i + 78]; + { + bytes memory blsPublicKey = new bytes(48); + for (uint256 i; i < 48; ++i) { + blsPublicKey[i] = input[i + index]; + } + validation.blsPublicKey = blsPublicKey; + index += 48; } // Unpack the registration expiry - uint64 expiry; - for (uint256 i; i < 8; ++i) { - expiry |= uint64(uint8(input[i + 126])) << uint64((8 * (7 - i))); + { + uint64 expiry; + for (uint256 i; i < 8; ++i) { + expiry |= uint64(uint8(input[i + index])) << uint64((8 * (7 - i))); + } + validation.registrationExpiry = expiry; + index += 8; + } + + // Unpack the remainingBalanceOwner threshold + uint32 remainingBalanceOwnerAddressesLength; + { + uint32 remainingBalanceOwnerThreshold; + for (uint256 i; i < 4; ++i) { + remainingBalanceOwnerThreshold |= + uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + index += 4; + + // Unpack the remainingBalanceOwner addresses length + for (uint256 i; i < 4; ++i) { + remainingBalanceOwnerAddressesLength |= + uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + index += 4; + + // Unpack the remainingBalanceOwner addresses + address[] memory remainingBalanceOwnerAddresses = + new address[](remainingBalanceOwnerAddressesLength); + for (uint256 i; i < remainingBalanceOwnerAddressesLength; ++i) { + bytes memory addrBytes = new bytes(20); + for (uint256 j; j < 20; ++j) { + addrBytes[j] = input[j + index]; + } + address addr; + // solhint-disable-next-line no-inline-assembly + assembly { + addr := mload(add(addrBytes, 20)) + } + remainingBalanceOwnerAddresses[i] = addr; + index += 20; + } + validation.remainingBalanceOwner = PChainOwner({ + threshold: remainingBalanceOwnerThreshold, + addresses: remainingBalanceOwnerAddresses + }); + } + + // Unpack the disableOwner threshold + uint32 disableOwnerAddressesLength; + { + uint32 disableOwnerThreshold; + for (uint256 i; i < 4; ++i) { + disableOwnerThreshold |= uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + index += 4; + + // Unpack the disableOwner addresses length + for (uint256 i; i < 4; ++i) { + disableOwnerAddressesLength |= + uint32(uint8(input[i + index])) << uint32((8 * (3 - i))); + } + index += 4; + + // Unpack the disableOwner addresses + address[] memory disableOwnerAddresses = new address[](disableOwnerAddressesLength); + for (uint256 i; i < disableOwnerAddressesLength; ++i) { + bytes memory addrBytes = new bytes(20); + for (uint256 j; j < 20; ++j) { + addrBytes[j] = input[j + index]; + } + address addr; + // solhint-disable-next-line no-inline-assembly + assembly { + addr := mload(add(addrBytes, 20)) + } + disableOwnerAddresses[i] = addr; + index += 20; + } + validation.disableOwner = + PChainOwner({threshold: disableOwnerThreshold, addresses: disableOwnerAddresses}); + } + // Now that we have all the variable lengths, validate the input length + uint32 expectedLength = 122 + nodeIDLength + + (remainingBalanceOwnerAddressesLength + disableOwnerAddressesLength) * 20; + if (input.length != expectedLength) { + revert InvalidMessageLength(uint32(input.length), expectedLength); + } + // Unpack the weight + { + uint64 weight; + for (uint256 i; i < 8; ++i) { + weight |= uint64(uint8(input[i + index])) << uint64((8 * (7 - i))); + } + validation.weight = weight; } - return ValidationPeriod({ - subnetID: subnetID, - nodeID: nodeID, - weight: weight, - registrationExpiry: expiry, - blsPublicKey: blsPublicKey - }); + return validation; } /** @@ -334,7 +475,7 @@ library ValidatorMessages { returns (bytes32, bool) { if (input.length != 39) { - revert InvalidMessageLength(); + revert InvalidMessageLength(uint32(input.length), 39); } // Unpack the codec ID uint16 codecID; @@ -342,7 +483,7 @@ library ValidatorMessages { codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); } if (codecID != CODEC_ID) { - revert InvalidCodecID(); + revert InvalidCodecID(codecID); } // Unpack the type ID @@ -367,7 +508,7 @@ library ValidatorMessages { } /** - * @notice Packs a SetSubnetValidatorWeightMessage message into a byte array. + * @notice Packs a SubnetValidatorWeightMessage message into a byte array. * The message format specification is: * +--------------+----------+----------+ * | codecID : uint16 | 2 bytes | @@ -388,112 +529,30 @@ library ValidatorMessages { * @param weight The new weight of the validator. * @return The packed message. */ - function packSetSubnetValidatorWeightMessage( + function packSubnetValidatorWeightMessage( bytes32 validationID, uint64 nonce, uint64 weight ) internal pure returns (bytes memory) { return abi.encodePacked( - CODEC_ID, SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID, validationID, nonce, weight + CODEC_ID, SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID, validationID, nonce, weight ); } /** - * @notice Unpacks a byte array as a SetSubnetValidatorWeight message. + * @notice Unpacks a byte array as a SubnetValidatorWeight message. * The message format specification is the same as the one used in above for packing. * * @param input The byte array to unpack. * @return The validationID, nonce, and weight. */ - function unpackSetSubnetValidatorWeightMessage(bytes memory input) - internal - pure - returns (bytes32, uint64, uint64) - { - if (input.length != 54) { - revert InvalidMessageLength(); - } - - // Unpack the codec ID. - uint16 codecID; - for (uint256 i; i < 2; ++i) { - codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); - } - if (codecID != CODEC_ID) { - revert InvalidCodecID(); - } - - // Unpack the type ID. - uint32 typeID; - for (uint256 i; i < 4; ++i) { - typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); - } - if (typeID != SET_SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID) { - revert InvalidMessageType(); - } - - // Unpack the validation ID. - bytes32 validationID; - for (uint256 i; i < 32; ++i) { - validationID |= bytes32(uint256(uint8(input[i + 6])) << (8 * (31 - i))); - } - - // Unpack the nonce. - uint64 nonce; - for (uint256 i; i < 8; ++i) { - nonce |= uint64(uint8(input[i + 38])) << uint64((8 * (7 - i))); - } - - // Unpack the weight. - uint64 weight; - for (uint256 i; i < 8; ++i) { - weight |= uint64(uint8(input[i + 46])) << uint64((8 * (7 - i))); - } - - return (validationID, nonce, weight); - } - - /** - * @notice Packs a SubnetValidatorWeightUpdateMessage into a byte array. - * The message format specification is: - * +--------------+----------+----------+ - * | codecID : uint16 | 2 bytes | - * +--------------+----------+----------+ - * | typeID : uint32 | 4 bytes | - * +--------------+----------+----------+ - * | validationID : [32]byte | 32 bytes | - * +--------------+----------+----------+ - * | nonce : uint64 | 8 bytes | - * +--------------+----------+----------+ - * | weight : uint64 | 8 bytes | - * +--------------+----------+----------+ - * | 54 bytes | - * +----------+ - */ - function packSubnetValidatorWeightUpdateMessage( - bytes32 validationID, - uint64 nonce, - uint64 weight - ) internal pure returns (bytes memory) { - return abi.encodePacked( - CODEC_ID, SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID, validationID, nonce, weight - ); - } - - /** - * @notice Unpacks a byte array as a SubnetValidatorWeightUpdateMessag. - * The message format specification is the same as the one used in above for packing. - * - * @param input The byte array to unpack. - * @return The validationID, weight, and nonce. - */ - function unpackSubnetValidatorWeightUpdateMessage(bytes memory input) + function unpackSubnetValidatorWeightMessage(bytes memory input) internal pure returns (bytes32, uint64, uint64) { if (input.length != 54) { - revert InvalidMessageLength(); + revert InvalidMessageLength(uint32(input.length), 54); } // Unpack the codec ID. @@ -502,7 +561,7 @@ library ValidatorMessages { codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); } if (codecID != CODEC_ID) { - revert InvalidCodecID(); + revert InvalidCodecID(codecID); } // Unpack the type ID. @@ -510,8 +569,7 @@ library ValidatorMessages { for (uint256 i; i < 4; ++i) { typeID |= uint32(uint8(input[i + 2])) << uint32((8 * (3 - i))); } - - if (typeID != SUBNET_VALIDATOR_WEIGHT_UPDATE_MESSAGE_TYPE_ID) { + if (typeID != SUBNET_VALIDATOR_WEIGHT_MESSAGE_TYPE_ID) { revert InvalidMessageType(); } @@ -575,7 +633,7 @@ library ValidatorMessages { returns (bytes32, uint64) { if (input.length != 46) { - revert InvalidMessageLength(); + revert InvalidMessageLength(uint32(input.length), 46); } // Unpack the codec ID. @@ -584,7 +642,7 @@ library ValidatorMessages { codecID |= uint16(uint8(input[i])) << uint16((8 * (1 - i))); } if (codecID != CODEC_ID) { - revert InvalidCodecID(); + revert InvalidCodecID(codecID); } // Unpack the type ID. diff --git a/contracts/validator-manager/interfaces/IValidatorManager.sol b/contracts/validator-manager/interfaces/IValidatorManager.sol index 33b5810a0..6d1b25c1f 100644 --- a/contracts/validator-manager/interfaces/IValidatorManager.sol +++ b/contracts/validator-manager/interfaces/IValidatorManager.sol @@ -17,12 +17,21 @@ enum ValidatorStatus { Invalidated } +/** + * @dev Specifies the owner of a validator's remaining balance or disable owner on the P-Chain. + * P-Chain addresses are also 20-bytes, so we use the address type to represent them. + */ +struct PChainOwner { + uint32 threshold; + address[] addresses; +} + /** * @dev Contains the active state of a Validator */ struct Validator { ValidatorStatus status; - bytes32 nodeID; + bytes nodeID; uint64 startingWeight; uint64 messageNonce; uint64 weight; @@ -56,7 +65,7 @@ struct ValidatorManagerSettings { * and verified by the Validator Manager. */ struct SubnetConversionData { - bytes32 convertSubnetTxID; + bytes32 subnetID; bytes32 validatorManagerBlockchainID; address validatorManagerAddress; InitialValidator[] initialValidators; @@ -66,18 +75,20 @@ struct SubnetConversionData { * @dev Specifies an initial validator, used in the subnet conversion data. */ struct InitialValidator { - bytes32 nodeID; - uint64 weight; + bytes nodeID; bytes blsPublicKey; + uint64 weight; } /** * @dev Specifies a validator to register. */ struct ValidatorRegistrationInput { - bytes32 nodeID; - uint64 registrationExpiry; + bytes nodeID; bytes blsPublicKey; + uint64 registrationExpiry; + PChainOwner remainingBalanceOwner; + PChainOwner disableOwner; } /** @@ -98,14 +109,14 @@ interface IValidatorManager { */ event ValidationPeriodCreated( bytes32 indexed validationID, - bytes32 indexed nodeID, + bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry ); event InitialValidatorCreated( - bytes32 indexed validationID, bytes32 indexed nodeID, uint256 weight + bytes32 indexed validationID, bytes indexed nodeID, uint256 weight ); /** diff --git a/contracts/validator-manager/tests/ERC20TokenStakingManagerTests.t.sol b/contracts/validator-manager/tests/ERC20TokenStakingManagerTests.t.sol index c2927d876..c85356bc9 100644 --- a/contracts/validator-manager/tests/ERC20TokenStakingManagerTests.t.sol +++ b/contracts/validator-manager/tests/ERC20TokenStakingManagerTests.t.sol @@ -20,6 +20,7 @@ import {ExampleERC20} from "@mocks/ExampleERC20.sol"; import {IERC20} from "@openzeppelin/contracts@5.0.2/token/ERC20/IERC20.sol"; import {IERC20Mintable} from "../interfaces/IERC20Mintable.sol"; import {SafeERC20} from "@openzeppelin/contracts@5.0.2/token/ERC20/utils/SafeERC20.sol"; +import {ValidatorManagerTest} from "./ValidatorManagerTests.t.sol"; contract ERC20TokenStakingManagerTest is PoSValidatorManagerTest { using SafeERC20 for IERC20Mintable; @@ -27,7 +28,9 @@ contract ERC20TokenStakingManagerTest is PoSValidatorManagerTest { ERC20TokenStakingManager public app; IERC20Mintable public token; - function setUp() public virtual { + function setUp() public override { + ValidatorManagerTest.setUp(); + // Construct the object under test app = new ERC20TokenStakingManager(ICMInitializable.Allowed); token = new ExampleERC20(); @@ -179,8 +182,13 @@ contract ERC20TokenStakingManagerTest is PoSValidatorManagerTest { } function testInvalidValidatorMinStakeDuration() public { - ValidatorRegistrationInput memory input = - ValidatorRegistrationInput(DEFAULT_NODE_ID, DEFAULT_EXPIRY, DEFAULT_BLS_PUBLIC_KEY); + ValidatorRegistrationInput memory input = ValidatorRegistrationInput({ + nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + registrationExpiry: DEFAULT_EXPIRY, + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER + }); uint256 stakeAmount = _weightToValue(DEFAULT_WEIGHT); vm.expectRevert( abi.encodeWithSelector( diff --git a/contracts/validator-manager/tests/NativeTokenStakingManagerTests.t.sol b/contracts/validator-manager/tests/NativeTokenStakingManagerTests.t.sol index 7a56521fe..fd748830e 100644 --- a/contracts/validator-manager/tests/NativeTokenStakingManagerTests.t.sol +++ b/contracts/validator-manager/tests/NativeTokenStakingManagerTests.t.sol @@ -18,11 +18,14 @@ import {ExampleRewardCalculator} from "../ExampleRewardCalculator.sol"; import {ICMInitializable} from "../../utilities/ICMInitializable.sol"; import {INativeMinter} from "@avalabs/subnet-evm-contracts@1.2.0/contracts/interfaces/INativeMinter.sol"; +import {ValidatorManagerTest} from "./ValidatorManagerTests.t.sol"; contract NativeTokenStakingManagerTest is PoSValidatorManagerTest { NativeTokenStakingManager public app; - function setUp() public virtual { + function setUp() public override { + ValidatorManagerTest.setUp(); + // Construct the object under test app = new NativeTokenStakingManager(ICMInitializable.Allowed); rewardCalculator = new ExampleRewardCalculator(DEFAULT_REWARD_RATE); diff --git a/contracts/validator-manager/tests/PoAValidatorManagerTests.t.sol b/contracts/validator-manager/tests/PoAValidatorManagerTests.t.sol index a6360df10..6de971209 100644 --- a/contracts/validator-manager/tests/PoAValidatorManagerTests.t.sol +++ b/contracts/validator-manager/tests/PoAValidatorManagerTests.t.sol @@ -14,13 +14,16 @@ import { } from "../interfaces/IValidatorManager.sol"; import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable@5.0.2/access/OwnableUpgradeable.sol"; +import {ValidatorManagerTest} from "./ValidatorManagerTests.t.sol"; contract PoAValidatorManagerTest is ValidatorManagerTest { PoAValidatorManager public app; address public constant DEFAULT_OWNER = address(0x1); - function setUp() public { + function setUp() public override { + ValidatorManagerTest.setUp(); + app = new PoAValidatorManager(ICMInitializable.Allowed); app.initialize( ValidatorManagerSettings({ @@ -44,7 +47,13 @@ contract PoAValidatorManagerTest is ValidatorManagerTest { ) ); _initializeValidatorRegistration( - ValidatorRegistrationInput(DEFAULT_NODE_ID, DEFAULT_EXPIRY, DEFAULT_BLS_PUBLIC_KEY), + ValidatorRegistrationInput({ + nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + registrationExpiry: DEFAULT_EXPIRY, + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER + }), DEFAULT_WEIGHT ); } diff --git a/contracts/validator-manager/tests/PoSValidatorManagerTests.t.sol b/contracts/validator-manager/tests/PoSValidatorManagerTests.t.sol index 2a2b3a11d..dc083471e 100644 --- a/contracts/validator-manager/tests/PoSValidatorManagerTests.t.sol +++ b/contracts/validator-manager/tests/PoSValidatorManagerTests.t.sol @@ -73,8 +73,10 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { function testDelegationFeeBipsTooLow() public { ValidatorRegistrationInput memory registrationInput = ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER }); vm.expectRevert( abi.encodeWithSelector( @@ -93,8 +95,10 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { function testDelegationFeeBipsTooHigh() public { ValidatorRegistrationInput memory registrationInput = ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER }); uint16 delegationFeeBips = posValidatorManager.MAXIMUM_DELEGATION_FEE_BIPS() + 1; vm.expectRevert( @@ -114,8 +118,10 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { function testInvalidMinStakeDuration() public { ValidatorRegistrationInput memory registrationInput = ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER }); vm.expectRevert( abi.encodeWithSelector( @@ -134,8 +140,10 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { function testStakeAmountTooLow() public { ValidatorRegistrationInput memory registrationInput = ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER }); vm.expectRevert( abi.encodeWithSelector( @@ -153,8 +161,10 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { function testStakeAmountTooHigh() public { ValidatorRegistrationInput memory registrationInput = ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER }); vm.expectRevert( abi.encodeWithSelector( @@ -283,8 +293,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { expectedValidatorWeight: DEFAULT_DELEGATOR_WEIGHT + DEFAULT_WEIGHT, expectedNonce: 1 }); - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSetSubnetValidatorWeightMessage( + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( validationID, 1, DEFAULT_WEIGHT + DEFAULT_DELEGATOR_WEIGHT ); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); @@ -324,8 +333,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { // Complete registration of delegator2 with delegator1's nonce // Note that registering delegator1 with delegator2's nonce is valid uint64 nonce = 1; - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSubnetValidatorWeightUpdateMessage( + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( validationID, nonce, DEFAULT_DELEGATOR_WEIGHT + DEFAULT_WEIGHT ); _mockGetPChainWarpMessage(setValidatorWeightPayload, true); @@ -459,7 +467,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { force: false }); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 2, DEFAULT_WEIGHT); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 2, DEFAULT_WEIGHT); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); posValidatorManager.resendUpdateDelegation(delegationID); } @@ -476,7 +484,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { }); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); validatorManager.resendEndValidatorMessage(validationID); } @@ -836,8 +844,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { // Complete ending delegator2 with delegator1's nonce // Note that ending delegator1 with delegator2's nonce is valid uint64 nonce = 3; - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSubnetValidatorWeightUpdateMessage( + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( validationID, nonce, DEFAULT_DELEGATOR_WEIGHT + DEFAULT_WEIGHT ); _mockGetPChainWarpMessage(setValidatorWeightPayload, true); @@ -966,7 +973,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { vm.warp(DEFAULT_COMPLETION_TIMESTAMP); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); // Submit an uptime proof via submitUptime @@ -1006,7 +1013,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { vm.warp(DEFAULT_COMPLETION_TIMESTAMP); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); bytes memory uptimeMsg = ValidatorMessages.packValidationUptimeMessage( @@ -1026,11 +1033,11 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { } function testInitializeEndValidationPoAValidator() public { - bytes32 defaultInitialValidationID = sha256(abi.encodePacked(bytes32(0), uint32(1))); + bytes32 defaultInitialValidationID = sha256(abi.encodePacked(DEFAULT_SUBNET_ID, uint32(1))); vm.warp(DEFAULT_COMPLETION_TIMESTAMP); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(defaultInitialValidationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(defaultInitialValidationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); vm.expectEmit(true, true, true, true, address(validatorManager)); emit ValidatorRemovalInitialized( @@ -1058,7 +1065,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { vm.warp(DEFAULT_COMPLETION_TIMESTAMP); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); bytes memory uptimeMsg = ValidatorMessages.packValidationUptimeMessage( @@ -1141,8 +1148,9 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { uint64 expectedValidatorWeight, uint64 expectedNonce ) internal returns (bytes32) { - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSetSubnetValidatorWeightMessage(validationID, expectedNonce, expectedValidatorWeight); + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( + validationID, expectedNonce, expectedValidatorWeight + ); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); vm.warp(registrationTimestamp); @@ -1169,8 +1177,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { uint64 expectedValidatorWeight, uint64 expectedNonce ) internal { - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSubnetValidatorWeightUpdateMessage( + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( validationID, expectedNonce, expectedValidatorWeight ); _mockGetPChainWarpMessage(setValidatorWeightPayload, true); @@ -1316,8 +1323,9 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { bool includeUptime, bool force ) internal { - bytes memory setValidatorWeightPayload = ValidatorMessages - .packSetSubnetValidatorWeightMessage(validationID, expectedNonce, expectedValidatorWeight); + bytes memory setValidatorWeightPayload = ValidatorMessages.packSubnetValidatorWeightMessage( + validationID, expectedNonce, expectedValidatorWeight + ); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); bytes memory uptimeMsg = ValidatorMessages.packValidationUptimeMessage( validationID, endDelegationTimestamp - startDelegationTimestamp @@ -1460,7 +1468,7 @@ abstract contract PoSValidatorManagerTest is ValidatorManagerTest { uint64 validatorWeight, uint64 expectedNonce ) internal { - bytes memory weightUpdateMessage = ValidatorMessages.packSubnetValidatorWeightUpdateMessage( + bytes memory weightUpdateMessage = ValidatorMessages.packSubnetValidatorWeightMessage( validationID, expectedNonce, validatorWeight ); _mockGetPChainWarpMessage(weightUpdateMessage, true); diff --git a/contracts/validator-manager/tests/ValidatorManagerTests.t.sol b/contracts/validator-manager/tests/ValidatorManagerTests.t.sol index f1623ffa3..6de1e94f5 100644 --- a/contracts/validator-manager/tests/ValidatorManagerTests.t.sol +++ b/contracts/validator-manager/tests/ValidatorManagerTests.t.sol @@ -8,7 +8,11 @@ pragma solidity 0.8.25; import {Test} from "@forge-std/Test.sol"; import {ValidatorManager, SubnetConversionData, InitialValidator} from "../ValidatorManager.sol"; import {ValidatorMessages} from "../ValidatorMessages.sol"; -import {ValidatorStatus, ValidatorRegistrationInput} from "../interfaces/IValidatorManager.sol"; +import { + ValidatorStatus, + ValidatorRegistrationInput, + PChainOwner +} from "../interfaces/IValidatorManager.sol"; import { WarpMessage, IWarpMessenger @@ -19,19 +23,19 @@ import { abstract contract ValidatorManagerTest is Test { bytes32 public constant DEFAULT_SUBNET_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); - bytes32 public constant DEFAULT_NODE_ID = - bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); - bytes32 public constant DEFAULT_INITIAL_VALIDATOR_NODE_ID_1 = - bytes32(hex"2345678123456781234567812345678123456781234567812345678123456781"); - bytes32 public constant DEFAULT_INITIAL_VALIDATOR_NODE_ID_2 = - bytes32(hex"1345678123456781234567812345678123456781234567812345678123456781"); + bytes public constant DEFAULT_NODE_ID = + bytes(hex"1234567812345678123456781234567812345678123456781234567812345678"); + bytes public constant DEFAULT_INITIAL_VALIDATOR_NODE_ID_1 = + bytes(hex"2345678123456781234567812345678123456781234567812345678123456781"); + bytes public constant DEFAULT_INITIAL_VALIDATOR_NODE_ID_2 = + bytes(hex"1345678123456781234567812345678123456781234567812345678123456781"); bytes public constant DEFAULT_BLS_PUBLIC_KEY = bytes( hex"123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" ); bytes32 public constant DEFAULT_SOURCE_BLOCKCHAIN_ID = bytes32(hex"abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd"); - bytes32 public constant DEFAULT_SUBNET_CONVERSION_TX_ID = - bytes32(hex"b4836b329538fa9ca7b5bcaabc443ade2b4825246455c5c3932672d083f6b976"); + bytes32 public constant DEFAULT_SUBNET_CONVERSION_ID = + bytes32(hex"76a386628f079b7b00452f8cab0925740363fcd52b721a8cf91773e857327b36"); address public constant WARP_PRECOMPILE_ADDRESS = 0x0200000000000000000000000000000000000005; uint64 public constant DEFAULT_WEIGHT = 1e6; @@ -46,6 +50,8 @@ abstract contract ValidatorManagerTest is Test { uint64 public constant DEFAULT_REGISTRATION_TIMESTAMP = 1000; uint256 public constant DEFAULT_STARTING_TOTAL_WEIGHT = 1e10 + DEFAULT_WEIGHT; uint64 public constant DEFAULT_COMPLETION_TIMESTAMP = 100_000; + // solhint-disable-next-line var-name-mixedcase + PChainOwner public DEFAULT_P_CHAIN_OWNER; ValidatorManager public validatorManager; @@ -54,7 +60,7 @@ abstract contract ValidatorManagerTest is Test { event ValidationPeriodCreated( bytes32 indexed validationID, - bytes32 indexed nodeID, + bytes indexed nodeID, bytes32 indexed registerValidationMessageID, uint256 weight, uint64 registrationExpiry @@ -76,6 +82,12 @@ abstract contract ValidatorManagerTest is Test { receive() external payable {} fallback() external payable {} + function setUp() public virtual { + address[] memory addresses = new address[](1); + addresses[0] = 0x1234567812345678123456781234567812345678; + DEFAULT_P_CHAIN_OWNER = PChainOwner({threshold: 1, addresses: addresses}); + } + function testInitializeValidatorRegistrationSuccess() public { _setUpInitializeValidatorRegistration( DEFAULT_NODE_ID, @@ -102,6 +114,71 @@ abstract contract ValidatorManagerTest is Test { // TODO: implement } + function testInitializeValidatorRegistrationPChainOwnerThresholdTooLarge() public { + // Threshold too large + address[] memory addresses = new address[](1); + addresses[0] = 0x1234567812345678123456781234567812345678; + PChainOwner memory invalidPChainOwner1 = PChainOwner({threshold: 2, addresses: addresses}); + _beforeSend(_weightToValue(DEFAULT_WEIGHT), address(this)); + vm.expectRevert( + abi.encodeWithSelector(ValidatorManager.InvalidPChainOwnerThreshold.selector, 2, 1) + ); + _initializeValidatorRegistration( + ValidatorRegistrationInput({ + nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + remainingBalanceOwner: invalidPChainOwner1, + disableOwner: DEFAULT_P_CHAIN_OWNER, + registrationExpiry: DEFAULT_EXPIRY + }), + DEFAULT_WEIGHT + ); + } + + function testInitializeValidatorRegistrationZeroPChainOwnerThreshold() public { + // Zero threshold for non-zero address + address[] memory addresses = new address[](1); + addresses[0] = 0x1234567812345678123456781234567812345678; + PChainOwner memory invalidPChainOwner1 = PChainOwner({threshold: 0, addresses: addresses}); + _beforeSend(_weightToValue(DEFAULT_WEIGHT), address(this)); + vm.expectRevert( + abi.encodeWithSelector(ValidatorManager.InvalidPChainOwnerThreshold.selector, 0, 1) + ); + _initializeValidatorRegistration( + ValidatorRegistrationInput({ + nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + remainingBalanceOwner: invalidPChainOwner1, + disableOwner: DEFAULT_P_CHAIN_OWNER, + registrationExpiry: DEFAULT_EXPIRY + }), + DEFAULT_WEIGHT + ); + } + + function testInitializeValidatorRegistrationPChainOwnerAddressesUnsorted() public { + // Addresses not sorted + address[] memory addresses = new address[](2); + addresses[0] = 0x1234567812345678123456781234567812345678; + addresses[1] = 0x0123456781234567812345678123456781234567; + PChainOwner memory invalidPChainOwner1 = PChainOwner({threshold: 1, addresses: addresses}); + + _beforeSend(_weightToValue(DEFAULT_WEIGHT), address(this)); + vm.expectRevert( + abi.encodeWithSelector(ValidatorManager.PChainOwnerAddressesNotSorted.selector) + ); + _initializeValidatorRegistration( + ValidatorRegistrationInput({ + nodeID: DEFAULT_NODE_ID, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + remainingBalanceOwner: invalidPChainOwner1, + disableOwner: DEFAULT_P_CHAIN_OWNER, + registrationExpiry: DEFAULT_EXPIRY + }), + DEFAULT_WEIGHT + ); + } + // The following tests call functions that are implemented in ValidatorManager, but access state that's // only set in NativeTokenValidatorManager. Therefore we call them via the concrete type, rather than a // reference to the abstract type. @@ -118,9 +195,11 @@ abstract contract ValidatorManagerTest is Test { ValidatorMessages.ValidationPeriod({ subnetID: DEFAULT_SUBNET_ID, nodeID: DEFAULT_NODE_ID, - weight: DEFAULT_WEIGHT, + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + weight: DEFAULT_WEIGHT }) ); _mockSendWarpMessage(registerSubnetValidatorMessage, bytes32(0)); @@ -155,7 +234,7 @@ abstract contract ValidatorManagerTest is Test { }); bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, 1, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, 1, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); validatorManager.resendEndValidatorMessage(validationID); } @@ -201,7 +280,7 @@ abstract contract ValidatorManagerTest is Test { validatorManager.completeEndValidation(0); } - function testCummulativeChurnRegistration() public { + function testCumulativeChurnRegistration() public { uint64 churnThreshold = uint64(DEFAULT_STARTING_TOTAL_WEIGHT) * DEFAULT_MAXIMUM_CHURN_PERCENTAGE / 100; _beforeSend(_weightToValue(churnThreshold), address(this)); @@ -228,14 +307,16 @@ abstract contract ValidatorManagerTest is Test { _initializeValidatorRegistration( ValidatorRegistrationInput({ nodeID: DEFAULT_NODE_ID, - registrationExpiry: DEFAULT_REGISTRATION_TIMESTAMP + 1, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + registrationExpiry: DEFAULT_REGISTRATION_TIMESTAMP + 1 }), _valueToWeight(DEFAULT_MINIMUM_STAKE_AMOUNT) ); } - function testCummulativeChurnRegistrationAndEndValidation() public { + function testCumulativeChurnRegistrationAndEndValidation() public { // Registration should succeed bytes32 validationID = _registerValidator({ nodeID: DEFAULT_NODE_ID, @@ -279,13 +360,13 @@ abstract contract ValidatorManagerTest is Test { ); } - function _newNodeID() internal returns (bytes32) { + function _newNodeID() internal returns (bytes memory) { nodeIDCounter++; - return sha256(new bytes(nodeIDCounter)); + return abi.encodePacked(sha256(new bytes(nodeIDCounter))); } function _setUpInitializeValidatorRegistration( - bytes32 nodeID, + bytes memory nodeID, bytes32 subnetID, uint64 weight, uint64 registrationExpiry, @@ -295,9 +376,11 @@ abstract contract ValidatorManagerTest is Test { ValidatorMessages.ValidationPeriod({ nodeID: nodeID, subnetID: subnetID, - weight: weight, + blsPublicKey: blsPublicKey, registrationExpiry: registrationExpiry, - blsPublicKey: blsPublicKey + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + weight: weight }) ); (, bytes memory registerSubnetValidatorMessage) = ValidatorMessages @@ -305,9 +388,11 @@ abstract contract ValidatorManagerTest is Test { ValidatorMessages.ValidationPeriod({ subnetID: subnetID, nodeID: nodeID, - weight: weight, + blsPublicKey: blsPublicKey, registrationExpiry: registrationExpiry, - blsPublicKey: blsPublicKey + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + weight: weight }) ); vm.warp(registrationExpiry - 1); @@ -320,15 +405,17 @@ abstract contract ValidatorManagerTest is Test { _initializeValidatorRegistration( ValidatorRegistrationInput({ nodeID: nodeID, - registrationExpiry: registrationExpiry, - blsPublicKey: blsPublicKey + blsPublicKey: blsPublicKey, + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + registrationExpiry: registrationExpiry }), weight ); } function _registerValidator( - bytes32 nodeID, + bytes memory nodeID, bytes32 subnetID, uint64 weight, uint64 registrationExpiry, @@ -359,7 +446,7 @@ abstract contract ValidatorManagerTest is Test { bool force ) internal { bytes memory setValidatorWeightPayload = - ValidatorMessages.packSetSubnetValidatorWeightMessage(validationID, expectedNonce, 0); + ValidatorMessages.packSubnetValidatorWeightMessage(validationID, expectedNonce, 0); _mockSendWarpMessage(setValidatorWeightPayload, bytes32(0)); if (includeUptime) { @@ -453,7 +540,7 @@ abstract contract ValidatorManagerTest is Test { function _mockInitializeValidatorSet() internal { _mockGetPChainWarpMessage( - ValidatorMessages.packSubnetConversionMessage(DEFAULT_SUBNET_CONVERSION_TX_ID), true + ValidatorMessages.packSubnetConversionMessage(DEFAULT_SUBNET_CONVERSION_ID), true ); } @@ -487,7 +574,7 @@ abstract contract ValidatorManagerTest is Test { blsPublicKey: DEFAULT_BLS_PUBLIC_KEY }); return SubnetConversionData({ - convertSubnetTxID: bytes32(0), + subnetID: DEFAULT_SUBNET_ID, validatorManagerBlockchainID: DEFAULT_SOURCE_BLOCKCHAIN_ID, validatorManagerAddress: address(validatorManager), initialValidators: initialValidators diff --git a/contracts/validator-manager/tests/ValidatorMessagesTests.t.sol b/contracts/validator-manager/tests/ValidatorMessagesTests.t.sol index b8fb9e1a2..12fe198c9 100644 --- a/contracts/validator-manager/tests/ValidatorMessagesTests.t.sol +++ b/contracts/validator-manager/tests/ValidatorMessagesTests.t.sol @@ -7,12 +7,13 @@ pragma solidity 0.8.25; import {Test} from "@forge-std/Test.sol"; import {ValidatorMessages} from "../ValidatorMessages.sol"; +import {PChainOwner} from "../interfaces/IValidatorManager.sol"; contract ValidatorMessagesTest is Test { bytes32 public constant DEFAULT_SUBNET_ID = bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); - bytes32 public constant DEFAULT_NODE_ID = - bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); + bytes public constant DEFAULT_NODE_ID = + bytes(hex"1234567812345678123456781234567812345678123456781234567812345678"); bytes public constant DEFAULT_BLS_PUBLIC_KEY = bytes( hex"123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678" ); @@ -20,16 +21,26 @@ contract ValidatorMessagesTest is Test { bytes32(hex"1234567812345678123456781234567812345678123456781234567812345678"); uint64 public constant DEFAULT_WEIGHT = 1e6; uint64 public constant DEFAULT_EXPIRY = 1000; + // solhint-disable-next-line var-name-mixedcase + PChainOwner public DEFAULT_P_CHAIN_OWNER; + + function setUp() public { + address[] memory addresses = new address[](1); + addresses[0] = 0x1234567812345678123456781234567812345678; + DEFAULT_P_CHAIN_OWNER = PChainOwner({threshold: 1, addresses: addresses}); + } - function testRegisterSubnetValidatorMessage() public pure { + function testRegisterSubnetValidatorMessage() public view { (bytes32 validationID, bytes memory packed) = ValidatorMessages .packRegisterSubnetValidatorMessage( ValidatorMessages.ValidationPeriod({ subnetID: DEFAULT_SUBNET_ID, nodeID: DEFAULT_NODE_ID, - weight: DEFAULT_WEIGHT, registrationExpiry: DEFAULT_EXPIRY, - blsPublicKey: DEFAULT_BLS_PUBLIC_KEY + blsPublicKey: DEFAULT_BLS_PUBLIC_KEY, + remainingBalanceOwner: DEFAULT_P_CHAIN_OWNER, + disableOwner: DEFAULT_P_CHAIN_OWNER, + weight: DEFAULT_WEIGHT }) ); @@ -55,22 +66,22 @@ contract ValidatorMessagesTest is Test { } function testSetSubnetValidatorWeightMessage() public pure { - bytes memory packed = ValidatorMessages.packSetSubnetValidatorWeightMessage( + bytes memory packed = ValidatorMessages.packSubnetValidatorWeightMessage( DEFAULT_VALIDATION_ID, 100, DEFAULT_WEIGHT ); (bytes32 validationID, uint64 nonce, uint64 weight) = - ValidatorMessages.unpackSetSubnetValidatorWeightMessage(packed); + ValidatorMessages.unpackSubnetValidatorWeightMessage(packed); assertEq(validationID, DEFAULT_VALIDATION_ID); assertEq(nonce, 100); assertEq(weight, DEFAULT_WEIGHT); } function testSubnetValidatorWeightUpdateMessag() public pure { - bytes memory packed = ValidatorMessages.packSubnetValidatorWeightUpdateMessage( + bytes memory packed = ValidatorMessages.packSubnetValidatorWeightMessage( DEFAULT_VALIDATION_ID, 100, DEFAULT_WEIGHT ); (bytes32 validationID, uint64 nonce, uint64 weight) = - ValidatorMessages.unpackSubnetValidatorWeightUpdateMessage(packed); + ValidatorMessages.unpackSubnetValidatorWeightMessage(packed); assertEq(validationID, DEFAULT_VALIDATION_ID); assertEq(nonce, 100); assertEq(weight, DEFAULT_WEIGHT); diff --git a/go.mod b/go.mod index 48a903314..e1679544d 100644 --- a/go.mod +++ b/go.mod @@ -3,29 +3,30 @@ module github.com/ava-labs/teleporter go 1.22.8 require ( - github.com/ava-labs/avalanchego v1.11.11-0.20240916181957-b328a0503042 + github.com/ava-labs/avalanchego v1.12.0-initial-poc.5 github.com/supranational/blst v0.3.11 // indirect ) require ( - github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12 - github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc - github.com/ethereum/go-ethereum v1.13.8 + github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6 + github.com/ava-labs/subnet-evm v0.6.10 + github.com/ethereum/go-ethereum v1.13.14 github.com/onsi/ginkgo/v2 v2.20.2 github.com/onsi/gomega v1.34.2 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.19.1 + github.com/prometheus/client_golang v1.20.4 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 golang.org/x/tools v0.26.0 + google.golang.org/protobuf v1.35.1 ) require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect - github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade // indirect + github.com/ava-labs/coreth v0.13.8 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect @@ -68,11 +69,12 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/rpc v1.2.0 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect github.com/hashicorp/go-bexpr v0.1.10 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect @@ -81,7 +83,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackpal/gateway v1.0.6 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/klauspost/compress v1.15.15 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -92,14 +94,16 @@ require ( github.com/mitchellh/pointerstructure v1.2.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mr-tron/base58 v1.2.0 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pingcap/errors v0.11.4 // indirect github.com/pires/go-proxyproto v0.6.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.48.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/rs/cors v1.7.0 // indirect @@ -139,10 +143,9 @@ require ( golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.3.0 // indirect gonum.org/v1/gonum v0.11.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect - google.golang.org/grpc v1.65.0 // indirect - google.golang.org/protobuf v1.34.2 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/grpc v1.67.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 31fb82f7f..761e8a12c 100644 --- a/go.sum +++ b/go.sum @@ -56,14 +56,14 @@ github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/ava-labs/avalanchego v1.11.11-0.20240916181957-b328a0503042 h1:Hk9sK9TPPXoVyIvl4rC+v1HF2M2BvjINCLtLmkbqWMo= -github.com/ava-labs/avalanchego v1.11.11-0.20240916181957-b328a0503042/go.mod h1:8pnf2At/q0LRq5dvYJYn3CkhKzZNHRd5pjARC9psu+g= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12 h1:vcCa4wZTDPObQFauhjtkAqbHWty3vXQaoPJMFgptnWM= -github.com/ava-labs/awm-relayer v1.4.0-rc.2.0.20240814200841-1c435873fd12/go.mod h1:cpfI3E4g0NsEjhJ9VHJ4xMLyOOAqqL1by0MhTIito/c= -github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade h1:xWsvSGtZcGna3B2BLU2BvK3qskbcc9ZNtgC0ck91CkI= -github.com/ava-labs/coreth v0.13.8-fix-genesis-upgrade/go.mod h1:Ouul9dJouniUIJVX1gDqx8CrHyGvmwZkK28mrgKb/4I= -github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc h1:FZ09oIkRnrI+FLTReCKfWqNHFDrNQVr629NTkdfr22Y= -github.com/ava-labs/subnet-evm v0.6.9-0.20240813192818-4d5aebb6decc/go.mod h1:nWP5feXpdvF4Kv10V0vrP9bYqt5yYvp2I5bBXY2xa7U= +github.com/ava-labs/avalanchego v1.12.0-initial-poc.5 h1:gW4xAqZNvkA4gP8M9yDyd7YUzuwfQbbCR+hgd1ztOto= +github.com/ava-labs/avalanchego v1.12.0-initial-poc.5/go.mod h1:qSHmog3wMVjo/ruIAQo0ppXAilyni07NIu5K88RyhWE= +github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6 h1:WdFWoZ8clWfTPp3cKyWYTsveMKW/0SQzWk8U1aCcdnw= +github.com/ava-labs/awm-relayer v1.4.1-0.20241010161724-2db445c994d6/go.mod h1:6eqh3V1Og40gXmZUOP6tCrlmMEcVuj9l737yYh1s8uw= +github.com/ava-labs/coreth v0.13.8 h1:f14X3KgwHl9LwzfxlN6S4bbn5VA2rhEsNnHaRLSTo/8= +github.com/ava-labs/coreth v0.13.8/go.mod h1:t3BSv/eQv0AlDPMfEDCMMoD/jq1RkUsbFzQAFg5qBcE= +github.com/ava-labs/subnet-evm v0.6.10 h1:uIh6bFMA4GCMVMQ3agBPxTMlYHL8FBR5FrhMR+drfKI= +github.com/ava-labs/subnet-evm v0.6.10/go.mod h1:dw4kg0o58dvYlndj2ZcwB7hioRc1kjg00yXYrcSmnj8= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -175,8 +175,8 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= -github.com/ethereum/go-ethereum v1.13.8 h1:1od+thJel3tM52ZUNQwvpYOeRHlbkVFZ5S8fhi0Lgsg= -github.com/ethereum/go-ethereum v1.13.8/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA= +github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ= +github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= @@ -234,8 +234,8 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= -github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= +github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -319,8 +319,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk= github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= @@ -332,6 +332,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= @@ -379,8 +381,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -437,6 +439,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= @@ -481,15 +485,15 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= -github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -965,10 +969,10 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -987,8 +991,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1001,8 +1005,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/scripts/local/e2e_test.sh b/scripts/local/e2e_test.sh index f45c931d2..783a898f2 100755 --- a/scripts/local/e2e_test.sh +++ b/scripts/local/e2e_test.sh @@ -9,6 +9,55 @@ TELEPORTER_PATH=$( cd ../.. && pwd ) +function printHelp() { + echo "Usage: ./scripts/local/e2e_test.sh [--component component]" + echo "" + printUsage +} + +function printUsage() { + cat << EOF +Arguments: + --components component1,component2 Comma separated list of test suites to run. Valid components are: + $(echo $valid_components | tr ' ' '\n' | sort | tr '\n' ' ') + (default: all) +Options: + --help Print this help message +EOF +} + +valid_components=$(ls -d $TELEPORTER_PATH/tests/local/*/ | xargs -n 1 basename) +components= + +while [ $# -gt 0 ]; do + case "$1" in + --components) + if [[ $2 != --* ]]; then + components=$2 + else + echo "Invalid components $2" && printHelp && exit 1 + fi + shift;; + --help) + printHelp && exit 0 ;; + *) + echo "Invalid option: $1" && printHelp && exit 1;; + esac + shift +done + +# Run all suites if no component is provided +if [ -z "$components" ]; then + components=$valid_components +fi + +# Exit if invalid component is provided +for component in $(echo $components | tr ',' ' '); do + if [[ $valid_components != *$component* ]]; then + echo "Invalid component $component" && exit 1 + fi +done + source "$TELEPORTER_PATH"/scripts/constants.sh source "$TELEPORTER_PATH"/scripts/versions.sh @@ -38,15 +87,18 @@ cd "$TELEPORTER_PATH" # to install the ginkgo binary (required for test build and run) go install -v github.com/onsi/ginkgo/v2/ginkgo@${GINKGO_VERSION} -ginkgo build ./tests/local/ +for component in $(echo $components | tr ',' ' '); do + echo "Building e2e tests for $component" + ginkgo build ./tests/local/$component -# Run the tests -echo "Running e2e tests $RUN_E2E" -RUN_E2E=true ./tests/local/local.test \ - --ginkgo.vv \ - --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} \ - --ginkgo.focus=${GINKGO_FOCUS:-""} \ - --ginkgo.trace + echo "Running e2e tests for $component" + RUN_E2E=true ./tests/local/$component/$component.test \ + --ginkgo.vv \ + --ginkgo.label-filter=${GINKGO_LABEL_FILTER:-""} \ + --ginkgo.focus=${GINKGO_FOCUS:-""} \ + --ginkgo.trace -echo "e2e tests passed" + echo "$component e2e tests passed" + echo "" +done exit 0 diff --git a/scripts/versions.sh b/scripts/versions.sh index fe3fbd81a..efe3fb248 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -18,9 +18,13 @@ function getDepVersion() { function extract_commit() { local version=$1 - if [[ $version == *-* ]]; then + + # Regex for a commit hash (assumed to be a 12+ character hex string) + commit_hash_regex="-([0-9a-f]{12,})$" + + if [[ "$version" =~ $commit_hash_regex ]]; then # Extract the substring after the last '-' - version=${version##*-} + version=${BASH_REMATCH[1]} fi echo "$version" } diff --git a/tests/flows/governance/validator_set_sig.go b/tests/flows/governance/validator_set_sig.go index c715c02f3..cb32a09e8 100644 --- a/tests/flows/governance/validator_set_sig.go +++ b/tests/flows/governance/validator_set_sig.go @@ -143,7 +143,7 @@ func ValidatorSetSig(network interfaces.LocalNetwork) { network.SetChainConfigs(chainConfigs) restartCtx, cancel := context.WithTimeout(ctx, time.Second*30) defer cancel() - network.RestartNodes(restartCtx, network.GetAllNodeIDs()) + network.RestartNodes(restartCtx, nil) // ************************************************************************************************ // Test Case 1: validatorChain (subnetB) != targetChain (subnetA) diff --git a/tests/flows/teleporter/registry/teleporter_registry.go b/tests/flows/teleporter/registry/teleporter_registry.go index bca4de651..d6d6c14dc 100644 --- a/tests/flows/teleporter/registry/teleporter_registry.go +++ b/tests/flows/teleporter/registry/teleporter_registry.go @@ -79,7 +79,7 @@ func TeleporterRegistry(network interfaces.LocalNetwork) { network.SetChainConfigs(chainConfigs) restartCtx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() - network.RestartNodes(restartCtx, network.GetAllNodeIDs()) + network.RestartNodes(restartCtx, nil) // Call addProtocolVersion on subnetB to register the new Teleporter version utils.AddProtocolVersionAndWaitForAcceptance( diff --git a/tests/flows/teleporter/relayer_modifies_message.go b/tests/flows/teleporter/relayer_modifies_message.go index 4011ebc6f..df9a77d43 100644 --- a/tests/flows/teleporter/relayer_modifies_message.go +++ b/tests/flows/teleporter/relayer_modifies_message.go @@ -71,7 +71,7 @@ func relayAlteredMessage( sendEvent, err := utils.GetEventFromLogs(sourceReceipt.Logs, source.TeleporterMessenger.ParseSendCrossChainMessage) Expect(err).Should(BeNil()) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination) + signedWarpMessage := utils.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination) // Construct the transaction to send the Warp message to the destination chain _, fundedKey := network.GetFundedAccountInfo() diff --git a/tests/flows/teleporter/validator_churn.go b/tests/flows/teleporter/validator_churn.go index 2f84c7552..8737c8770 100644 --- a/tests/flows/teleporter/validator_churn.go +++ b/tests/flows/teleporter/validator_churn.go @@ -53,7 +53,7 @@ func ValidatorChurn(network interfaces.LocalNetwork) { sentTeleporterMessage := sendEvent.Message // Construct the signed warp message - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetAInfo, subnetBInfo) + signedWarpMessage := utils.ConstructSignedWarpMessage(ctx, receipt, subnetAInfo, subnetBInfo) // // Modify the validator set on Subnet A diff --git a/tests/flows/validator-manager/erc20_delegation.go b/tests/flows/validator-manager/erc20_delegation.go deleted file mode 100644 index e8323de05..000000000 --- a/tests/flows/validator-manager/erc20_delegation.go +++ /dev/null @@ -1,215 +0,0 @@ -package staking - -import ( - "context" - "math/big" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" - "github.com/ava-labs/teleporter/tests/interfaces" - "github.com/ava-labs/teleporter/tests/utils" - . "github.com/onsi/gomega" -) - -/* - * Registers a delegator with an ERC20 token staking validator on a subnet. The steps are as follows: - * - Deploy the ERCTokenStakingManager - * - Register a validator - * - Register a delegator - * - Deleist the delegator - * - * TODO: as delegation gets built out, this test will need to be updated to cover: - * - Delegator rewards - * - Implicit delegation end at validation end - */ -func ERC20Delegation(network interfaces.LocalNetwork) { - // Get the subnets info - cChainInfo := network.GetPrimaryNetworkInfo() - subnetAInfo, _ := utils.GetTwoSubnets(network) - _, fundedKey := network.GetFundedAccountInfo() - pChainInfo := utils.GetPChainInfo(cChainInfo) - - signatureAggregator := utils.NewSignatureAggregator( - cChainInfo.NodeURIs[0], - []ids.ID{ - subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID - }, - ) - ctx := context.Background() - - // Deploy the staking manager contract - stakingManagerAddress, stakingManager, _, erc20 := utils.DeployAndInitializeERC20TokenStakingManager( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - ) - - _ = utils.InitializeERC20TokenValidatorSet( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - stakingManager, - stakingManagerAddress, - network, - signatureAggregator, - utils.DefaultMinStakeAmount*10, - ) - - // - // Register a validator - // - var validationID ids.ID // To be used in the delisting step - validatorStake := new(big.Int).SetUint64(utils.DefaultMinStakeAmount) - validatorWeight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - validatorStake, - ) - Expect(err).Should(BeNil()) - validationID = utils.InitializeAndCompleteERC20ValidatorRegistration( - ctx, - network, - signatureAggregator, - fundedKey, - subnetAInfo, - pChainInfo, - stakingManager, - stakingManagerAddress, - erc20, - validatorStake, - ) - - // - // Register a delegator - // - var delegationID ids.ID - { - delegatorStake := big.NewInt(1e17) - delegatorWeight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - delegatorStake, - ) - Expect(err).Should(BeNil()) - newValidatorWeight := validatorWeight + delegatorWeight - - nonce := uint64(1) - - receipt := utils.InitializeERC20DelegatorRegistration( - ctx, - fundedKey, - subnetAInfo, - validationID, - delegatorStake, - erc20, - stakingManagerAddress, - stakingManager, - ) - initRegistrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorAdded, - ) - Expect(err).Should(BeNil()) - delegationID = initRegistrationEvent.DelegationID - - // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - - // Validate the Warp message, (this will be done on the P-Chain in the future) - utils.ValidateSetSubnetValidatorWeightMessage( - signedWarpMessage, - validationID, - newValidatorWeight, - nonce, - ) - - // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain - registrationSignedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( - validationID, - nonce, - newValidatorWeight, - subnetAInfo, - pChainInfo, - network, - signatureAggregator, - ) - - // Deliver the Warp message to the subnet - receipt = utils.CompleteERC20DelegatorRegistration( - ctx, - fundedKey, - delegationID, - subnetAInfo, - stakingManagerAddress, - registrationSignedMessage, - ) - // Check that the validator is registered in the staking contract - registrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorRegistered, - ) - Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) - } - // - // Delist the delegator - // - { - nonce := uint64(2) - receipt := utils.InitializeEndERC20Delegation( - ctx, - fundedKey, - subnetAInfo, - stakingManager, - delegationID, - ) - delegatorRemovalEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorRemovalInitialized, - ) - Expect(err).Should(BeNil()) - Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) - - // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - Expect(err).Should(BeNil()) - - // Validate the Warp message, (this will be done on the P-Chain in the future) - utils.ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, validatorWeight, 2) - - // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain - signedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( - validationID, - nonce, - validatorWeight, - subnetAInfo, - pChainInfo, - network, - signatureAggregator, - ) - - // Deliver the Warp message to the subnet - receipt = utils.CompleteEndERC20Delegation( - ctx, - fundedKey, - delegationID, - subnetAInfo, - stakingManagerAddress, - signedMessage, - ) - - // Check that the delegator has been delisted from the staking contract - registrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegationEnded, - ) - Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) - } -} diff --git a/tests/flows/validator-manager/erc20_token_staking.go b/tests/flows/validator-manager/erc20_token_staking.go index 6b2465f4d..b720b475b 100644 --- a/tests/flows/validator-manager/erc20_token_staking.go +++ b/tests/flows/validator-manager/erc20_token_staking.go @@ -2,7 +2,9 @@ package staking import ( "context" + "log" "math/big" + "time" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/subnet-evm/accounts/abi/bind" @@ -38,7 +40,6 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { cChainInfo.NodeURIs[0], []ids.ID{ subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID }, ) ctx := context.Background() @@ -51,7 +52,17 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { pChainInfo, ) - _ = utils.InitializeERC20TokenValidatorSet( + nodes := utils.ConvertSubnet( + ctx, + subnetAInfo, + network, + stakingManagerAddress, + fundedKey, + ) + + // Initialize the validator set on the subnet + log.Println("Initializing validator set") + initialValidationIDs := utils.InitializeERC20TokenValidatorSet( ctx, fundedKey, subnetAInfo, @@ -60,18 +71,30 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { stakingManagerAddress, network, signatureAggregator, - utils.DefaultMinStakeAmount*10, + nodes, ) // - // Register a validator + // Delist one initial validator // - stakeAmount := new(big.Int).SetUint64(utils.DefaultMinStakeAmount) - weight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - stakeAmount, + utils.InitializeAndCompleteEndInitialERC20Validation( + ctx, + network, + signatureAggregator, + fundedKey, + subnetAInfo, + pChainInfo, + stakingManager, + stakingManagerAddress, + initialValidationIDs[0], + 0, + nodes[0].Weight, ) - Expect(err).Should(BeNil()) + + // + // Register the validator as PoS + // + expiry := uint64(time.Now().Add(24 * time.Hour).Unix()) validationID := utils.InitializeAndCompleteERC20ValidatorRegistration( ctx, network, @@ -82,9 +105,148 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { stakingManager, stakingManagerAddress, erc20, - stakeAmount, + expiry, + nodes[0], ) + // + // Register a delegator + // + var delegationID ids.ID + { + log.Println("Registering delegator") + delegatorStake, err := stakingManager.WeightToValue( + &bind.CallOpts{}, + nodes[0].Weight, + ) + Expect(err).Should(BeNil()) + delegatorStake.Div(delegatorStake, big.NewInt(10)) + delegatorWeight, err := stakingManager.ValueToWeight( + &bind.CallOpts{}, + delegatorStake, + ) + Expect(err).Should(BeNil()) + newValidatorWeight := nodes[0].Weight + delegatorWeight + + nonce := uint64(1) + + receipt := utils.InitializeERC20DelegatorRegistration( + ctx, + fundedKey, + subnetAInfo, + validationID, + delegatorStake, + erc20, + stakingManagerAddress, + stakingManager, + ) + initRegistrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorAdded, + ) + Expect(err).Should(BeNil()) + delegationID = initRegistrationEvent.DelegationID + + // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain + signedWarpMessage := utils.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + + // Issue a tx to update the validator's weight on the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + utils.PChainProposerVMWorkaround(network) + utils.AdvanceProposerVM(ctx, subnetAInfo, fundedKey, 5) + + // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain + registrationSignedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( + validationID, + nonce, + newValidatorWeight, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CompleteERC20DelegatorRegistration( + ctx, + fundedKey, + delegationID, + subnetAInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorRegistered, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) + } + + // + // Delist the delegator + // + { + log.Println("Delisting delegator") + nonce := uint64(2) + receipt := utils.InitializeEndERC20Delegation( + ctx, + fundedKey, + subnetAInfo, + stakingManager, + delegationID, + ) + delegatorRemovalEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := utils.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + + // Issue a tx to update the validator's weight on the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + utils.PChainProposerVMWorkaround(network) + utils.AdvanceProposerVM(ctx, subnetAInfo, fundedKey, 5) + + // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain + signedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( + validationID, + nonce, + nodes[0].Weight, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CompleteEndERC20Delegation( + ctx, + fundedKey, + delegationID, + subnetAInfo, + stakingManagerAddress, + signedMessage, + ) + + // Check that the delegator has been delisted from the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegationEnded, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) + } + // // Delist the validator // @@ -98,7 +260,8 @@ func ERC20TokenStakingManager(network interfaces.LocalNetwork) { stakingManager, stakingManagerAddress, validationID, - weight, + expiry, + nodes[0], 1, ) } diff --git a/tests/flows/validator-manager/native_delegation.go b/tests/flows/validator-manager/native_delegation.go deleted file mode 100644 index 952852abc..000000000 --- a/tests/flows/validator-manager/native_delegation.go +++ /dev/null @@ -1,215 +0,0 @@ -package staking - -import ( - "context" - "math/big" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" - "github.com/ava-labs/teleporter/tests/interfaces" - "github.com/ava-labs/teleporter/tests/utils" - . "github.com/onsi/gomega" -) - -/* - * Registers a delegator with a native token staking validator on a subnet. The steps are as follows: - * - Deploy the NativeTokenStakingManager - * - Register a validator - * - Register a delegator - * - Deleist the delegator - * - * TODO: as delegation gets built out, this test will need to be updated to cover: - * - Delegator rewards - * - Implicit delegation end at validation end - */ -func NativeDelegation(network interfaces.LocalNetwork) { - // Get the subnets info - cChainInfo := network.GetPrimaryNetworkInfo() - subnetAInfo, _ := utils.GetTwoSubnets(network) - _, fundedKey := network.GetFundedAccountInfo() - pChainInfo := utils.GetPChainInfo(cChainInfo) - - signatureAggregator := utils.NewSignatureAggregator( - cChainInfo.NodeURIs[0], - []ids.ID{ - subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID - }, - ) - ctx := context.Background() - - // Deploy the staking manager contract - stakingManagerAddress, stakingManager := utils.DeployAndInitializeNativeTokenStakingManager( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - ) - - utils.AddNativeMinterAdmin(ctx, subnetAInfo, fundedKey, stakingManagerAddress) - - _ = utils.InitializeNativeTokenValidatorSet( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - stakingManager, - stakingManagerAddress, - network, - signatureAggregator, - utils.DefaultMinStakeAmount*10, - ) - - // - // Register a validator - // - var validationID ids.ID // To be used in the delisting step - validatorStake := new(big.Int).SetUint64(utils.DefaultMinStakeAmount) - validatorWeight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - validatorStake, - ) - Expect(err).Should(BeNil()) - stakeAmount := new(big.Int).SetUint64(utils.DefaultMinStakeAmount) - validationID = utils.InitializeAndCompleteNativeValidatorRegistration( - ctx, - network, - signatureAggregator, - fundedKey, - subnetAInfo, - pChainInfo, - stakingManager, - stakingManagerAddress, - stakeAmount, - ) - // - // Register a delegator - // - var delegationID ids.ID - { - delegatorStake := big.NewInt(1e17) - delegatorWeight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - delegatorStake, - ) - Expect(err).Should(BeNil()) - newValidatorWeight := validatorWeight + delegatorWeight - - nonce := uint64(1) - - receipt := utils.InitializeNativeDelegatorRegistration( - ctx, - fundedKey, - subnetAInfo, - validationID, - delegatorStake, - stakingManagerAddress, - stakingManager, - ) - initRegistrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorAdded, - ) - Expect(err).Should(BeNil()) - delegationID = initRegistrationEvent.DelegationID - - // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - - // Validate the Warp message, (this will be done on the P-Chain in the future) - utils.ValidateSetSubnetValidatorWeightMessage( - signedWarpMessage, - validationID, - newValidatorWeight, - nonce, - ) - - // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain - registrationSignedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( - validationID, - nonce, - newValidatorWeight, - subnetAInfo, - pChainInfo, - network, - signatureAggregator, - ) - - // Deliver the Warp message to the subnet - receipt = utils.CompleteNativeDelegatorRegistration( - ctx, - fundedKey, - delegationID, - subnetAInfo, - stakingManagerAddress, - registrationSignedMessage, - ) - // Check that the validator is registered in the staking contract - registrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorRegistered, - ) - Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) - } - // - // Delist the delegator - // - { - nonce := uint64(2) - receipt := utils.InitializeEndNativeDelegation( - ctx, - fundedKey, - subnetAInfo, - stakingManager, - delegationID, - ) - delegatorRemovalEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegatorRemovalInitialized, - ) - Expect(err).Should(BeNil()) - Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) - - // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) - Expect(err).Should(BeNil()) - - // Validate the Warp message, (this will be done on the P-Chain in the future) - utils.ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, validatorWeight, 2) - - // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain - signedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( - validationID, - nonce, - validatorWeight, - subnetAInfo, - pChainInfo, - network, - signatureAggregator, - ) - - // Deliver the Warp message to the subnet - receipt = utils.CompleteEndNativeDelegation( - ctx, - fundedKey, - delegationID, - subnetAInfo, - stakingManagerAddress, - signedMessage, - ) - - // Check that the delegator has been delisted from the staking contract - registrationEvent, err := utils.GetEventFromLogs( - receipt.Logs, - stakingManager.ParseDelegationEnded, - ) - Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) - Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) - } -} diff --git a/tests/flows/validator-manager/native_token_staking.go b/tests/flows/validator-manager/native_token_staking.go index f5035097f..80a7961b0 100644 --- a/tests/flows/validator-manager/native_token_staking.go +++ b/tests/flows/validator-manager/native_token_staking.go @@ -2,7 +2,9 @@ package staking import ( "context" + "log" "math/big" + "time" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/subnet-evm/accounts/abi/bind" @@ -38,43 +40,63 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { cChainInfo.NodeURIs[0], []ids.ID{ subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID }, ) ctx := context.Background() // Deploy the staking manager contract - stakingManagerContractAddress, stakingManager := utils.DeployAndInitializeNativeTokenStakingManager( + stakingManagerAddress, stakingManager := utils.DeployAndInitializeNativeTokenStakingManager( ctx, fundedKey, subnetAInfo, pChainInfo, ) - utils.AddNativeMinterAdmin(ctx, subnetAInfo, fundedKey, stakingManagerContractAddress) + utils.AddNativeMinterAdmin(ctx, subnetAInfo, fundedKey, stakingManagerAddress) - _ = utils.InitializeNativeTokenValidatorSet( + nodes := utils.ConvertSubnet( + ctx, + subnetAInfo, + network, + stakingManagerAddress, + fundedKey, + ) + + // Initialize the validator set on the subnet + log.Println("Initializing validator set") + initialValidationIDs := utils.InitializeNativeTokenValidatorSet( ctx, fundedKey, subnetAInfo, pChainInfo, stakingManager, - stakingManagerContractAddress, + stakingManagerAddress, network, signatureAggregator, - utils.DefaultMinStakeAmount*10, + nodes, ) // - // Register a validator + // Delist one initial validator // - stakeAmount := new(big.Int).SetUint64(utils.DefaultMinStakeAmount) - weight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - stakeAmount, + utils.InitializeAndCompleteEndInitialNativeValidation( + ctx, + network, + signatureAggregator, + fundedKey, + subnetAInfo, + pChainInfo, + stakingManager, + stakingManagerAddress, + initialValidationIDs[0], + 0, + nodes[0].Weight, ) - Expect(err).Should(BeNil()) - // Iniatiate validator registration + + // + // Register the validator as PoS + // + expiry := uint64(time.Now().Add(24 * time.Hour).Unix()) validationID := utils.InitializeAndCompleteNativeValidatorRegistration( ctx, network, @@ -83,10 +105,147 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { subnetAInfo, pChainInfo, stakingManager, - stakingManagerContractAddress, - stakeAmount, + stakingManagerAddress, + expiry, + nodes[0], ) + // + // Register a delegator + // + var delegationID ids.ID + { + log.Println("Registering delegator") + delegatorStake, err := stakingManager.WeightToValue( + &bind.CallOpts{}, + nodes[0].Weight, + ) + Expect(err).Should(BeNil()) + delegatorStake.Div(delegatorStake, big.NewInt(10)) + delegatorWeight, err := stakingManager.ValueToWeight( + &bind.CallOpts{}, + delegatorStake, + ) + Expect(err).Should(BeNil()) + newValidatorWeight := nodes[0].Weight + delegatorWeight + + nonce := uint64(1) + + receipt := utils.InitializeNativeDelegatorRegistration( + ctx, + fundedKey, + subnetAInfo, + validationID, + delegatorStake, + stakingManagerAddress, + stakingManager, + ) + initRegistrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorAdded, + ) + Expect(err).Should(BeNil()) + delegationID = initRegistrationEvent.DelegationID + + // Gather subnet-evm Warp signatures for the SubnetValidatorWeightUpdateMessage & relay to the P-Chain + signedWarpMessage := utils.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + + // Issue a tx to update the validator's weight on the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + utils.PChainProposerVMWorkaround(network) + utils.AdvanceProposerVM(ctx, subnetAInfo, fundedKey, 5) + + // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain + registrationSignedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( + validationID, + nonce, + newValidatorWeight, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CompleteNativeDelegatorRegistration( + ctx, + fundedKey, + delegationID, + subnetAInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + // Check that the validator is registered in the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorRegistered, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) + } + // + // Delist the delegator + // + { + log.Println("Delisting delegator") + nonce := uint64(2) + receipt := utils.InitializeEndNativeDelegation( + ctx, + fundedKey, + subnetAInfo, + stakingManager, + delegationID, + ) + delegatorRemovalEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(delegatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(delegatorRemovalEvent.DelegationID[:]).Should(Equal(delegationID[:])) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + signedWarpMessage := utils.ConstructSignedWarpMessage(context.Background(), receipt, subnetAInfo, pChainInfo) + Expect(err).Should(BeNil()) + + // Issue a tx to update the validator's weight on the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + utils.PChainProposerVMWorkaround(network) + utils.AdvanceProposerVM(ctx, subnetAInfo, fundedKey, 5) + + // Construct a SubnetValidatorWeightUpdateMessage Warp message from the P-Chain + signedMessage := utils.ConstructSubnetValidatorWeightUpdateMessage( + validationID, + nonce, + nodes[0].Weight, + subnetAInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = utils.CompleteEndNativeDelegation( + ctx, + fundedKey, + delegationID, + subnetAInfo, + stakingManagerAddress, + signedMessage, + ) + + // Check that the delegator has been delisted from the staking contract + registrationEvent, err := utils.GetEventFromLogs( + receipt.Logs, + stakingManager.ParseDelegationEnded, + ) + Expect(err).Should(BeNil()) + Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(registrationEvent.DelegationID[:]).Should(Equal(delegationID[:])) + } + // // Delist the validator // @@ -98,9 +257,10 @@ func NativeTokenStakingManager(network interfaces.LocalNetwork) { subnetAInfo, pChainInfo, stakingManager, - stakingManagerContractAddress, + stakingManagerAddress, validationID, - weight, + expiry, + nodes[0], 1, ) } diff --git a/tests/flows/validator-manager/poa_to_pos.go b/tests/flows/validator-manager/poa_to_pos.go index 6f50a384b..9cce8b401 100644 --- a/tests/flows/validator-manager/poa_to_pos.go +++ b/tests/flows/validator-manager/poa_to_pos.go @@ -2,7 +2,9 @@ package staking import ( "context" + "log" "math/big" + "time" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/subnet-evm/accounts/abi/bind" @@ -44,7 +46,6 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { cChainInfo.NodeURIs[0], []ids.ID{ subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID }, ) @@ -55,7 +56,8 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { // Transfer native assets to the owner account ctx := context.Background() - fundAmount := big.NewInt(1e18) // 1avax + fundAmount := big.NewInt(1e18) // 10avax + fundAmount.Mul(fundAmount, big.NewInt(10)) utils.SendNativeTransfer( ctx, subnetAInfo, @@ -97,7 +99,17 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) utils.WaitForTransactionSuccess(context.Background(), subnetAInfo, tx.Hash()) - _ = utils.InitializePoAValidatorSet( + nodes := utils.ConvertSubnet( + ctx, + subnetAInfo, + network, + proxyAddress, + fundedKey, + ) + + // Initialize the validator set on the subnet + log.Println("Initializing validator set") + initialValidationIDs := utils.InitializePoAValidatorSet( ctx, fundedKey, subnetAInfo, @@ -106,11 +118,46 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { proxyAddress, network, signatureAggregator, - utils.DefaultMinStakeAmount*10, + nodes, + ) + + // + // Delist one initial validator + // + utils.InitializeAndCompleteEndInitialPoAValidation( + ctx, + network, + signatureAggregator, + ownerKey, + fundedKey, + subnetAInfo, + pChainInfo, + poaValidatorManager, + proxyAddress, + initialValidationIDs[0], + 0, + nodes[0].Weight, + ) + + // Try to call with invalid owner + opts, err = bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) + Expect(err).Should(BeNil()) + + _, err = poaValidatorManager.InitializeValidatorRegistration( + opts, + poavalidatormanager.ValidatorRegistrationInput{ + NodeID: nodes[0].NodeID[:], + RegistrationExpiry: uint64(time.Now().Add(24 * time.Hour).Unix()), + BlsPublicKey: nodes[0].NodePoP.PublicKey[:], + }, + nodes[0].Weight, ) + Expect(err).ShouldNot(BeNil()) - // Register a validator - poaWeight := uint64(1) + // + // Re-register the validator as a SoV validator + // + expiry := uint64(time.Now().Add(24 * time.Hour).Unix()) poaValidationID := utils.InitializeAndCompletePoAValidatorRegistration( ctx, network, @@ -121,7 +168,8 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { pChainInfo, poaValidatorManager, proxyAddress, - poaWeight, + expiry, + nodes[0], ) poaValidator, err := poaValidatorManager.GetValidator(&bind.CallOpts{}, poaValidationID) Expect(err).Should(BeNil()) @@ -185,39 +233,37 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { Expect(err).Should(BeNil()) Expect(validationID[:]).Should(Equal(poaValidationID[:])) - // Register a PoS validator - stakeAmount := big.NewInt(1e18) - posWeight, err := posValidatorManager.ValueToWeight( - &bind.CallOpts{}, - stakeAmount, - ) - Expect(err).Should(BeNil()) + // + // Remove the PoA validator and re-register as a PoS validator + // - posValidationID := utils.InitializeAndCompleteNativeValidatorRegistration( + utils.InitializeAndCompleteEndNativeValidation( ctx, network, signatureAggregator, - fundedKey, + ownerKey, subnetAInfo, pChainInfo, posValidatorManager, proxyAddress, - stakeAmount, + poaValidationID, + expiry, + nodes[0], + 1, ) - // Delist the previous PoA validator - utils.InitializeAndCompleteEndNativeValidation( + expiry2 := uint64(time.Now().Add(24 * time.Hour).Unix()) + posValidationID := utils.InitializeAndCompleteNativeValidatorRegistration( ctx, network, signatureAggregator, - ownerKey, + fundedKey, subnetAInfo, pChainInfo, posValidatorManager, proxyAddress, - poaValidationID, - poaWeight, - 1, + expiry2, + nodes[0], ) // Delist the PoS validator @@ -231,7 +277,8 @@ func PoAMigrationToPoS(network interfaces.LocalNetwork) { posValidatorManager, proxyAddress, posValidationID, - posWeight, + expiry2, + nodes[0], 1, ) } diff --git a/tests/flows/validator-manager/poa_validator_manager.go b/tests/flows/validator-manager/poa_validator_manager.go deleted file mode 100644 index 7694866aa..000000000 --- a/tests/flows/validator-manager/poa_validator_manager.go +++ /dev/null @@ -1,151 +0,0 @@ -package staking - -import ( - "context" - "math/big" - "time" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/utils/crypto/bls" - "github.com/ava-labs/subnet-evm/accounts/abi/bind" - poavalidatormanager "github.com/ava-labs/teleporter/abi-bindings/go/validator-manager/PoAValidatorManager" - "github.com/ava-labs/teleporter/tests/interfaces" - "github.com/ava-labs/teleporter/tests/utils" - "github.com/ethereum/go-ethereum/crypto" - . "github.com/onsi/gomega" -) - -/* - * Register a PoA validator manager on a L1. The steps are as follows: - * - Generate random address to be the owner address - * - Fund native assets to the owner address - * - Deploy the PoAValidatorManager contract - * - Attempt to initiate with non owner and check that it fails - * - Initiate validator registration - * - Deliver the Warp message to the P-Chain (not implemented) - * - Aggregate P-Chain signatures on the response Warp message - * - Deliver the Warp message to the L1 - * - Verify that the validator is registered in the validator manager contract - * - * Delists the validator from the L1. The steps are as follows: - * - Attempt to initiate with non owner and check that it fails - * - Initiate validator delisting - * - Deliver the Warp message to the P-Chain (not implemented) - * - Aggregate P-Chain signatures on the response Warp message - * - Deliver the Warp message to the L1 - * - Verify that the validator is delisted from the validator manager contract - */ -func PoAValidatorManager(network interfaces.LocalNetwork) { - cChainInfo := network.GetPrimaryNetworkInfo() - subnetAInfo, _ := utils.GetTwoSubnets(network) - _, fundedKey := network.GetFundedAccountInfo() - pChainInfo := utils.GetPChainInfo(cChainInfo) - - signatureAggregator := utils.NewSignatureAggregator( - cChainInfo.NodeURIs[0], - []ids.ID{ - subnetAInfo.SubnetID, - ids.Empty, // Primary network subnet ID - }, - ) - - // Generate random address to be the owner address - ownerKey, err := crypto.GenerateKey() - Expect(err).Should(BeNil()) - ownerAddress := crypto.PubkeyToAddress(ownerKey.PublicKey) - - // Transfer native assets to the owner account - ctx := context.Background() - fundAmount := big.NewInt(1e18) // 1avax - utils.SendNativeTransfer( - ctx, - subnetAInfo, - fundedKey, - ownerAddress, - fundAmount, - ) - - validatorManagerAddress, validatorManager := utils.DeployAndInitializePoAValidatorManager( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - ownerAddress, - ) - _ = utils.InitializePoAValidatorSet( - ctx, - fundedKey, - subnetAInfo, - pChainInfo, - validatorManager, - validatorManagerAddress, - network, - signatureAggregator, - 5, - ) - - var validationID ids.ID // To be used in the delisting step - weight := uint64(1) - - { - // Try to call with invalid owner - opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) - Expect(err).Should(BeNil()) - - nodeID := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} - _, err = validatorManager.InitializeValidatorRegistration( - opts, - poavalidatormanager.ValidatorRegistrationInput{ - NodeID: nodeID, - RegistrationExpiry: uint64(time.Now().Add(24 * time.Hour).Unix()), - BlsPublicKey: blsPublicKey[:], - }, - weight, - ) - Expect(err).ShouldNot(BeNil()) - - // Initiate validator registration - validationID = utils.InitializeAndCompletePoAValidatorRegistration( - ctx, - network, - signatureAggregator, - ownerKey, - fundedKey, - subnetAInfo, - pChainInfo, - validatorManager, - validatorManagerAddress, - weight, - ) - } - - // - // Delist the validator - // - { - // Try with invalid validator owner - opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetAInfo.EVMChainID) - Expect(err).Should(BeNil()) - _, err = validatorManager.InitializeEndValidation( - opts, - validationID, - ) - Expect(err).ShouldNot(BeNil()) - - utils.InitializeAndCompleteEndPoAValidation( - ctx, - network, - signatureAggregator, - ownerKey, - fundedKey, - subnetAInfo, - pChainInfo, - validatorManager, - validatorManagerAddress, - validationID, - weight, - 1, - ) - } -} diff --git a/tests/interfaces/local_network.go b/tests/interfaces/local_network.go index 3206ee3c4..7b9e6aa7e 100644 --- a/tests/interfaces/local_network.go +++ b/tests/interfaces/local_network.go @@ -5,21 +5,13 @@ import ( "crypto/ecdsa" "github.com/ava-labs/avalanchego/ids" - avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" - "github.com/ava-labs/subnet-evm/core/types" + pwallet "github.com/ava-labs/avalanchego/wallet/chain/p/wallet" "github.com/ethereum/go-ethereum/common" ) type LocalNetwork interface { Network AddSubnetValidators(ctx context.Context, subnetID ids.ID, count uint) - ConstructSignedWarpMessage( - ctx context.Context, - sourceReceipt *types.Receipt, - source SubnetTestInfo, - destination SubnetTestInfo, - ) *avalancheWarp.Message - GetAllNodeIDs() []ids.NodeID SetChainConfigs(chainConfigs map[string]string) RestartNodes(ctx context.Context, nodeIDs []ids.NodeID) DeployTeleporterContractToCChain( @@ -35,5 +27,5 @@ type LocalNetwork interface { fundedKey *ecdsa.PrivateKey, ) GetNetworkID() uint32 - Dir() string + GetPChainWallet() pwallet.Wallet } diff --git a/tests/interfaces/network.go b/tests/interfaces/network.go index f71afdfef..7bd84b60c 100644 --- a/tests/interfaces/network.go +++ b/tests/interfaces/network.go @@ -4,8 +4,6 @@ import ( "context" "crypto/ecdsa" - "github.com/ava-labs/avalanchego/ids" - avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" "github.com/ava-labs/subnet-evm/core/types" "github.com/ethereum/go-ethereum/common" ) @@ -41,14 +39,6 @@ type Network interface { // connections with each validator. SupportsIndependentRelaying() bool - // GetSignedMessage returns the signed Warp message for the specified Warp message ID. - GetSignedMessage( - ctx context.Context, - source SubnetTestInfo, - destination SubnetTestInfo, - messageID ids.ID, - ) *avalancheWarp.Message - // For implementations where SupportsIndependentRelaying() is true, relays the specified message between the // two subnets,and returns the receipt of the transaction the message was delivered in. // For implementations where SupportsIndependentRelaying() is false, waits for the specific message to be relayed diff --git a/tests/local/governance/governance_suite_test.go b/tests/local/governance/governance_suite_test.go new file mode 100644 index 000000000..f157dc224 --- /dev/null +++ b/tests/local/governance/governance_suite_test.go @@ -0,0 +1,93 @@ +package governance_test + +import ( + "context" + "os" + "testing" + "time" + + governanceFlows "github.com/ava-labs/teleporter/tests/flows/governance" + "github.com/ava-labs/teleporter/tests/local" + deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" + "github.com/ethereum/go-ethereum/log" + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +const ( + teleporterByteCodeFile = "./out/TeleporterMessenger.sol/TeleporterMessenger.json" + warpGenesisTemplateFile = "./tests/utils/warp-genesis-template.json" + + teleporterMessengerLabel = "TeleporterMessenger" + upgradabilityLabel = "upgradability" + utilsLabel = "utils" + validatorSetSigLabel = "ValidatorSetSig" + validatorManagerLabel = "ValidatorManager" +) + +var ( + LocalNetworkInstance *local.LocalNetwork +) + +func TestGovernance(t *testing.T) { + if os.Getenv("RUN_E2E") == "" { + t.Skip("Environment variable RUN_E2E not set; skipping E2E tests") + } + + RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Teleporter e2e test") +} + +// Define the Teleporter before and after suite functions. +var _ = ginkgo.BeforeSuite(func() { + // Generate the Teleporter deployment values + _, teleporterDeployedBytecode, teleporterDeployerAddress, teleporterContractAddress, err := + deploymentUtils.ConstructKeylessTransaction( + teleporterByteCodeFile, + false, + deploymentUtils.GetDefaultContractCreationGasPrice(), + ) + Expect(err).Should(BeNil()) + + // Create the local network instance + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + defer cancel() + LocalNetworkInstance = local.NewLocalNetwork( + ctx, + "teleporter-test-local-network", + warpGenesisTemplateFile, + []local.SubnetSpec{ + { + Name: "A", + EVMChainID: 12345, + TeleporterContractAddress: teleporterContractAddress, + TeleporterDeployedBytecode: teleporterDeployedBytecode, + TeleporterDeployerAddress: teleporterDeployerAddress, + NodeCount: 2, + }, + { + Name: "B", + EVMChainID: 54321, + TeleporterContractAddress: teleporterContractAddress, + TeleporterDeployedBytecode: teleporterDeployedBytecode, + TeleporterDeployerAddress: teleporterDeployerAddress, + NodeCount: 2, + }, + }, + 2, + ) + log.Info("Started local network") +}) + +var _ = ginkgo.AfterSuite(func() { + LocalNetworkInstance.TearDownNetwork() +}) + +var _ = ginkgo.Describe("[Governance integration tests]", func() { + // Governance tests + ginkgo.It("Deliver ValidatorSetSig signed message", + ginkgo.Label(validatorSetSigLabel), + func() { + governanceFlows.ValidatorSetSig(LocalNetworkInstance) + }) +}) diff --git a/tests/local/network.go b/tests/local/network.go index 385cbd52c..a8a574c63 100644 --- a/tests/local/network.go +++ b/tests/local/network.go @@ -3,6 +3,8 @@ package local import ( "context" "crypto/ecdsa" + "encoding/base64" + "encoding/hex" "encoding/json" "math/big" "os" @@ -14,18 +16,18 @@ import ( "github.com/ava-labs/avalanchego/config" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" + "github.com/ava-labs/avalanchego/upgrade" "github.com/ava-labs/avalanchego/utils/constants" + "github.com/ava-labs/avalanchego/utils/crypto/secp256k1" "github.com/ava-labs/avalanchego/vms/platformvm" - avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" + "github.com/ava-labs/avalanchego/vms/secp256k1fx" + pwallet "github.com/ava-labs/avalanchego/wallet/chain/p/wallet" + "github.com/ava-labs/avalanchego/wallet/subnet/primary" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/ethclient" - subnetEvmInterfaces "github.com/ava-labs/subnet-evm/interfaces" - "github.com/ava-labs/subnet-evm/precompile/contracts/warp" "github.com/ava-labs/subnet-evm/rpc" subnetEvmTestUtils "github.com/ava-labs/subnet-evm/tests/utils" - warpBackend "github.com/ava-labs/subnet-evm/warp" - teleportermessenger "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/TeleporterMessenger" teleporterregistry "github.com/ava-labs/teleporter/abi-bindings/go/teleporter/registry/TeleporterRegistry" "github.com/ava-labs/teleporter/tests/interfaces" @@ -48,6 +50,7 @@ type LocalNetwork struct { extraNodes []*tmpnet.Node // to add as more subnet validators in the tests globalFundedKey *ecdsa.PrivateKey + pChainWallet pwallet.Wallet // Internal vars only used to set up the local network tmpnet *tmpnet.Network @@ -67,6 +70,7 @@ type SubnetSpec struct { NodeCount int } +// TODO: Decouple Teleporter from the network interface func NewLocalNetwork( ctx context.Context, name string, @@ -82,6 +86,14 @@ func NewLocalNetwork( var allNodes []*tmpnet.Node allNodes = append(allNodes, extraNodes...) // to be appended w/ subnet validators + fundedKey, err := hex.DecodeString(fundedKeyStr) + Expect(err).Should(BeNil()) + globalFundedKey, err := secp256k1.ToPrivateKey(fundedKey) + Expect(err).Should(BeNil()) + + globalFundedECDSAKey := globalFundedKey.ToECDSA() + Expect(err).Should(BeNil()) + var subnets []*tmpnet.Subnet for _, subnetSpec := range subnetSpecs { nodes := subnetEvmTestUtils.NewTmpnetNodes(subnetSpec.NodeCount) @@ -99,6 +111,7 @@ func NewLocalNetwork( utils.WarpEnabledChainConfig, nodes..., ) + subnet.OwningKey = globalFundedKey subnets = append(subnets, subnet) } @@ -110,6 +123,17 @@ func NewLocalNetwork( ) Expect(network).ShouldNot(BeNil()) + // Activate Etna + upgrades := upgrade.Default + upgrades.EtnaTime = time.Now().Add(-1 * time.Minute) + upgradeJSON, err := json.Marshal(upgrades) + Expect(err).Should(BeNil()) + + upgradeBase64 := base64.StdEncoding.EncodeToString(upgradeJSON) + network.DefaultFlags.SetDefaults(tmpnet.FlagsMap{ + config.UpgradeFileContentKey: upgradeBase64, + }) + avalancheGoBuildPath, ok := os.LookupEnv("AVALANCHEGO_BUILD_PATH") Expect(ok).Should(Equal(true)) @@ -125,25 +149,40 @@ func NewLocalNetwork( ) Expect(err).Should(BeNil()) - globalFundedKey, err := crypto.HexToECDSA(fundedKeyStr) - Expect(err).Should(BeNil()) - // Issue transactions to activate the proposerVM fork on the chains for _, subnet := range network.Subnets { - setupProposerVM(ctx, globalFundedKey, network, subnet.SubnetID) + utils.SetupProposerVM(ctx, globalFundedECDSAKey, network, subnet.SubnetID) } localNetwork := &LocalNetwork{ primaryNetworkInfo: &interfaces.SubnetTestInfo{}, subnetsInfo: make(map[ids.ID]*interfaces.SubnetTestInfo), extraNodes: extraNodes, - globalFundedKey: globalFundedKey, + globalFundedKey: globalFundedECDSAKey, tmpnet: network, } for _, subnet := range network.Subnets { localNetwork.setSubnetValues(subnet) } localNetwork.setPrimaryNetworkValues() + + // Create the P-Chain wallet to issue transactions + kc := secp256k1fx.NewKeychain(globalFundedKey) + localNetwork.GetSubnetsInfo() + var subnetIDs []ids.ID + for _, subnet := range localNetwork.GetSubnetsInfo() { + subnetIDs = append(subnetIDs, subnet.SubnetID) + } + wallet, err := primary.MakeWallet(ctx, &primary.WalletConfig{ + URI: localNetwork.GetPrimaryNetworkInfo().NodeURIs[0], + AVAXKeychain: kc, + EthKeychain: kc, + SubnetIDs: subnetIDs, + }) + Expect(err).Should(BeNil()) + localNetwork.pChainWallet = wallet.P() + + // TODO: Convert all subnets to permissionless validation return localNetwork } @@ -314,6 +353,20 @@ func (n *LocalNetwork) DeployTeleporterContractToAllChains( log.Info("Deployed Teleporter contracts to C-Chain and all subnets") } +func (n *LocalNetwork) InitializeBlockchainIDOnAllChains( + fundedKey *ecdsa.PrivateKey, +) { + log.Info("Initializing blockchainID on C-Chain and all subnets") + ctx := context.Background() + for _, subnetInfo := range n.GetAllSubnetsInfo() { + opts, err := bind.NewKeyedTransactorWithChainID(fundedKey, subnetInfo.EVMChainID) + Expect(err).Should(BeNil()) + tx, err := subnetInfo.TeleporterMessenger.InitializeBlockchainID(opts) + Expect(err).Should(BeNil()) + utils.WaitForTransactionSuccess(ctx, subnetInfo, tx.Hash()) + } +} + func (n *LocalNetwork) DeployTeleporterRegistryContracts( teleporterAddress common.Address, deployerKey *ecdsa.PrivateKey, @@ -423,7 +476,7 @@ func (n *LocalNetwork) RelayMessage(ctx context.Context, sendEvent, err := utils.GetEventFromLogs(sourceReceipt.Logs, source.TeleporterMessenger.ParseSendCrossChainMessage) Expect(err).Should(BeNil()) - signedWarpMessage := n.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination) + signedWarpMessage := utils.ConstructSignedWarpMessage(ctx, sourceReceipt, source, destination) // Construct the transaction to send the Warp message to the destination chain signedTx := utils.CreateReceiveCrossChainMessageTransaction( @@ -518,22 +571,18 @@ func (n *LocalNetwork) AddSubnetValidators(ctx context.Context, subnetID ids.ID, n.setAllSubnetValues() } -// GetAllNodeIDs returns a slice that copies the NodeID's of all nodes in the network -func (n *LocalNetwork) GetAllNodeIDs() []ids.NodeID { - nodeIDs := make([]ids.NodeID, len(n.tmpnet.Nodes)) - for i, node := range n.tmpnet.Nodes { - nodeIDs[i] = node.NodeID - } - return nodeIDs -} - +// Restarts the nodes with the given nodeIDs. If nodeIDs is empty, restarts all nodes. func (n *LocalNetwork) RestartNodes(ctx context.Context, nodeIDs []ids.NodeID) { log.Info("Restarting nodes", "nodeIDs", nodeIDs) var nodes []*tmpnet.Node - for _, nodeID := range nodeIDs { - for _, node := range n.tmpnet.Nodes { - if node.NodeID == nodeID { - nodes = append(nodes, node) + if len(nodeIDs) == 0 { + nodes = n.tmpnet.Nodes + } else { + for _, nodeID := range nodeIDs { + for _, node := range n.tmpnet.Nodes { + if node.NodeID == nodeID { + nodes = append(nodes, node) + } } } } @@ -598,75 +647,6 @@ func (n *LocalNetwork) SetChainConfigs(chainConfigs map[string]string) { } } -func (n *LocalNetwork) ConstructSignedWarpMessage( - ctx context.Context, - sourceReceipt *types.Receipt, - source interfaces.SubnetTestInfo, - destination interfaces.SubnetTestInfo, -) *avalancheWarp.Message { - log.Info("Fetching relevant warp logs from the newly produced block") - logs, err := source.RPCClient.FilterLogs(ctx, subnetEvmInterfaces.FilterQuery{ - BlockHash: &sourceReceipt.BlockHash, - Addresses: []common.Address{warp.Module.Address}, - }) - Expect(err).Should(BeNil()) - Expect(len(logs)).Should(Equal(1)) - - // Check for relevant warp log from subscription and ensure that it matches - // the log extracted from the last block. - txLog := logs[0] - log.Info("Parsing logData as unsigned warp message") - unsignedMsg, err := warp.UnpackSendWarpEventDataToMessage(txLog.Data) - Expect(err).Should(BeNil()) - - // Set local variables for the duration of the test - unsignedWarpMessageID := unsignedMsg.ID() - log.Info( - "Parsed unsignedWarpMsg", - "unsignedWarpMessageID", unsignedWarpMessageID, - "unsignedWarpMessage", unsignedMsg, - ) - - // Loop over each client on source chain to ensure they all have time to accept the block. - // Note: if we did not confirm this here, the next stage could be racy since it assumes every node - // has accepted the block. - waitForAllValidatorsToAcceptBlock(ctx, source.NodeURIs, source.BlockchainID, sourceReceipt.BlockNumber.Uint64()) - - // Get the aggregate signature for the Warp message - log.Info("Fetching aggregate signature from the source chain validators") - return n.GetSignedMessage(ctx, source, destination, unsignedWarpMessageID) -} - -func (n *LocalNetwork) GetSignedMessage( - ctx context.Context, - source interfaces.SubnetTestInfo, - destination interfaces.SubnetTestInfo, - unsignedWarpMessageID ids.ID, -) *avalancheWarp.Message { - Expect(len(source.NodeURIs)).Should(BeNumerically(">", 0)) - warpClient, err := warpBackend.NewClient(source.NodeURIs[0], source.BlockchainID.String()) - Expect(err).Should(BeNil()) - - signingSubnetID := source.SubnetID - if source.SubnetID == constants.PrimaryNetworkID { - signingSubnetID = destination.SubnetID - } - - // Get the aggregate signature for the Warp message - signedWarpMessageBytes, err := warpClient.GetMessageAggregateSignature( - ctx, - unsignedWarpMessageID, - warp.WarpDefaultQuorumNumerator, - signingSubnetID.String(), - ) - Expect(err).Should(BeNil()) - - signedWarpMsg, err := avalancheWarp.ParseMessage(signedWarpMessageBytes) - Expect(err).Should(BeNil()) - - return signedWarpMsg -} - func (n *LocalNetwork) GetNetworkID() uint32 { return n.tmpnet.Genesis.NetworkID } @@ -674,3 +654,7 @@ func (n *LocalNetwork) GetNetworkID() uint32 { func (n *LocalNetwork) Dir() string { return n.tmpnet.Dir } + +func (n *LocalNetwork) GetPChainWallet() pwallet.Wallet { + return n.pChainWallet +} diff --git a/tests/local/network_utils.go b/tests/local/network_utils.go deleted file mode 100644 index da166a6e0..000000000 --- a/tests/local/network_utils.go +++ /dev/null @@ -1,62 +0,0 @@ -package local - -import ( - "context" - "crypto/ecdsa" - "slices" - "time" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/tests/fixture/tmpnet" - "github.com/ava-labs/subnet-evm/ethclient" - subnetEvmUtils "github.com/ava-labs/subnet-evm/tests/utils" - "github.com/ava-labs/teleporter/tests/utils" - "github.com/ethereum/go-ethereum/log" - - . "github.com/onsi/gomega" -) - -// Issues txs to activate the proposer VM fork on the specified subnet index in the manager -func setupProposerVM(ctx context.Context, fundedKey *ecdsa.PrivateKey, network *tmpnet.Network, subnetID ids.ID) { - subnetDetails := network.Subnets[slices.IndexFunc( - network.Subnets, - func(s *tmpnet.Subnet) bool { return s.SubnetID == subnetID }, - )] - - chainID := subnetDetails.Chains[0].ChainID - - nodeURI, err := network.GetURIForNodeID(subnetDetails.ValidatorIDs[0]) - Expect(err).Should(BeNil()) - uri := utils.HttpToWebsocketURI(nodeURI, chainID.String()) - - client, err := ethclient.Dial(uri) - Expect(err).Should(BeNil()) - chainIDInt, err := client.ChainID(ctx) - Expect(err).Should(BeNil()) - - err = subnetEvmUtils.IssueTxsToActivateProposerVMFork(ctx, chainIDInt, fundedKey, client) - Expect(err).Should(BeNil()) -} - -// Blocks until all validators specified in nodeURIs have reached the specified block height -func waitForAllValidatorsToAcceptBlock(ctx context.Context, nodeURIs []string, blockchainID ids.ID, height uint64) { - cctx, cancel := context.WithTimeout(ctx, 10*time.Second) - defer cancel() - for i, uri := range nodeURIs { - chainAWSURI := utils.HttpToWebsocketURI(uri, blockchainID.String()) - log.Debug("Creating ethclient for blockchain", "blockchainID", blockchainID.String(), "wsURI", chainAWSURI) - client, err := ethclient.Dial(chainAWSURI) - Expect(err).Should(BeNil()) - defer client.Close() - - // Loop until each node has advanced to >= the height of the block that emitted the warp log - for { - block, err := client.BlockByNumber(cctx, nil) - Expect(err).Should(BeNil()) - if block.NumberU64() >= height { - log.Debug("Client accepted the block containing SendWarpMessage", "client", i, "height", block.NumberU64()) - break - } - } - } -} diff --git a/tests/local/e2e_test.go b/tests/local/teleporter/teleporter_suite_test.go similarity index 62% rename from tests/local/e2e_test.go rename to tests/local/teleporter/teleporter_suite_test.go index 8939df42c..34d646f6b 100644 --- a/tests/local/e2e_test.go +++ b/tests/local/teleporter/teleporter_suite_test.go @@ -1,7 +1,4 @@ -// Copyright (C) 2023, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package local +package teleporter_test import ( "context" @@ -9,10 +6,9 @@ import ( "testing" "time" - "github.com/ava-labs/teleporter/tests/flows/governance" - "github.com/ava-labs/teleporter/tests/flows/teleporter" - "github.com/ava-labs/teleporter/tests/flows/teleporter/registry" - validatorManager "github.com/ava-labs/teleporter/tests/flows/validator-manager" + teleporterFlows "github.com/ava-labs/teleporter/tests/flows/teleporter" + registryFlows "github.com/ava-labs/teleporter/tests/flows/teleporter/registry" + "github.com/ava-labs/teleporter/tests/local" deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" "github.com/ethereum/go-ethereum/log" "github.com/onsi/ginkgo/v2" @@ -31,10 +27,10 @@ const ( ) var ( - LocalNetworkInstance *LocalNetwork + LocalNetworkInstance *local.LocalNetwork ) -func TestE2E(t *testing.T) { +func TestTeleporter(t *testing.T) { if os.Getenv("RUN_E2E") == "" { t.Skip("Environment variable RUN_E2E not set; skipping E2E tests") } @@ -57,11 +53,11 @@ var _ = ginkgo.BeforeSuite(func() { // Create the local network instance ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) defer cancel() - LocalNetworkInstance = NewLocalNetwork( + LocalNetworkInstance = local.NewLocalNetwork( ctx, "teleporter-test-local-network", warpGenesisTemplateFile, - []SubnetSpec{ + []local.SubnetSpec{ { Name: "A", EVMChainID: 12345, @@ -92,21 +88,17 @@ var _ = ginkgo.BeforeSuite(func() { fundedKey, ) LocalNetworkInstance.SetTeleporterContractAddress(teleporterContractAddress) + LocalNetworkInstance.InitializeBlockchainIDOnAllChains(fundedKey) // Deploy the Teleporter registry contracts to all subnets and the C-Chain. LocalNetworkInstance.DeployTeleporterRegistryContracts(teleporterContractAddress, fundedKey) - ginkgo.AddReportEntry( - "network directory with node logs & configs; useful in the case of failures", - LocalNetworkInstance.tmpnet.Dir, - ginkgo.ReportEntryVisibilityFailureOrVerbose, - ) - log.Info("Set up ginkgo before suite") }) var _ = ginkgo.AfterSuite(func() { LocalNetworkInstance.TearDownNetwork() + LocalNetworkInstance = nil }) var _ = ginkgo.Describe("[Teleporter integration tests]", func() { @@ -114,122 +106,83 @@ var _ = ginkgo.Describe("[Teleporter integration tests]", func() { ginkgo.It("Send a message from Subnet A to Subnet B, and one from B to A", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.BasicSendReceive(LocalNetworkInstance) + teleporterFlows.BasicSendReceive(LocalNetworkInstance) }) ginkgo.It("Deliver to the wrong chain", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.DeliverToWrongChain(LocalNetworkInstance) + teleporterFlows.DeliverToWrongChain(LocalNetworkInstance) }) ginkgo.It("Deliver to non-existent contract", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.DeliverToNonExistentContract(LocalNetworkInstance) + teleporterFlows.DeliverToNonExistentContract(LocalNetworkInstance) }) ginkgo.It("Retry successful execution", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.RetrySuccessfulExecution(LocalNetworkInstance) + teleporterFlows.RetrySuccessfulExecution(LocalNetworkInstance) }) ginkgo.It("Unallowed relayer", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.UnallowedRelayer(LocalNetworkInstance) + teleporterFlows.UnallowedRelayer(LocalNetworkInstance) }) ginkgo.It("Relay message twice", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.RelayMessageTwice(LocalNetworkInstance) + teleporterFlows.RelayMessageTwice(LocalNetworkInstance) }) ginkgo.It("Add additional fee amount", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.AddFeeAmount(LocalNetworkInstance) + teleporterFlows.AddFeeAmount(LocalNetworkInstance) }) ginkgo.It("Send specific receipts", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.SendSpecificReceipts(LocalNetworkInstance) + teleporterFlows.SendSpecificReceipts(LocalNetworkInstance) }) ginkgo.It("Insufficient gas", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.InsufficientGas(LocalNetworkInstance) + teleporterFlows.InsufficientGas(LocalNetworkInstance) }) ginkgo.It("Resubmit altered message", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.ResubmitAlteredMessage(LocalNetworkInstance) + teleporterFlows.ResubmitAlteredMessage(LocalNetworkInstance) }) ginkgo.It("Calculate Teleporter message IDs", ginkgo.Label(utilsLabel), func() { - teleporter.CalculateMessageID(LocalNetworkInstance) + teleporterFlows.CalculateMessageID(LocalNetworkInstance) }) ginkgo.It("Relayer modifies message", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.RelayerModifiesMessage(LocalNetworkInstance) + teleporterFlows.RelayerModifiesMessage(LocalNetworkInstance) }) ginkgo.It("Validator churn", ginkgo.Label(teleporterMessengerLabel), func() { - teleporter.ValidatorChurn(LocalNetworkInstance) + teleporterFlows.ValidatorChurn(LocalNetworkInstance) }) // Teleporter Registry tests ginkgo.It("Teleporter registry", ginkgo.Label(upgradabilityLabel), func() { - registry.TeleporterRegistry(LocalNetworkInstance) + registryFlows.TeleporterRegistry(LocalNetworkInstance) }) ginkgo.It("Check upgrade access", ginkgo.Label(upgradabilityLabel), func() { - registry.CheckUpgradeAccess(LocalNetworkInstance) + registryFlows.CheckUpgradeAccess(LocalNetworkInstance) }) ginkgo.It("Pause and Unpause Teleporter", ginkgo.Label(upgradabilityLabel), func() { - registry.PauseTeleporter(LocalNetworkInstance) - }) - - // Governance tests - ginkgo.It("Deliver ValidatorSetSig signed message", - ginkgo.Label(validatorSetSigLabel), - func() { - governance.ValidatorSetSig(LocalNetworkInstance) - }) - - // Validator Manager tests - ginkgo.It("Native token staking manager", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.NativeTokenStakingManager(LocalNetworkInstance) - }) - ginkgo.It("ERC20 token staking manager", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.ERC20TokenStakingManager(LocalNetworkInstance) - }) - ginkgo.It("PoA validator manager", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.PoAValidatorManager(LocalNetworkInstance) - }) - ginkgo.It("ERC20 delegation", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.ERC20Delegation(LocalNetworkInstance) - }) - ginkgo.It("Native token delegation", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.NativeDelegation(LocalNetworkInstance) - }) - ginkgo.It("PoA migration to PoS", - ginkgo.Label(validatorManagerLabel), - func() { - validatorManager.PoAMigrationToPoS(LocalNetworkInstance) + registryFlows.PauseTeleporter(LocalNetworkInstance) }) }) diff --git a/tests/local/validator-manager/validator_manager_suite_test.go b/tests/local/validator-manager/validator_manager_suite_test.go new file mode 100644 index 000000000..25d780c21 --- /dev/null +++ b/tests/local/validator-manager/validator_manager_suite_test.go @@ -0,0 +1,120 @@ +package validator_manager_test + +import ( + "context" + "os" + "testing" + "time" + + validatorManagerFlows "github.com/ava-labs/teleporter/tests/flows/validator-manager" + "github.com/ava-labs/teleporter/tests/local" + deploymentUtils "github.com/ava-labs/teleporter/utils/deployment-utils" + "github.com/ethereum/go-ethereum/log" + "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +const ( + teleporterByteCodeFile = "./out/TeleporterMessenger.sol/TeleporterMessenger.json" + warpGenesisTemplateFile = "./tests/utils/warp-genesis-template.json" + + teleporterMessengerLabel = "TeleporterMessenger" + upgradabilityLabel = "upgradability" + utilsLabel = "utils" + validatorSetSigLabel = "ValidatorSetSig" + validatorManagerLabel = "ValidatorManager" +) + +var ( + LocalNetworkInstance *local.LocalNetwork +) + +func TestValidatorManager(t *testing.T) { + if os.Getenv("RUN_E2E") == "" { + t.Skip("Environment variable RUN_E2E not set; skipping E2E tests") + } + + RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "Teleporter e2e test") +} + +// Define the Teleporter before and after suite functions. +var _ = ginkgo.BeforeEach(func() { + // Generate the Teleporter deployment values + teleporterDeployerTransaction, teleporterDeployedBytecode, teleporterDeployerAddress, teleporterContractAddress, err := + deploymentUtils.ConstructKeylessTransaction( + teleporterByteCodeFile, + false, + deploymentUtils.GetDefaultContractCreationGasPrice(), + ) + Expect(err).Should(BeNil()) + + // Create the local network instance + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + defer cancel() + LocalNetworkInstance = local.NewLocalNetwork( + ctx, + "teleporter-test-local-network", + warpGenesisTemplateFile, + []local.SubnetSpec{ + { + Name: "A", + EVMChainID: 12345, + TeleporterContractAddress: teleporterContractAddress, + TeleporterDeployedBytecode: teleporterDeployedBytecode, + TeleporterDeployerAddress: teleporterDeployerAddress, + NodeCount: 2, + }, + { + Name: "B", + EVMChainID: 54321, + TeleporterContractAddress: teleporterContractAddress, + TeleporterDeployedBytecode: teleporterDeployedBytecode, + TeleporterDeployerAddress: teleporterDeployerAddress, + NodeCount: 2, + }, + }, + 2, + ) + log.Info("Started local network") + + // Only need to deploy Teleporter on the C-Chain since it is included in the genesis of the subnet chains. + _, fundedKey := LocalNetworkInstance.GetFundedAccountInfo() + LocalNetworkInstance.DeployTeleporterContractToCChain( + teleporterDeployerTransaction, + teleporterDeployerAddress, + teleporterContractAddress, + fundedKey, + ) + LocalNetworkInstance.SetTeleporterContractAddress(teleporterContractAddress) + LocalNetworkInstance.InitializeBlockchainIDOnAllChains(fundedKey) + + // Deploy the Teleporter registry contracts to all subnets and the C-Chain. + LocalNetworkInstance.DeployTeleporterRegistryContracts(teleporterContractAddress, fundedKey) + + log.Info("Set up ginkgo before suite") +}) + +var _ = ginkgo.AfterEach(func() { + LocalNetworkInstance.TearDownNetwork() + LocalNetworkInstance = nil +}) + +var _ = ginkgo.Describe("[Validator manager integration tests]", func() { + // Validator Manager tests + ginkgo.It("Native token staking manager", + ginkgo.Label(validatorManagerLabel), + func() { + validatorManagerFlows.NativeTokenStakingManager(LocalNetworkInstance) + }) + ginkgo.It("ERC20 token staking manager", + ginkgo.Label(validatorManagerLabel), + func() { + validatorManagerFlows.ERC20TokenStakingManager(LocalNetworkInstance) + }) + ginkgo.It("PoA migration to PoS", + ginkgo.Label(validatorManagerLabel), + func() { + validatorManagerFlows.PoAMigrationToPoS(LocalNetworkInstance) + }) +}) diff --git a/tests/utils/chain.go b/tests/utils/chain.go index ac75d4d02..27778d27b 100644 --- a/tests/utils/chain.go +++ b/tests/utils/chain.go @@ -6,8 +6,10 @@ import ( "encoding/json" "errors" "fmt" + goLog "log" "math/big" "os" + "slices" "strconv" "strings" "time" @@ -19,17 +21,22 @@ import ( "github.com/ava-labs/avalanchego/utils/constants" "github.com/ava-labs/avalanchego/utils/logging" "github.com/ava-labs/avalanchego/utils/set" + "github.com/ava-labs/avalanchego/vms/platformvm/signer" avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" relayerConfig "github.com/ava-labs/awm-relayer/config" "github.com/ava-labs/awm-relayer/peers" "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" sigAggConfig "github.com/ava-labs/awm-relayer/signature-aggregator/config" + "github.com/ava-labs/awm-relayer/signature-aggregator/metrics" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/eth/tracers" "github.com/ava-labs/subnet-evm/ethclient" subnetEvmInterfaces "github.com/ava-labs/subnet-evm/interfaces" "github.com/ava-labs/subnet-evm/precompile/contracts/nativeminter" + "github.com/ava-labs/subnet-evm/precompile/contracts/warp" + subnetEvmUtils "github.com/ava-labs/subnet-evm/tests/utils" + warpBackend "github.com/ava-labs/subnet-evm/warp" nativeMinter "github.com/ava-labs/teleporter/abi-bindings/go/INativeMinter" "github.com/ava-labs/teleporter/tests/interfaces" gasUtils "github.com/ava-labs/teleporter/utils/gas-utils" @@ -70,6 +77,12 @@ var WarpEnabledChainConfig = tmpnet.FlagsMap{ }, } +type Node struct { + NodeID ids.NodeID + NodePoP *signer.ProofOfPossession + Weight uint64 +} + // // URL utils // @@ -207,7 +220,7 @@ func waitForTransaction( txHash common.Hash, success bool, ) *types.Receipt { - cctx, cancel := context.WithTimeout(ctx, 10*time.Second) + cctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() receipt, err := WaitMined(cctx, subnetInfo.RPCClient, txHash) @@ -310,13 +323,13 @@ func TraceTransaction(ctx context.Context, rpcClient ethclient.Client, txHash co // Takes a tx hash instead of the full tx in the subnet-evm version of this function. // Copied and modified from https://github.com/ava-labs/subnet-evm/blob/v0.6.0-fuji/accounts/abi/bind/util.go#L42 func WaitMined(ctx context.Context, rpcClient ethclient.Client, txHash common.Hash) (*types.Receipt, error) { - cctx, cancel := context.WithTimeout(ctx, 20*time.Second) - defer cancel() - - receipt, err := waitForTransactionReceipt(cctx, rpcClient, txHash) + now := time.Now() + receipt, err := waitForTransactionReceipt(ctx, rpcClient, txHash) if err != nil { return nil, err } + since := time.Since(now) + goLog.Println("Transaction mined", "txHash", txHash.Hex(), "duration", since) // Check that the block height endpoint returns a block height as high as the block number that the transaction was // included in. This is to workaround the issue where multiple nodes behind a public RPC endpoint see @@ -325,7 +338,7 @@ func WaitMined(ctx context.Context, rpcClient ethclient.Client, txHash common.Ha // configured to return the lowest value currently returned by any node behind the load balancer, so waiting for // it to be at least as high as the block height specified in the receipt should provide a relatively strong // indication that the transaction has been seen widely throughout the network. - err = waitForBlockHeight(cctx, rpcClient, receipt.BlockNumber.Uint64()) + err = waitForBlockHeight(ctx, rpcClient, receipt.BlockNumber.Uint64()) if err != nil { return nil, err } @@ -532,7 +545,6 @@ func InstantiateGenesisTemplate( // func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.SignatureAggregator { - logger := logging.NoLog{} cfg := sigAggConfig.Config{ PChainAPI: &relayerConfig.APIConfig{ BaseURL: apiUri, @@ -545,7 +557,7 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu trackedSubnets.Add(subnets...) registry := prometheus.NewRegistry() appRequestNetwork, err := peers.NewNetwork( - logging.Debug, + logging.Info, registry, trackedSubnets, &cfg, @@ -553,19 +565,29 @@ func NewSignatureAggregator(apiUri string, subnets []ids.ID) *aggregator.Signatu Expect(err).Should(BeNil()) messageCreator, err := message.NewCreator( - logger, + logging.NoLog{}, registry, constants.DefaultNetworkCompressionType, constants.DefaultNetworkMaximumInboundTimeout, ) Expect(err).Should(BeNil()) - return aggregator.NewSignatureAggregator( + agg, err := aggregator.NewSignatureAggregator( appRequestNetwork, - logger, + logging.NoLog{}, + 1024, + metrics.NewSignatureAggregatorMetrics(prometheus.NewRegistry()), messageCreator, + // Setting the etnaTime to a minute ago so that the post-etna code path is used in the test + time.Now().Add(-1*time.Minute), ) + Expect(err).Should(BeNil()) + return agg } +// +// Native minter utils +// + // Funded key must have admin access to set new admin. func AddNativeMinterAdmin( ctx context.Context, @@ -582,3 +604,126 @@ func AddNativeMinterAdmin( Expect(err).Should(BeNil()) WaitForTransactionSuccess(ctx, subnet, tx.Hash()) } + +// Blocks until all validators specified in nodeURIs have reached the specified block height +func WaitForAllValidatorsToAcceptBlock(ctx context.Context, nodeURIs []string, blockchainID ids.ID, height uint64) { + cctx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + for i, uri := range nodeURIs { + chainAWSURI := HttpToWebsocketURI(uri, blockchainID.String()) + log.Debug("Creating ethclient for blockchain", "blockchainID", blockchainID.String(), "wsURI", chainAWSURI) + client, err := ethclient.Dial(chainAWSURI) + Expect(err).Should(BeNil()) + defer client.Close() + + // Loop until each node has advanced to >= the height of the block that emitted the warp log + for { + block, err := client.BlockByNumber(cctx, nil) + Expect(err).Should(BeNil()) + if block.NumberU64() >= height { + log.Debug("Client accepted the block containing SendWarpMessage", "client", i, "height", block.NumberU64()) + break + } + } + } +} + +func ExtractWarpMessageFromLog( + ctx context.Context, + sourceReceipt *types.Receipt, + source interfaces.SubnetTestInfo, +) *avalancheWarp.UnsignedMessage { + log.Info("Fetching relevant warp logs from the newly produced block") + logs, err := source.RPCClient.FilterLogs(ctx, subnetEvmInterfaces.FilterQuery{ + BlockHash: &sourceReceipt.BlockHash, + Addresses: []common.Address{warp.Module.Address}, + }) + Expect(err).Should(BeNil()) + Expect(len(logs)).Should(Equal(1)) + + // Check for relevant warp log from subscription and ensure that it matches + // the log extracted from the last block. + txLog := logs[0] + log.Info("Parsing logData as unsigned warp message") + unsignedMsg, err := warp.UnpackSendWarpEventDataToMessage(txLog.Data) + Expect(err).Should(BeNil()) + return unsignedMsg +} + +func ConstructSignedWarpMessage( + ctx context.Context, + sourceReceipt *types.Receipt, + source interfaces.SubnetTestInfo, + destination interfaces.SubnetTestInfo, +) *avalancheWarp.Message { + unsignedMsg := ExtractWarpMessageFromLog(ctx, sourceReceipt, source) + + // Set local variables for the duration of the test + unsignedWarpMessageID := unsignedMsg.ID() + log.Info( + "Parsed unsignedWarpMsg", + "unsignedWarpMessageID", unsignedWarpMessageID, + "unsignedWarpMessage", unsignedMsg, + ) + + // Loop over each client on source chain to ensure they all have time to accept the block. + // Note: if we did not confirm this here, the next stage could be racy since it assumes every node + // has accepted the block. + WaitForAllValidatorsToAcceptBlock(ctx, source.NodeURIs, source.BlockchainID, sourceReceipt.BlockNumber.Uint64()) + + // Get the aggregate signature for the Warp message + log.Info("Fetching aggregate signature from the source chain validators") + return GetSignedMessage(ctx, source, destination, unsignedWarpMessageID) +} + +func GetSignedMessage( + ctx context.Context, + source interfaces.SubnetTestInfo, + destination interfaces.SubnetTestInfo, + unsignedWarpMessageID ids.ID, +) *avalancheWarp.Message { + Expect(len(source.NodeURIs)).Should(BeNumerically(">", 0)) + warpClient, err := warpBackend.NewClient(source.NodeURIs[0], source.BlockchainID.String()) + Expect(err).Should(BeNil()) + + signingSubnetID := source.SubnetID + if source.SubnetID == constants.PrimaryNetworkID { + signingSubnetID = destination.SubnetID + } + + // Get the aggregate signature for the Warp message + // TODO: use signature aggregator + signedWarpMessageBytes, err := warpClient.GetMessageAggregateSignature( + ctx, + unsignedWarpMessageID, + warp.WarpDefaultQuorumNumerator, + signingSubnetID.String(), + ) + Expect(err).Should(BeNil()) + + signedWarpMsg, err := avalancheWarp.ParseMessage(signedWarpMessageBytes) + Expect(err).Should(BeNil()) + + return signedWarpMsg +} + +func SetupProposerVM(ctx context.Context, fundedKey *ecdsa.PrivateKey, network *tmpnet.Network, subnetID ids.ID) { + subnetDetails := network.Subnets[slices.IndexFunc( + network.Subnets, + func(s *tmpnet.Subnet) bool { return s.SubnetID == subnetID }, + )] + + chainID := subnetDetails.Chains[0].ChainID + + nodeURI, err := network.GetURIForNodeID(subnetDetails.ValidatorIDs[0]) + Expect(err).Should(BeNil()) + uri := HttpToWebsocketURI(nodeURI, chainID.String()) + + client, err := ethclient.Dial(uri) + Expect(err).Should(BeNil()) + chainIDInt, err := client.ChainID(ctx) + Expect(err).Should(BeNil()) + + err = subnetEvmUtils.IssueTxsToActivateProposerVMFork(ctx, chainIDInt, fundedKey, client) + Expect(err).Should(BeNil()) +} diff --git a/tests/utils/governance.go b/tests/utils/governance.go index 177d3f017..96d03555d 100644 --- a/tests/utils/governance.go +++ b/tests/utils/governance.go @@ -48,7 +48,7 @@ func ExecuteValidatorSetSigCallAndVerify( unsignedMessage *avalancheWarp.UnsignedMessage, expectSuccess bool, ) *types.Receipt { - signedWarpMsg := network.GetSignedMessage(ctx, source, destination, unsignedMessage.ID()) + signedWarpMsg := GetSignedMessage(ctx, source, destination, unsignedMessage.ID()) log.Info("Got signed warp message", "messageID", signedWarpMsg.ID()) signedPredicateTx := CreateExecuteCallPredicateTransaction( diff --git a/tests/utils/teleporter.go b/tests/utils/teleporter.go index 1647bd0fa..7f9840824 100644 --- a/tests/utils/teleporter.go +++ b/tests/utils/teleporter.go @@ -250,7 +250,7 @@ func AddProtocolVersionAndWaitForAcceptance( senderKey *ecdsa.PrivateKey, unsignedMessage *avalancheWarp.UnsignedMessage, ) { - signedWarpMsg := network.GetSignedMessage(ctx, subnet, subnet, unsignedMessage.ID()) + signedWarpMsg := GetSignedMessage(ctx, subnet, subnet, unsignedMessage.ID()) log.Info("Got signed warp message", "messageID", signedWarpMsg.ID()) // Construct tx to add protocol version and send to destination chain diff --git a/tests/utils/validator_manager.go b/tests/utils/validator_manager.go index 33806a007..b856d8aa8 100644 --- a/tests/utils/validator_manager.go +++ b/tests/utils/validator_manager.go @@ -6,20 +6,31 @@ import ( "crypto/sha256" "encoding/binary" "fmt" + "log" "math/big" "reflect" + "sort" "time" + "github.com/ava-labs/avalanchego/api/info" "github.com/ava-labs/avalanchego/ids" + "github.com/ava-labs/avalanchego/proto/pb/platformvm" "github.com/ava-labs/avalanchego/utils/crypto/bls" + "github.com/ava-labs/avalanchego/utils/formatting/address" + "github.com/ava-labs/avalanchego/utils/units" + "github.com/ava-labs/avalanchego/vms/components/avax" + "github.com/ava-labs/avalanchego/vms/platformvm/stakeable" + "github.com/ava-labs/avalanchego/vms/platformvm/txs" avalancheWarp "github.com/ava-labs/avalanchego/vms/platformvm/warp" - warpMessages "github.com/ava-labs/avalanchego/vms/platformvm/warp/messages" + warpMessage "github.com/ava-labs/avalanchego/vms/platformvm/warp/message" warpPayload "github.com/ava-labs/avalanchego/vms/platformvm/warp/payload" + "github.com/ava-labs/avalanchego/vms/secp256k1fx" "github.com/ava-labs/awm-relayer/signature-aggregator/aggregator" "github.com/ava-labs/subnet-evm/accounts/abi/bind" "github.com/ava-labs/subnet-evm/core/types" "github.com/ava-labs/subnet-evm/precompile/contracts/warp" predicateutils "github.com/ava-labs/subnet-evm/predicate" + subnetEvmUtils "github.com/ava-labs/subnet-evm/tests/utils" exampleerc20 "github.com/ava-labs/teleporter/abi-bindings/go/mocks/ExampleERC20" erc20tokenstakingmanager "github.com/ava-labs/teleporter/abi-bindings/go/validator-manager/ERC20TokenStakingManager" examplerewardcalculator "github.com/ava-labs/teleporter/abi-bindings/go/validator-manager/ExampleRewardCalculator" @@ -27,6 +38,7 @@ import ( poavalidatormanager "github.com/ava-labs/teleporter/abi-bindings/go/validator-manager/PoAValidatorManager" "github.com/ava-labs/teleporter/tests/interfaces" "github.com/ethereum/go-ethereum/common" + "google.golang.org/protobuf/proto" . "github.com/onsi/gomega" ) @@ -34,13 +46,12 @@ import ( const ( DefaultMinDelegateFeeBips uint16 = 1 DefaultMinStakeDurationSeconds uint64 = 1 - DefaultMinStakeAmount uint64 = 1e18 + DefaultMinStakeAmount uint64 = 1e16 DefaultMaxStakeAmount uint64 = 10e18 DefaultMaxStakeMultiplier uint8 = 4 DefaultMaxChurnPercentage uint8 = 20 DefaultChurnPeriodSeconds uint64 = 1 - - initialValidatorPackedLen = 88 + DefaultPChainAddress string = "P-local18jma8ppw3nhx5r4ap8clazz0dps7rv5u00z96u" ) // @@ -260,25 +271,37 @@ func InitializeNativeTokenValidatorSet( validatorManagerAddress common.Address, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, - initialValidatorWeight uint64, -) ids.ID { - convertSubnetTxId := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} - subnetConversionData := nativetokenstakingmanager.SubnetConversionData{ - ConvertSubnetTxID: convertSubnetTxId, + nodes []Node, +) []ids.ID { + initialValidators := make([]warpMessage.SubnetConversionValidatorData, len(nodes)) + initialValidatorsABI := make([]nativetokenstakingmanager.InitialValidator, len(nodes)) + for i, node := range nodes { + initialValidators[i] = warpMessage.SubnetConversionValidatorData{ + NodeID: node.NodeID.Bytes(), + BLSPublicKey: node.NodePoP.PublicKey, + Weight: nodes[i].Weight, + } + initialValidatorsABI[i] = nativetokenstakingmanager.InitialValidator{ + NodeID: node.NodeID.Bytes(), + BlsPublicKey: node.NodePoP.PublicKey[:], + Weight: nodes[i].Weight, + } + } + + subnetConversionData := warpMessage.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, + ManagerChainID: subnetInfo.BlockchainID, + ManagerAddress: validatorManagerAddress[:], + Validators: initialValidators, + } + subnetConversionDataABI := nativetokenstakingmanager.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, ValidatorManagerBlockchainID: subnetInfo.BlockchainID, ValidatorManagerAddress: validatorManagerAddress, - InitialValidators: []nativetokenstakingmanager.InitialValidator{ - { - NodeID: ids.GenerateTestID(), - Weight: initialValidatorWeight, - BlsPublicKey: blsPublicKey[:], - }, - }, + InitialValidators: initialValidatorsABI, } - subnetConversionDataBytes, err := PackSubnetConversionData(subnetConversionData) + subnetConversionID, err := warpMessage.SubnetConversionID(subnetConversionData) Expect(err).Should(BeNil()) - subnetConversionID := sha256.Sum256(subnetConversionDataBytes) subnetConversionSignedMessage := ConstructSubnetConversionMessage( subnetConversionID, subnetInfo, @@ -293,21 +316,24 @@ func InitializeNativeTokenValidatorSet( subnetInfo, validatorManagerAddress, subnetConversionSignedMessage, - subnetConversionData, + subnetConversionDataABI, ) initialValidatorCreatedEvent, err := GetEventFromLogs( receipt.Logs, validatorManager.ParseInitialValidatorCreated, ) Expect(err).Should(BeNil()) - Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID)) - Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight))) + var validationIDs []ids.ID + for i := range nodes { + validationIDs = append(validationIDs, subnetInfo.SubnetID.Append(uint32(i))) + } + + Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(nodes[0].Weight))) - expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0) emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID) - Expect(emittedValidationID).Should(Equal(expectedValidationID)) + Expect(emittedValidationID).Should(Equal(validationIDs[0])) - return emittedValidationID + return validationIDs } func InitializeERC20TokenValidatorSet( @@ -319,25 +345,37 @@ func InitializeERC20TokenValidatorSet( validatorManagerAddress common.Address, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, - initialValidatorWeight uint64, -) ids.ID { - convertSubnetTxId := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} - subnetConversionData := erc20tokenstakingmanager.SubnetConversionData{ - ConvertSubnetTxID: convertSubnetTxId, + nodes []Node, +) []ids.ID { + initialValidators := make([]warpMessage.SubnetConversionValidatorData, len(nodes)) + initialValidatorsABI := make([]erc20tokenstakingmanager.InitialValidator, len(nodes)) + for i, node := range nodes { + initialValidators[i] = warpMessage.SubnetConversionValidatorData{ + NodeID: node.NodeID.Bytes(), + BLSPublicKey: node.NodePoP.PublicKey, + Weight: nodes[i].Weight, + } + initialValidatorsABI[i] = erc20tokenstakingmanager.InitialValidator{ + NodeID: node.NodeID.Bytes(), + BlsPublicKey: node.NodePoP.PublicKey[:], + Weight: nodes[i].Weight, + } + } + + subnetConversionData := warpMessage.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, + ManagerChainID: subnetInfo.BlockchainID, + ManagerAddress: validatorManagerAddress[:], + Validators: initialValidators, + } + subnetConversionDataABI := erc20tokenstakingmanager.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, ValidatorManagerBlockchainID: subnetInfo.BlockchainID, ValidatorManagerAddress: validatorManagerAddress, - InitialValidators: []erc20tokenstakingmanager.InitialValidator{ - { - NodeID: ids.GenerateTestID(), - Weight: initialValidatorWeight, - BlsPublicKey: blsPublicKey[:], - }, - }, + InitialValidators: initialValidatorsABI, } - subnetConversionDataBytes, err := PackSubnetConversionData(subnetConversionData) + subnetConversionID, err := warpMessage.SubnetConversionID(subnetConversionData) Expect(err).Should(BeNil()) - subnetConversionID := sha256.Sum256(subnetConversionDataBytes) subnetConversionSignedMessage := ConstructSubnetConversionMessage( subnetConversionID, subnetInfo, @@ -345,6 +383,7 @@ func InitializeERC20TokenValidatorSet( network, signatureAggregator, ) + // Deliver the Warp message to the subnet receipt := DeliverERC20TokenSubnetConversion( ctx, @@ -352,21 +391,24 @@ func InitializeERC20TokenValidatorSet( subnetInfo, validatorManagerAddress, subnetConversionSignedMessage, - subnetConversionData, + subnetConversionDataABI, ) initialValidatorCreatedEvent, err := GetEventFromLogs( receipt.Logs, validatorManager.ParseInitialValidatorCreated, ) Expect(err).Should(BeNil()) - Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID)) - Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight))) + var validationIDs []ids.ID + for i := range nodes { + validationIDs = append(validationIDs, subnetInfo.SubnetID.Append(uint32(i))) + } + + Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(nodes[0].Weight))) - expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0) emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID) - Expect(emittedValidationID).Should(Equal(expectedValidationID)) + Expect(emittedValidationID).Should(Equal(validationIDs[0])) - return emittedValidationID + return validationIDs } func InitializePoAValidatorSet( @@ -378,26 +420,37 @@ func InitializePoAValidatorSet( validatorManagerAddress common.Address, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, - initialValidatorWeight uint64, -) ids.ID { - convertSubnetTxId := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} - subnetConversionData := poavalidatormanager.SubnetConversionData{ - ConvertSubnetTxID: convertSubnetTxId, + nodes []Node, +) []ids.ID { + initialValidators := make([]warpMessage.SubnetConversionValidatorData, len(nodes)) + initialValidatorsABI := make([]poavalidatormanager.InitialValidator, len(nodes)) + for i, node := range nodes { + initialValidators[i] = warpMessage.SubnetConversionValidatorData{ + NodeID: node.NodeID.Bytes(), + BLSPublicKey: node.NodePoP.PublicKey, + Weight: nodes[i].Weight, + } + initialValidatorsABI[i] = poavalidatormanager.InitialValidator{ + NodeID: node.NodeID.Bytes(), + BlsPublicKey: node.NodePoP.PublicKey[:], + Weight: nodes[i].Weight, + } + } + + subnetConversionData := warpMessage.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, + ManagerChainID: subnetInfo.BlockchainID, + ManagerAddress: validatorManagerAddress[:], + Validators: initialValidators, + } + subnetConversionDataABI := poavalidatormanager.SubnetConversionData{ + SubnetID: subnetInfo.SubnetID, ValidatorManagerBlockchainID: subnetInfo.BlockchainID, ValidatorManagerAddress: validatorManagerAddress, - InitialValidators: []poavalidatormanager.InitialValidator{ - { - NodeID: ids.GenerateTestID(), - Weight: initialValidatorWeight, - BlsPublicKey: blsPublicKey[:], - }, - }, + InitialValidators: initialValidatorsABI, } - - subnetConversionDataBytes, err := PackSubnetConversionData(subnetConversionData) + subnetConversionID, err := warpMessage.SubnetConversionID(subnetConversionData) Expect(err).Should(BeNil()) - subnetConversionID := sha256.Sum256(subnetConversionDataBytes) subnetConversionSignedMessage := ConstructSubnetConversionMessage( subnetConversionID, subnetInfo, @@ -412,21 +465,24 @@ func InitializePoAValidatorSet( subnetInfo, validatorManagerAddress, subnetConversionSignedMessage, - subnetConversionData, + subnetConversionDataABI, ) initialValidatorCreatedEvent, err := GetEventFromLogs( receipt.Logs, validatorManager.ParseInitialValidatorCreated, ) Expect(err).Should(BeNil()) - Expect(initialValidatorCreatedEvent.NodeID).Should(Equal(subnetConversionData.InitialValidators[0].NodeID)) - Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(initialValidatorWeight))) + var validationIDs []ids.ID + for i := range nodes { + validationIDs = append(validationIDs, subnetInfo.SubnetID.Append(uint32(i))) + } + + Expect(initialValidatorCreatedEvent.Weight).Should(Equal(new(big.Int).SetUint64(nodes[0].Weight))) - expectedValidationID := CalculateSubnetConversionValidationId(convertSubnetTxId, 0) emittedValidationID := ids.ID(initialValidatorCreatedEvent.ValidationID) - Expect(emittedValidationID).Should(Equal(expectedValidationID)) + Expect(emittedValidationID).Should(Equal(validationIDs[0])) - return emittedValidationID + return validationIDs } func DeliverNativeTokenSubnetConversion( @@ -504,8 +560,8 @@ func InitializeNativeValidatorRegistration( senderKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, stakeAmount *big.Int, - nodeID ids.ID, - blsPublicKey [bls.PublicKeyLen]byte, + node Node, + expiry uint64, stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, ) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) @@ -515,9 +571,9 @@ func InitializeNativeValidatorRegistration( tx, err := stakingManager.InitializeValidatorRegistration( opts, nativetokenstakingmanager.ValidatorRegistrationInput{ - NodeID: nodeID, - RegistrationExpiry: uint64(time.Now().Add(24 * time.Hour).Unix()), - BlsPublicKey: blsPublicKey[:], + NodeID: node.NodeID[:], + RegistrationExpiry: expiry, + BlsPublicKey: node.NodePoP.PublicKey[:], }, DefaultMinDelegateFeeBips, DefaultMinStakeDurationSeconds, @@ -539,8 +595,8 @@ func InitializeERC20ValidatorRegistration( stakeAmount *big.Int, token *exampleerc20.ExampleERC20, stakingManagerAddress common.Address, - nodeID ids.ID, - blsPublicKey [bls.PublicKeyLen]byte, + node Node, + expiry uint64, stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, ) (*types.Receipt, ids.ID) { ERC20Approve( @@ -558,9 +614,9 @@ func InitializeERC20ValidatorRegistration( tx, err := stakingManager.InitializeValidatorRegistration( opts, erc20tokenstakingmanager.ValidatorRegistrationInput{ - NodeID: nodeID, - RegistrationExpiry: uint64(time.Now().Add(24 * time.Hour).Unix()), - BlsPublicKey: blsPublicKey[:], + NodeID: node.NodeID[:], + RegistrationExpiry: expiry, + BlsPublicKey: node.NodePoP.PublicKey[:], }, DefaultMinDelegateFeeBips, DefaultMinStakeDurationSeconds, @@ -580,9 +636,8 @@ func InitializePoAValidatorRegistration( ctx context.Context, senderKey *ecdsa.PrivateKey, subnet interfaces.SubnetTestInfo, - weight uint64, - nodeID ids.ID, - blsPublicKey [bls.PublicKeyLen]byte, + node Node, + expiry uint64, validatorManager *poavalidatormanager.PoAValidatorManager, ) (*types.Receipt, ids.ID) { opts, err := bind.NewKeyedTransactorWithChainID(senderKey, subnet.EVMChainID) @@ -591,11 +646,11 @@ func InitializePoAValidatorRegistration( tx, err := validatorManager.InitializeValidatorRegistration( opts, poavalidatormanager.ValidatorRegistrationInput{ - NodeID: nodeID, - RegistrationExpiry: uint64(time.Now().Add(24 * time.Hour).Unix()), - BlsPublicKey: blsPublicKey[:], + NodeID: node.NodeID[:], + RegistrationExpiry: expiry, + BlsPublicKey: node.NodePoP.PublicKey[:], }, - weight, + node.Weight, ) Expect(err).Should(BeNil()) receipt := WaitForTransactionSuccess(ctx, subnet, tx.Hash()) @@ -706,42 +761,44 @@ func InitializeAndCompleteNativeValidatorRegistration( pChainInfo interfaces.SubnetTestInfo, stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, stakingManagerContractAddress common.Address, - stakeAmount *big.Int, + expiry uint64, + node Node, ) ids.ID { + stakeAmount, err := stakingManager.WeightToValue( + &bind.CallOpts{}, + node.Weight, + ) + Expect(err).Should(BeNil()) // Initiate validator registration - nodeID := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} receipt, validationID := InitializeNativeValidatorRegistration( ctx, fundedKey, subnetInfo, stakeAmount, - nodeID, - blsPublicKey, + node, + expiry, stakingManager, ) // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + signedWarpMessage := ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) - weight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - stakeAmount, + _, err = network.GetPChainWallet().IssueRegisterSubnetValidatorTx( + 100*units.Avax, + node.NodePoP.ProofOfPossession, + signedWarpMessage.Bytes(), ) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateRegisterSubnetValidatorMessage( - signedWarpMessage, - nodeID, - weight, - subnetInfo.SubnetID, - blsPublicKey, - ) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing validator registration") registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + expiry, + node, true, subnetInfo, pChainInfo, @@ -778,12 +835,17 @@ func InitializeAndCompleteERC20ValidatorRegistration( stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, stakingManagerAddress common.Address, erc20 *exampleerc20.ExampleERC20, - stakeAmount *big.Int, + expiry uint64, + node Node, ) ids.ID { + stakeAmount, err := stakingManager.WeightToValue( + &bind.CallOpts{}, + node.Weight, + ) + Expect(err).Should(BeNil()) // Initiate validator registration - nodeID := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} var receipt *types.Receipt + log.Println("Initializing validator registration") receipt, validationID := InitializeERC20ValidatorRegistration( ctx, fundedKey, @@ -791,32 +853,29 @@ func InitializeAndCompleteERC20ValidatorRegistration( stakeAmount, erc20, stakingManagerAddress, - nodeID, - blsPublicKey, + node, + expiry, stakingManager, ) // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + signedWarpMessage := ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) - weight, err := stakingManager.ValueToWeight( - &bind.CallOpts{}, - stakeAmount, + _, err = network.GetPChainWallet().IssueRegisterSubnetValidatorTx( + 100*units.Avax, + node.NodePoP.ProofOfPossession, + signedWarpMessage.Bytes(), ) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateRegisterSubnetValidatorMessage( - signedWarpMessage, - nodeID, - weight, - subnetInfo.SubnetID, - blsPublicKey, - ) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing validator registration") registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + expiry, + node, true, subnetInfo, pChainInfo, @@ -853,37 +912,37 @@ func InitializeAndCompletePoAValidatorRegistration( pChainInfo interfaces.SubnetTestInfo, validatorManager *poavalidatormanager.PoAValidatorManager, validatorManagerAddress common.Address, - weight uint64, + expiry uint64, + node Node, ) ids.ID { // Initiate validator registration - nodeID := ids.GenerateTestID() - blsPublicKey := [bls.PublicKeyLen]byte{} receipt, validationID := InitializePoAValidatorRegistration( ctx, ownerKey, subnetInfo, - weight, - nodeID, - blsPublicKey, + node, + expiry, validatorManager, ) // Gather subnet-evm Warp signatures for the RegisterSubnetValidatorMessage & relay to the P-Chain - // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + signedWarpMessage := ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) - // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateRegisterSubnetValidatorMessage( - signedWarpMessage, - nodeID, - weight, - subnetInfo.SubnetID, - blsPublicKey, + _, err := network.GetPChainWallet().IssueRegisterSubnetValidatorTx( + 100*units.Avax, + node.NodePoP.ProofOfPossession, + signedWarpMessage.Bytes(), ) + Expect(err).Should(BeNil()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing validator registration") registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + expiry, + node, true, subnetInfo, pChainInfo, @@ -1259,7 +1318,7 @@ func CompleteEndNativeDelegation( ) } -func InitializeAndCompleteEndNativeValidation( +func InitializeAndCompleteEndInitialNativeValidation( ctx context.Context, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, @@ -1269,9 +1328,10 @@ func InitializeAndCompleteEndNativeValidation( stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, stakingManagerAddress common.Address, validationID ids.ID, + index uint32, weight uint64, - nonce uint64, ) { + log.Println("Initializing initial validator removal") WaitMinStakeDuration(ctx, subnetInfo, fundedKey) receipt := ForceInitializeEndNativeValidation( ctx, @@ -1290,15 +1350,102 @@ func InitializeAndCompleteEndNativeValidation( // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + unsignedMessage := ExtractWarpMessageFromLog(ctx, receipt, subnetInfo) + signedWarpMessage, err := signatureAggregator.CreateSignedMessage( + unsignedMessage, + nil, + subnetInfo.SubnetID, + 67, + ) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, nonce) + // Deliver the Warp message to the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing initial validator removal") + registrationSignedMessage := ConstructSubnetValidatorRegistrationMessageForInitialValidator( + validationID, + index, + false, + subnetInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = CompleteEndNativeValidation( + ctx, + fundedKey, + subnetInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + + // Check that the validator is has been delisted from the staking contract + validationEndedEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodEnded, + ) + Expect(err).Should(BeNil()) + Expect(validationEndedEvent.ValidationID[:]).Should(Equal(validationID[:])) +} + +func InitializeAndCompleteEndNativeValidation( + ctx context.Context, + network interfaces.LocalNetwork, + signatureAggregator *aggregator.SignatureAggregator, + fundedKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, + stakingManager *nativetokenstakingmanager.NativeTokenStakingManager, + stakingManagerAddress common.Address, + validationID ids.ID, + expiry uint64, + node Node, + nonce uint64, +) { + log.Println("Initializing validator removal") + WaitMinStakeDuration(ctx, subnetInfo, fundedKey) + receipt := ForceInitializeEndNativeValidation( + ctx, + fundedKey, + subnetInfo, + stakingManager, + validationID, + ) + validatorRemovalEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validatorRemovalEvent.Weight.Uint64()).Should(Equal(node.Weight)) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + unsignedMessage := ExtractWarpMessageFromLog(ctx, receipt, subnetInfo) + signedWarpMessage, err := signatureAggregator.CreateSignedMessage( + unsignedMessage, + nil, + subnetInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + + // Deliver the Warp message to the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing validator removal") registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + expiry, + node, false, subnetInfo, pChainInfo, @@ -1324,7 +1471,7 @@ func InitializeAndCompleteEndNativeValidation( Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) } -func InitializeAndCompleteEndERC20Validation( +func InitializeAndCompleteEndInitialERC20Validation( ctx context.Context, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, @@ -1334,9 +1481,10 @@ func InitializeAndCompleteEndERC20Validation( stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, stakingManagerAddress common.Address, validationID ids.ID, + index uint32, weight uint64, - nonce uint64, ) { + log.Println("Initializing initial validator removal") WaitMinStakeDuration(ctx, subnetInfo, fundedKey) receipt := ForceInitializeEndERC20Validation( ctx, @@ -1355,15 +1503,102 @@ func InitializeAndCompleteEndERC20Validation( // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + unsignedMessage := ExtractWarpMessageFromLog(ctx, receipt, subnetInfo) + signedWarpMessage, err := signatureAggregator.CreateSignedMessage( + unsignedMessage, + nil, + subnetInfo.SubnetID, + 67, + ) Expect(err).Should(BeNil()) - // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, nonce) + // Deliver the Warp message to the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing initial validator removal") + registrationSignedMessage := ConstructSubnetValidatorRegistrationMessageForInitialValidator( + validationID, + index, + false, + subnetInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = CompleteEndERC20Validation( + ctx, + fundedKey, + subnetInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + + // Check that the validator is has been delisted from the staking contract + validationEndedEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodEnded, + ) + Expect(err).Should(BeNil()) + Expect(validationEndedEvent.ValidationID[:]).Should(Equal(validationID[:])) +} + +func InitializeAndCompleteEndERC20Validation( + ctx context.Context, + network interfaces.LocalNetwork, + signatureAggregator *aggregator.SignatureAggregator, + fundedKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, + stakingManager *erc20tokenstakingmanager.ERC20TokenStakingManager, + stakingManagerAddress common.Address, + validationID ids.ID, + expiry uint64, + node Node, + nonce uint64, +) { + log.Println("Initializing validator removal") + WaitMinStakeDuration(ctx, subnetInfo, fundedKey) + receipt := ForceInitializeEndERC20Validation( + ctx, + fundedKey, + subnetInfo, + stakingManager, + validationID, + ) + validatorRemovalEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validatorRemovalEvent.Weight.Uint64()).Should(Equal(node.Weight)) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + unsignedMessage := ExtractWarpMessageFromLog(ctx, receipt, subnetInfo) + signedWarpMessage, err := signatureAggregator.CreateSignedMessage( + unsignedMessage, + nil, + subnetInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + + // Deliver the Warp message to the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing validator removal") registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + expiry, + node, false, subnetInfo, pChainInfo, @@ -1381,12 +1616,89 @@ func InitializeAndCompleteEndERC20Validation( ) // Check that the validator is has been delisted from the staking contract - registrationEvent, err := GetEventFromLogs( + validationEndedEvent, err := GetEventFromLogs( receipt.Logs, stakingManager.ParseValidationPeriodEnded, ) Expect(err).Should(BeNil()) - Expect(registrationEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validationEndedEvent.ValidationID[:]).Should(Equal(validationID[:])) +} + +func InitializeAndCompleteEndInitialPoAValidation( + ctx context.Context, + network interfaces.LocalNetwork, + signatureAggregator *aggregator.SignatureAggregator, + ownerKey *ecdsa.PrivateKey, + fundedKey *ecdsa.PrivateKey, + subnetInfo interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, + stakingManager *poavalidatormanager.PoAValidatorManager, + stakingManagerAddress common.Address, + validationID ids.ID, + index uint32, + weight uint64, +) { + log.Println("Initializing initial validator removal") + WaitMinStakeDuration(ctx, subnetInfo, fundedKey) + receipt := InitializeEndPoAValidation( + ctx, + ownerKey, + subnetInfo, + stakingManager, + validationID, + ) + validatorRemovalEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidatorRemovalInitialized, + ) + Expect(err).Should(BeNil()) + Expect(validatorRemovalEvent.ValidationID[:]).Should(Equal(validationID[:])) + Expect(validatorRemovalEvent.Weight.Uint64()).Should(Equal(weight)) + + // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain + // (Sending to the P-Chain will be skipped for now) + unsignedMessage := ExtractWarpMessageFromLog(ctx, receipt, subnetInfo) + signedWarpMessage, err := signatureAggregator.CreateSignedMessage( + unsignedMessage, + nil, + subnetInfo.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + + // Deliver the Warp message to the P-Chain + network.GetPChainWallet().IssueSetSubnetValidatorWeightTx(signedWarpMessage.Bytes()) + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) + + // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain + log.Println("Completing initial validator removal") + registrationSignedMessage := ConstructSubnetValidatorRegistrationMessageForInitialValidator( + validationID, + index, + false, + subnetInfo, + pChainInfo, + network, + signatureAggregator, + ) + + // Deliver the Warp message to the subnet + receipt = CompleteEndPoAValidation( + ctx, + fundedKey, + subnetInfo, + stakingManagerAddress, + registrationSignedMessage, + ) + + // Check that the validator is has been delisted from the staking contract + validationEndedEvent, err := GetEventFromLogs( + receipt.Logs, + stakingManager.ParseValidationPeriodEnded, + ) + Expect(err).Should(BeNil()) + Expect(validationEndedEvent.ValidationID[:]).Should(Equal(validationID[:])) } func InitializeAndCompleteEndPoAValidation( @@ -1420,15 +1732,17 @@ func InitializeAndCompleteEndPoAValidation( // Gather subnet-evm Warp signatures for the SetSubnetValidatorWeightMessage & relay to the P-Chain // (Sending to the P-Chain will be skipped for now) - signedWarpMessage := network.ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) + signedWarpMessage := ConstructSignedWarpMessage(ctx, receipt, subnetInfo, pChainInfo) Expect(err).Should(BeNil()) // Validate the Warp message, (this will be done on the P-Chain in the future) - ValidateSetSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, nonce) + ValidateSubnetValidatorWeightMessage(signedWarpMessage, validationID, 0, nonce) // Construct a SubnetValidatorRegistrationMessage Warp message from the P-Chain registrationSignedMessage := ConstructSubnetValidatorRegistrationMessage( validationID, + 0, + Node{}, false, subnetInfo, pChainInfo, @@ -1458,17 +1772,79 @@ func InitializeAndCompleteEndPoAValidation( // P-Chain utils // +func ConstructSubnetValidatorRegistrationMessageForInitialValidator( + validationID ids.ID, + index uint32, + valid bool, + subnet interfaces.SubnetTestInfo, + pChainInfo interfaces.SubnetTestInfo, + network interfaces.LocalNetwork, + signatureAggregator *aggregator.SignatureAggregator, +) *avalancheWarp.Message { + justification := platformvm.SubnetValidatorRegistrationJustification{ + Preimage: &platformvm.SubnetValidatorRegistrationJustification_ConvertSubnetTxData{ + ConvertSubnetTxData: &platformvm.SubnetIDIndex{ + SubnetId: subnet.SubnetID[:], + Index: index, + }, + }, + } + justificationBytes, err := proto.Marshal(&justification) + Expect(err).Should(BeNil()) + + registrationPayload, err := warpMessage.NewSubnetValidatorRegistration(validationID, valid) + Expect(err).Should(BeNil()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(nil, registrationPayload.Bytes()) + Expect(err).Should(BeNil()) + registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage( + network.GetNetworkID(), + pChainInfo.BlockchainID, + registrationAddressedCall.Bytes(), + ) + Expect(err).Should(BeNil()) + + registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( + registrationUnsignedMessage, + justificationBytes, + subnet.SubnetID, + 67, + ) + Expect(err).Should(BeNil()) + + return registrationSignedMessage +} + func ConstructSubnetValidatorRegistrationMessage( validationID ids.ID, + expiry uint64, + node Node, valid bool, subnet interfaces.SubnetTestInfo, pChainInfo interfaces.SubnetTestInfo, network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, ) *avalancheWarp.Message { - registrationPayload, err := warpMessages.NewSubnetValidatorRegistration(validationID, valid) + msg, err := warpMessage.NewRegisterSubnetValidator( + subnet.SubnetID, + node.NodeID, + node.NodePoP.PublicKey, + expiry, + warpMessage.PChainOwner{}, + warpMessage.PChainOwner{}, + node.Weight, + ) + Expect(err).Should(BeNil()) + justification := platformvm.SubnetValidatorRegistrationJustification{ + Preimage: &platformvm.SubnetValidatorRegistrationJustification_RegisterSubnetValidatorMessage{ + RegisterSubnetValidatorMessage: msg.Bytes(), + }, + } + justificationBytes, err := proto.Marshal(&justification) + Expect(err).Should(BeNil()) + + registrationPayload, err := warpMessage.NewSubnetValidatorRegistration(validationID, valid) Expect(err).Should(BeNil()) - registrationAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), registrationPayload.Bytes()) + registrationAddressedCall, err := warpPayload.NewAddressedCall(nil, registrationPayload.Bytes()) Expect(err).Should(BeNil()) registrationUnsignedMessage, err := avalancheWarp.NewUnsignedMessage( network.GetNetworkID(), @@ -1479,11 +1855,12 @@ func ConstructSubnetValidatorRegistrationMessage( registrationSignedMessage, err := signatureAggregator.CreateSignedMessage( registrationUnsignedMessage, - nil, + justificationBytes, subnet.SubnetID, 67, ) Expect(err).Should(BeNil()) + return registrationSignedMessage } @@ -1496,9 +1873,9 @@ func ConstructSubnetValidatorWeightUpdateMessage( network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, ) *avalancheWarp.Message { - updatePayload, err := warpMessages.NewSubnetValidatorWeightUpdate(validationID, nonce, weight) + payload, err := warpMessage.NewSubnetValidatorWeight(validationID, nonce, weight) Expect(err).Should(BeNil()) - updateAddressedCall, err := warpPayload.NewAddressedCall(common.Address{}.Bytes(), updatePayload.Bytes()) + updateAddressedCall, err := warpPayload.NewAddressedCall(nil, payload.Bytes()) Expect(err).Should(BeNil()) updateUnsignedMessage, err := avalancheWarp.NewUnsignedMessage( network.GetNetworkID(), @@ -1524,10 +1901,10 @@ func ConstructSubnetConversionMessage( network interfaces.LocalNetwork, signatureAggregator *aggregator.SignatureAggregator, ) *avalancheWarp.Message { - subnetConversionPayload, err := warpMessages.NewSubnetConversion(subnetConversionID) + subnetConversionPayload, err := warpMessage.NewSubnetConversion(subnetConversionID) Expect(err).Should(BeNil()) subnetConversionAddressedCall, err := warpPayload.NewAddressedCall( - common.Address{}.Bytes(), + nil, subnetConversionPayload.Bytes(), ) Expect(err).Should(BeNil()) @@ -1540,7 +1917,7 @@ func ConstructSubnetConversionMessage( subnetConversionSignedMessage, err := signatureAggregator.CreateSignedMessage( subnetConversionUnsignedMessage, - nil, + subnet.SubnetID[:], subnet.SubnetID, 67, ) @@ -1564,20 +1941,20 @@ func ValidateRegisterSubnetValidatorMessage( msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) Expect(err).Should(BeNil()) // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + var payloadInterface warpMessage.Payload + ver, err := warpMessage.Codec.Unmarshal(msg.Payload, &payloadInterface) Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.RegisterSubnetValidator) + payload, ok := payloadInterface.(*warpMessage.RegisterSubnetValidator) Expect(ok).Should(BeTrue()) - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.NodeID).Should(Equal(nodeID)) - Expect(registerValidatorPayload.Weight).Should(Equal(weight)) - Expect(registerValidatorPayload.SubnetID).Should(Equal(subnetID)) - Expect(registerValidatorPayload.BlsPubKey[:]).Should(Equal(blsPublicKey[:])) + Expect(ver).Should(Equal(uint16(warpMessage.CodecVersion))) + Expect(payload.NodeID).Should(Equal(nodeID)) + Expect(payload.Weight).Should(Equal(weight)) + Expect(payload.SubnetID).Should(Equal(subnetID)) + Expect(payload.BLSPublicKey[:]).Should(Equal(blsPublicKey[:])) } -func ValidateSetSubnetValidatorWeightMessage( +func ValidateSubnetValidatorWeightMessage( signedWarpMessage *avalancheWarp.Message, validationID ids.ID, weight uint64, @@ -1586,16 +1963,16 @@ func ValidateSetSubnetValidatorWeightMessage( msg, err := warpPayload.ParseAddressedCall(signedWarpMessage.UnsignedMessage.Payload) Expect(err).Should(BeNil()) // Check that the addressed call payload is a registered Warp message type - var payloadInterface warpMessages.Payload - ver, err := warpMessages.Codec.Unmarshal(msg.Payload, &payloadInterface) + var payloadInterface warpMessage.Payload + ver, err := warpMessage.Codec.Unmarshal(msg.Payload, &payloadInterface) Expect(err).Should(BeNil()) - registerValidatorPayload, ok := payloadInterface.(*warpMessages.SetSubnetValidatorWeight) + payload, ok := payloadInterface.(*warpMessage.SubnetValidatorWeight) Expect(ok).Should(BeTrue()) - Expect(ver).Should(Equal(uint16(warpMessages.CodecVersion))) - Expect(registerValidatorPayload.ValidationID).Should(Equal(validationID)) - Expect(registerValidatorPayload.Weight).Should(Equal(weight)) - Expect(registerValidatorPayload.Nonce).Should(Equal(nonce)) + Expect(ver).Should(Equal(uint16(warpMessage.CodecVersion))) + Expect(payload.ValidationID).Should(Equal(validationID)) + Expect(payload.Weight).Should(Equal(weight)) + Expect(payload.Nonce).Should(Equal(nonce)) } func WaitMinStakeDuration( @@ -1617,9 +1994,9 @@ func WaitMinStakeDuration( ) } -func CalculateSubnetConversionValidationId(convertSubnetTxID ids.ID, validatorIdx uint32) ids.ID { +func CalculateSubnetConversionValidationId(subnetID ids.ID, validatorIdx uint32) ids.ID { preImage := make([]byte, 36) - copy(preImage[0:32], convertSubnetTxID[:]) + copy(preImage[0:32], subnetID[:]) binary.BigEndian.PutUint32(preImage[32:36], validatorIdx) return sha256.Sum256(preImage) } @@ -1634,7 +2011,7 @@ func PackSubnetConversionData(data interface{}) ([]byte, error) { } // Define required fields and their expected types requiredFields := map[string]reflect.Type{ - "ConvertSubnetTxID": reflect.TypeOf([32]byte{}), + "SubnetID": reflect.TypeOf([32]byte{}), "ValidatorManagerBlockchainID": reflect.TypeOf([32]byte{}), "ValidatorManagerAddress": reflect.TypeOf(common.Address{}), // InitialValidators is a slice of structs and handled separately @@ -1659,35 +2036,39 @@ func PackSubnetConversionData(data interface{}) ([]byte, error) { } } - convertSubnetTxID := v.FieldByName("ConvertSubnetTxID").Interface().([32]byte) + subnetID := v.FieldByName("SubnetID").Interface().([32]byte) validatorManagerBlockchainID := v.FieldByName("ValidatorManagerBlockchainID").Interface().([32]byte) validatorManagerAddress := v.FieldByName("ValidatorManagerAddress").Interface().(common.Address) initialValidators := v.FieldByName("InitialValidators") - packedLen := 92 + initialValidatorPackedLen*initialValidators.Len() - b := make([]byte, packedLen) - copy(b[0:32], convertSubnetTxID[:]) - copy(b[32:64], validatorManagerBlockchainID[:]) - // These are evm addresses and have lengths of 20 so hardcoding here - binary.BigEndian.PutUint32(b[64:68], uint32(20)) - copy(b[68:88], validatorManagerAddress.Bytes()) - binary.BigEndian.PutUint32(b[88:92], uint32(initialValidators.Len())) // Pack each InitialValidator struct + packedInitialValidators := make([][]byte, initialValidators.Len()) + var packedInitialValidatorsLen uint32 for i := 0; i < initialValidators.Len(); i++ { iv := initialValidators.Index(i).Interface() ivPacked, err := PackInitialValidator(iv) if err != nil { return nil, fmt.Errorf("failed to pack InitialValidator: %w", err) } - if len(ivPacked) != initialValidatorPackedLen { - return nil, fmt.Errorf( - "expected packed InitialValidator to be %d bytes, got %d", - initialValidatorPackedLen, - len(ivPacked), - ) - } - copy(b[92+i*initialValidatorPackedLen:92+(i+1)*initialValidatorPackedLen], ivPacked) + + packedInitialValidators[i] = ivPacked + packedInitialValidatorsLen += uint32(len(ivPacked)) } + + b := make([]byte, 94+packedInitialValidatorsLen) + binary.BigEndian.PutUint16(b[0:2], uint16(warpMessage.CodecVersion)) + copy(b[2:34], subnetID[:]) + copy(b[34:66], validatorManagerBlockchainID[:]) + // These are evm addresses and have lengths of 20 so hardcoding here + binary.BigEndian.PutUint32(b[66:70], uint32(20)) + copy(b[70:90], validatorManagerAddress.Bytes()) + binary.BigEndian.PutUint32(b[90:94], uint32(initialValidators.Len())) + offset := 94 + for _, ivPacked := range packedInitialValidators { + copy(b[offset:offset+len(ivPacked)], ivPacked) + offset += len(ivPacked) + } + return b, nil } @@ -1704,7 +2085,7 @@ func PackInitialValidator(iv interface{}) ([]byte, error) { // Define required fields and their expected types requiredFields := map[string]reflect.Type{ - "NodeID": reflect.TypeOf([32]byte{}), + "NodeID": reflect.TypeOf([]byte{}), "Weight": reflect.TypeOf(uint64(0)), "BlsPublicKey": reflect.TypeOf([]byte{}), } @@ -1724,13 +2105,159 @@ func PackInitialValidator(iv interface{}) ([]byte, error) { // At this point, we know the struct has all required fields with correct types // Use reflection to retrieve field values and perform canonical packing - nodeID := v.FieldByName("NodeID").Interface().([32]byte) + nodeID := v.FieldByName("NodeID").Interface().([]byte) weight := v.FieldByName("Weight").Interface().(uint64) blsPublicKey := v.FieldByName("BlsPublicKey").Interface().([]byte) - b := make([]byte, initialValidatorPackedLen) - copy(b[0:32], nodeID[:]) - binary.BigEndian.PutUint64(b[32:40], weight) - copy(b[40:88], blsPublicKey) + b := make([]byte, 60+len(nodeID)) + binary.BigEndian.PutUint32(b[0:4], uint32(len(nodeID))) + copy(b[4:4+len(nodeID)], nodeID[:]) + binary.BigEndian.PutUint64(b[4+len(nodeID):4+len(nodeID)+8], weight) + copy(b[4+len(nodeID)+8:4+len(nodeID)+8+48], blsPublicKey) return b, nil } + +func PChainProposerVMWorkaround( + network interfaces.LocalNetwork, +) { + // Workaround current block map rules + destAddr, err := address.ParseToID(DefaultPChainAddress) + Expect(err).Should(BeNil()) + log.Println("Waiting for P-Chain...") + time.Sleep(30 * time.Second) + + pBuilder := network.GetPChainWallet().Builder() + pContext := pBuilder.Context() + avaxAssetID := pContext.AVAXAssetID + locktime := uint64(time.Date(2030, 1, 1, 0, 0, 0, 0, time.UTC).Unix()) + amount := 500 * units.MilliAvax + _, err = network.GetPChainWallet().IssueBaseTx([]*avax.TransferableOutput{ + { + Asset: avax.Asset{ + ID: avaxAssetID, + }, + Out: &stakeable.LockOut{ + Locktime: locktime, + TransferableOut: &secp256k1fx.TransferOutput{ + Amt: amount, + OutputOwners: secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + destAddr, + }, + }, + }, + }, + }, + }) + Expect(err).Should(BeNil()) + _, err = network.GetPChainWallet().IssueBaseTx([]*avax.TransferableOutput{ + { + Asset: avax.Asset{ + ID: avaxAssetID, + }, + Out: &stakeable.LockOut{ + Locktime: locktime, + TransferableOut: &secp256k1fx.TransferOutput{ + Amt: amount, + OutputOwners: secp256k1fx.OutputOwners{ + Threshold: 1, + Addrs: []ids.ShortID{ + destAddr, + }, + }, + }, + }, + }, + }) + Expect(err).Should(BeNil()) + // End workaround +} + +func AdvanceProposerVM( + ctx context.Context, + subnet interfaces.SubnetTestInfo, + fundedKey *ecdsa.PrivateKey, + blocks int, +) { + for i := 0; i < blocks; i++ { + err := subnetEvmUtils.IssueTxsToActivateProposerVMFork( + ctx, subnet.EVMChainID, fundedKey, subnet.WSClient, + ) + Expect(err).Should(BeNil()) + } +} + +func ConvertSubnet( + ctx context.Context, + subnetInfo interfaces.SubnetTestInfo, + network interfaces.LocalNetwork, + stakingManagerAddress common.Address, + fundedKey *ecdsa.PrivateKey, +) []Node { + // Remove the current validators before converting the subnet + var nodes []Node + for _, uri := range subnetInfo.NodeURIs { + infoClient := info.NewClient(uri) + nodeID, nodePoP, err := infoClient.GetNodeID(ctx) + Expect(err).Should(BeNil()) + nodes = append(nodes, Node{ + NodeID: nodeID, + NodePoP: nodePoP, + }) + + _, err = network.GetPChainWallet().IssueRemoveSubnetValidatorTx( + nodeID, + subnetInfo.SubnetID, + ) + Expect(err).Should(BeNil()) + } + + // Sort the nodeIDs so that the subnet conversion ID matches the P-Chain + sort.Slice(nodes, func(i, j int) bool { + return string(nodes[i].NodeID.Bytes()) < string(nodes[j].NodeID.Bytes()) + }) + + totalWeight := uint64(len(nodes)-1) * units.Schmeckle + for i := 0; i < len(nodes)-1; i++ { + nodes[i].Weight = units.Schmeckle + totalWeight += units.Schmeckle + } + // Set the last node's weight such that removing any other node will not violate the churn limit + nodes[len(nodes)-1].Weight = 4 * totalWeight + + // Construct the convert subnet info + destAddr, err := address.ParseToID(DefaultPChainAddress) + Expect(err).Should(BeNil()) + vdrs := make([]*txs.ConvertSubnetValidator, len(nodes)) + for i, node := range nodes { + vdrs[i] = &txs.ConvertSubnetValidator{ + NodeID: node.NodeID.Bytes(), + Weight: nodes[i].Weight, + Balance: units.Avax * 100, + Signer: *node.NodePoP, + RemainingBalanceOwner: warpMessage.PChainOwner{ + Threshold: 1, + Addresses: []ids.ShortID{destAddr}, + }, + DeactivationOwner: warpMessage.PChainOwner{ + Threshold: 1, + Addresses: []ids.ShortID{destAddr}, + }, + } + } + + log.Println("Issuing ConvertSubnetTx") + _, err = network.GetPChainWallet().IssueConvertSubnetTx( + subnetInfo.SubnetID, + subnetInfo.BlockchainID, + stakingManagerAddress[:], + vdrs, + ) + Expect(err).Should(BeNil()) + + PChainProposerVMWorkaround(network) + AdvanceProposerVM(ctx, subnetInfo, fundedKey, 5) + + return nodes +} diff --git a/utils/deployment-utils/deployment_utils.go b/utils/deployment-utils/deployment_utils.go index a12dbaf12..3f0ba81ca 100644 --- a/utils/deployment-utils/deployment_utils.go +++ b/utils/deployment-utils/deployment_utils.go @@ -126,8 +126,6 @@ func ConstructKeylessTransaction( contractAddress := crypto.CreateAddress(senderAddress, 0) contractAddressString := contractAddress.Hex() // "0x" prepended by Hex() already. - log.Println("Raw Teleporter Contract Creation Transaction:") - log.Println(contractCreationTxString) log.Println("Teleporter Contract Keyless Deployer Address: ", senderAddressString) log.Println("Teleporter Messenger Universal Contract Address: ", contractAddressString)