Documentation
¶
Index ¶
- func BytesToQuorumNumbers(quorumNumbersBytes []byte) eigentypes.QuorumNums
- func BytesToQuorumThresholdPercentages(quorumThresholdPercentagesBytes []byte) eigentypes.QuorumThresholdPercentages
- func CalculateGasPriceBumpBasedOnRetry(currentGasPrice *big.Int, baseBumpPercentage uint, retryAttemptPercentage uint, ...) *big.Int
- func ConvertToBN254G1Point(input *bls.G1Point) servicemanager.BN254G1Point
- func ConvertToBN254G2Point(input *bls.G2Point) servicemanager.BN254G2Point
- func GetGasPriceRetryable(client eth.InstrumentedClient, fallbackClient eth.InstrumentedClient, ...) (*big.Int, error)
- func ReadFile(path string) ([]byte, error)
- func ReadJsonConfig(path string, o interface{}) error
- func ReadYamlConfig(path string, o interface{}) error
- func WaitForTransactionReceiptRetryable(client eth.InstrumentedClient, fallbackClient eth.InstrumentedClient, ...) (*types.Receipt, error)
- func WeiToEth(wei *big.Int) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToQuorumNumbers ¶
func BytesToQuorumNumbers(quorumNumbersBytes []byte) eigentypes.QuorumNums
func BytesToQuorumThresholdPercentages ¶
func BytesToQuorumThresholdPercentages(quorumThresholdPercentagesBytes []byte) eigentypes.QuorumThresholdPercentages
func CalculateGasPriceBumpBasedOnRetry ¶ added in v0.11.0
func CalculateGasPriceBumpBasedOnRetry(currentGasPrice *big.Int, baseBumpPercentage uint, retryAttemptPercentage uint, bumpPercentageLimit uint, retryCount int) *big.Int
Simple algorithm to calculate the gasPrice bump based on: the currentGasPrice, a base bump percentage, a retry percentage, and the retry count. Formula: currentGasPrice + (currentGasPrice * (baseBumpPercentage + retryCount * incrementalRetryPercentage) / 100)
func ConvertToBN254G1Point ¶
func ConvertToBN254G1Point(input *bls.G1Point) servicemanager.BN254G1Point
BN254.sol is a library, so bindings for G1 Points and G2 Points are only generated in every contract that imports that library. Thus the output here will need to be type casted if G1Point is needed to interface with another contract (eg: BLSPublicKeyCompendium.sol)
func ConvertToBN254G2Point ¶
func ConvertToBN254G2Point(input *bls.G2Point) servicemanager.BN254G2Point
func GetGasPriceRetryable ¶ added in v0.11.0
func GetGasPriceRetryable(client eth.InstrumentedClient, fallbackClient eth.InstrumentedClient, config *retry.RetryParams) (*big.Int, error)
GetGasPriceRetryable Get the gas price from the client with retry logic. - All errors are considered Transient Errors - Retry times: 1 sec, 2 sec, 4 sec
func ReadJsonConfig ¶ added in v0.12.0
func ReadYamlConfig ¶ added in v0.12.0
func WaitForTransactionReceiptRetryable ¶ added in v0.11.0
func WaitForTransactionReceiptRetryable(client eth.InstrumentedClient, fallbackClient eth.InstrumentedClient, txHash gethcommon.Hash, config *retry.RetryParams) (*types.Receipt, error)
WaitForTransactionReceiptRetryable repeatedly attempts to fetch the transaction receipt for a given transaction hash. If the receipt is not found, the function will retry with exponential backoff until the specified `waitTimeout` duration is reached. If the receipt is still unavailable after `waitTimeout`, it will return an error.
Note: The `time.Second * 2` is set as the max interval in the retry mechanism because we can't reliably measure the specific time the tx will be included in a block. Setting a higher value will imply doing less retries across the waitTimeout, and so we might lose the receipt All errors are considered Transient Errors - Retry times: 0.5s, 1s, 2s, 2s, 2s, ... until it reaches waitTimeout
Types ¶
This section is empty.