Documentation ¶
Index ¶
- func GetClaimIntervalTime(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (time.Duration, error)
- func GetNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetPendingRPLRewards(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetProtocolDaoRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetTrustedNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func IsAtlasDeployed(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)
- func IsRedstoneDeployed(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)
- type NetworkState
- type NetworkStateManager
- func (m *NetworkStateManager) GetHeadSlot() (uint64, error)
- func (m *NetworkStateManager) GetHeadState() (*NetworkState, error)
- func (m *NetworkStateManager) GetHeadStateForNode(nodeAddress common.Address, calculateTotalEffectiveStake bool) (*NetworkState, *big.Int, error)
- func (m *NetworkStateManager) GetLatestBeaconBlock() (beacon.BeaconBlock, error)
- func (m *NetworkStateManager) GetLatestFinalizedBeaconBlock() (beacon.BeaconBlock, error)
- func (m *NetworkStateManager) GetLatestProposedBeaconBlock(targetSlot uint64) (beacon.BeaconBlock, error)
- func (m *NetworkStateManager) GetStateForSlot(slotNumber uint64) (*NetworkState, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClaimIntervalTime ¶
func GetClaimIntervalTime(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (time.Duration, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetNodeOperatorRewardsPercent ¶
func GetNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetPendingRPLRewards ¶
func GetPendingRPLRewards(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetProtocolDaoRewardsPercent ¶
func GetProtocolDaoRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetTrustedNodeOperatorRewardsPercent ¶
func GetTrustedNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func IsAtlasDeployed ¶
func IsAtlasDeployed(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)
Check if Atlas has been deployed
func IsRedstoneDeployed ¶
func IsRedstoneDeployed(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)
Check if Redstone has been deployed
Types ¶
type NetworkState ¶
type NetworkState struct { // Block / slot for this state ElBlockNumber uint64 BeaconSlotNumber uint64 BeaconConfig beacon.Eth2Config // Network details NetworkDetails *rpstate.NetworkDetails // Node details NodeDetails []rpstate.NativeNodeDetails NodeDetailsByAddress map[common.Address]*rpstate.NativeNodeDetails // Minipool details MinipoolDetails []rpstate.NativeMinipoolDetails MinipoolDetailsByAddress map[common.Address]*rpstate.NativeMinipoolDetails MinipoolDetailsByNode map[common.Address][]*rpstate.NativeMinipoolDetails // Validator details ValidatorDetails map[types.ValidatorPubkey]beacon.ValidatorStatus // Oracle DAO details OracleDaoMemberDetails []rpstate.OracleDaoMemberDetails // contains filtered or unexported fields }
func CreateNetworkState ¶
func CreateNetworkState(cfg *config.RocketPoolConfig, rp *rocketpool.RocketPool, ec rocketpool.ExecutionClient, bc beacon.Client, log *log.ColorLogger, slotNumber uint64, beaconConfig beacon.Eth2Config) (*NetworkState, error)
Creates a snapshot of the entire Rocket Pool network state, on both the Execution and Consensus layers
func CreateNetworkStateForNode ¶
func CreateNetworkStateForNode(cfg *config.RocketPoolConfig, rp *rocketpool.RocketPool, ec rocketpool.ExecutionClient, bc beacon.Client, log *log.ColorLogger, slotNumber uint64, beaconConfig beacon.Eth2Config, nodeAddress common.Address, calculateTotalEffectiveStake bool) (*NetworkState, *big.Int, error)
Creates a snapshot of the Rocket Pool network, but only for a single node Also gets the total effective RPL stake of the network for convenience since this is required by several node routines
func (*NetworkState) CalculateTrueEffectiveStakes ¶
func (s *NetworkState) CalculateTrueEffectiveStakes(scaleByParticipation bool, allowRplForUnstartedValidators bool) (map[common.Address]*big.Int, *big.Int, error)
Calculate the true effective stakes of all nodes in the state, using the validator status on Beacon as a reference for minipool eligibility instead of the EL-based minipool status
type NetworkStateManager ¶
type NetworkStateManager struct { Config *config.RocketPoolConfig Network cfgtypes.Network ChainID uint BeaconConfig beacon.Eth2Config // contains filtered or unexported fields }
func NewNetworkStateManager ¶
func NewNetworkStateManager(rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, ec rocketpool.ExecutionClient, bc beacon.Client, log *log.ColorLogger) (*NetworkStateManager, error)
Create a new manager for the network state
func (*NetworkStateManager) GetHeadSlot ¶
func (m *NetworkStateManager) GetHeadSlot() (uint64, error)
Gets the Beacon slot for the latest execution layer block
func (*NetworkStateManager) GetHeadState ¶
func (m *NetworkStateManager) GetHeadState() (*NetworkState, error)
Get the state of the network using the latest Execution layer block
func (*NetworkStateManager) GetHeadStateForNode ¶
func (m *NetworkStateManager) GetHeadStateForNode(nodeAddress common.Address, calculateTotalEffectiveStake bool) (*NetworkState, *big.Int, error)
Get the state of the network for a single node using the latest Execution layer block, along with the total effective RPL stake for the network
func (*NetworkStateManager) GetLatestBeaconBlock ¶
func (m *NetworkStateManager) GetLatestBeaconBlock() (beacon.BeaconBlock, error)
Gets the latest valid block
func (*NetworkStateManager) GetLatestFinalizedBeaconBlock ¶
func (m *NetworkStateManager) GetLatestFinalizedBeaconBlock() (beacon.BeaconBlock, error)
Gets the latest valid finalized block
func (*NetworkStateManager) GetLatestProposedBeaconBlock ¶ added in v1.10.0
func (m *NetworkStateManager) GetLatestProposedBeaconBlock(targetSlot uint64) (beacon.BeaconBlock, error)
Gets the target Beacon block, or if it was missing, the first one under it that wasn't missing
func (*NetworkStateManager) GetStateForSlot ¶
func (m *NetworkStateManager) GetStateForSlot(slotNumber uint64) (*NetworkState, error)
Get the state of the network at the provided Beacon slot