feat: add PostageTTL and PostageLabel options to all Beekeeper checks#454
feat: add PostageTTL and PostageLabel options to all Beekeeper checks#454gacevicljubisa merged 27 commits intomasterfrom
Conversation
|
we should deprecate postage amount altogether |
| optionNameConfigGitRepo = "config-git-repo" | ||
| optionNameConfigGitUsername = "config-git-username" | ||
| optionNameEnableK8S = "enable-k8s" | ||
| optionNameGethURL = "geth-url" |
There was a problem hiding this comment.
rename to blockchain-rpc-endpoint
There was a problem hiding this comment.
this would require changes in helm charts?
pkg/swap/block.go
Outdated
| } | ||
|
|
||
| timestampPrevious, err := g.fetchBlockTimestamp(ctx, latestBlockNumber-1) | ||
| timestampPrevious, err := g.fetchBlockTimestamp(ctx, latestBlockNumber-o.offset) |
There was a problem hiding this comment.
what if latestBlockNumber is less than o.offset ? this could occur in custom environment with new deployments of geth.
There was a problem hiding this comment.
also by default o.offset is zero, if the option to define it is not used.
There was a problem hiding this comment.
what if latestBlockNumber is less than o.offset ? this could occur in custom environment with new deployments of geth.
Well, I was hoping that RPC will return error in this case. But maybe I can implement some retry logic that can half the offset until it finds the value? What do you think?
Or is it ok to use 0 as the lowest block number?
There was a problem hiding this comment.
i think using zero should be ok.
you can do something like:
if latestBlockNumber < o.offset {
g.fetchBlockTimestamp(ctx, 0)
}
There was a problem hiding this comment.
For some reason, when block 0 is used to query the Geth node, it returns the timestamp 1582023590, which corresponds to February 18, 2020. To avoid this issue, I limited the maximum offset to half of the latest block number.
pkg/swap/block.go
Outdated
| } | ||
|
|
||
| timestampPrevious, err := g.fetchBlockTimestamp(ctx, latestBlockNumber-1) | ||
| timestampPrevious, err := g.fetchBlockTimestamp(ctx, latestBlockNumber-o.offset) |
There was a problem hiding this comment.
also by default o.offset is zero, if the option to define it is not used.
README.md
Outdated
| --config-git-repo string URL of the Git repository containing configuration files (uses the config-dir if not specified) | ||
| --config-git-username string Git username for authentication (required for private repositories) | ||
| --enable-k8s Enable Kubernetes client functionality (default true) | ||
| --geth-url string URL of the RPC blockchain endpoint |
There was a problem hiding this comment.
Maybe URL of the ethereum compatible blockchain RPC endpoint?
| log: log, | ||
| retry: retryCount, | ||
| log: log, | ||
| swapClient: opts.SwapClient, |
There was a problem hiding this comment.
In case that opts.SwapClient is nil, use swap.NotSet.
There was a problem hiding this comment.
thanks for the idea :)
No description provided.