-
Notifications
You must be signed in to change notification settings - Fork 50
fix: move the key parameters to env #137
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,10 +15,6 @@ import ( | |
| "github.com/InjectiveLabs/peggo/orchestrator/loops" | ||
| ) | ||
|
|
||
| const ( | ||
| defaultLoopDur = 60 * time.Second | ||
| ) | ||
|
|
||
| // PriceFeed provides token price for a given contract address | ||
| type PriceFeed interface { | ||
| QueryUSDPrice(address gethcommon.Address) (float64, error) | ||
|
|
@@ -34,6 +30,12 @@ type Config struct { | |
| RelayValsets bool | ||
| RelayBatches bool | ||
| RelayerMode bool | ||
| LoopDuration time.Duration | ||
|
|
||
| // Maximum block range for Ethereum event query. If the orchestrator has been offline for a long time, | ||
| // the oracle loop can potentially run longer than defaultLoopDur due to a surge of events. This usually happens | ||
| // when there are more than ~50 events to claim in a single run. | ||
| NumberOfBlocksToSearch uint64 | ||
| } | ||
|
Comment on lines
+35
to
39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainConsider using uint64 consistently. The NumberOfBlocksToSearch field uses uint64, which is appropriate for block numbers. However, ensure this type is used consistently across the codebase for block-related values. 🏁 Script executed: #!/bin/bash
# Check for inconsistent block number types
rg -A 1 "block.*uint|block.*int" --type goLength of output: 301 Ensure Consistent Block Number Types Across Files Please update block number types for consistency. While the |
||
|
|
||
| type Orchestrator struct { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add validation for the new configuration values.
The code should validate:
PEGGO_LOOP_DURATIONis a valid duration string (e.g., "60s", "1m").PEGGO_BLOCKS_TO_SEARCHis a positive number.Would you like me to generate the validation code for these configuration values?