feat: post oracle config to DataEdge on startup#40
Conversation
369f829 to
37ae754
Compare
5691a31 to
667f062
Compare
Minor: signing key parsed twiceThe signing key gets parsed twice in the non-dry-run path due to scoping — once for DataEdge posting, then again for StateManager setup. Not a bug, but could be cleaner: async fn run(logger: Logger, config: Config) -> Result<()> {
let config_params = /* ... */;
// Parse signing key once at the top of the non-dry-run path
let signing_key: Option<SecretKey> = if config.dry_run {
None
} else {
Some(config.signing_key.as_ref().unwrap().parse()?)
};
if config.dry_run {
// dry-run logic...
} else {
let signing_key = signing_key.as_ref().unwrap();
// DataEdge posting using signing_key...
}
// ... ipfs, subgraph setup ...
let contract: Box<dyn StateManager> = if config.dry_run {
Box::new(StateManagerDryRun::new(logger.clone()))
} else {
let signing_key = signing_key.as_ref().unwrap();
state_manager(config.url, signing_key, /* ... */).await?
};
// ...
}Low priority, just a cleanup opportunity. Review by @MoonBoi9001 with @claude |
|
I see there are two versions of We have no safety limit on gas price? Or do we limit by how much is available to spend? Minor, but you can switch to format! (runtime allocation) to a compile time constant using |
|
Thank you for the reviews. @MoonBoi9001 addressed your suggestiong on b2b6813 @RembrandtK implemented your suggestion to have a separate
We don't have a limit on gas price, I just followed what we are doing on the other transactions that are sent from this oracle. We might want to add a limit eventually but we also need to think what the behavior should be for high gas price.
I left this as it is, the gain is small and this is a one time startup operation. |
No description provided.