-
Notifications
You must be signed in to change notification settings - Fork 260
feat(fortuna): Support new Entropy v2 contract #2691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jayantk
wants to merge
6
commits into
main
Choose a base branch
from
entropy_error9
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ed5476d
upgrading to use the new contract API
jayantk c0444e0
deployable tester and contract testing
jayantk 3c2a7f5
merge
jayantk b6dc863
making this work on the new contracts
jayantk 1126b39
cleanup
jayantk f54b162
cleanup another thing
jayantk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "fortuna" | ||
version = "7.5.3" | ||
version = "8.0.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,7 +133,7 @@ pub struct EthereumConfig { | |
pub legacy_tx: bool, | ||
|
||
/// The gas limit to use for entropy callback transactions. | ||
pub gas_limit: u64, | ||
pub gas_limit: u32, | ||
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. u32 is the size of the field in the contract |
||
|
||
/// The percentage multiplier to apply to priority fee estimates (100 = no change, e.g. 150 = 150% of base fee) | ||
#[serde(default = "default_priority_fee_multiplier_pct")] | ||
|
@@ -200,23 +200,6 @@ fn default_backlog_range() -> u64 { | |
|
||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] | ||
pub struct EscalationPolicyConfig { | ||
// The keeper will perform the callback as long as the tx is within this percentage of the configured gas limit. | ||
// Default value is 110, meaning a 10% tolerance over the configured value. | ||
#[serde(default = "default_gas_limit_tolerance_pct")] | ||
pub gas_limit_tolerance_pct: u64, | ||
|
||
/// The initial gas multiplier to apply to the tx gas estimate | ||
#[serde(default = "default_initial_gas_multiplier_pct")] | ||
pub initial_gas_multiplier_pct: u64, | ||
|
||
/// The gas multiplier to apply to the tx gas estimate during backoff retries. | ||
/// The gas on each successive retry is multiplied by this value, with the maximum multiplier capped at `gas_multiplier_cap_pct`. | ||
#[serde(default = "default_gas_multiplier_pct")] | ||
pub gas_multiplier_pct: u64, | ||
/// The maximum gas multiplier to apply to the tx gas estimate during backoff retries. | ||
#[serde(default = "default_gas_multiplier_cap_pct")] | ||
pub gas_multiplier_cap_pct: u64, | ||
|
||
/// The fee multiplier to apply to the fee during backoff retries. | ||
/// The initial fee is 100% of the estimate (which itself may be padded based on our chain configuration) | ||
/// The fee on each successive retry is multiplied by this value, with the maximum multiplier capped at `fee_multiplier_cap_pct`. | ||
|
@@ -226,22 +209,6 @@ pub struct EscalationPolicyConfig { | |
pub fee_multiplier_cap_pct: u64, | ||
} | ||
|
||
fn default_gas_limit_tolerance_pct() -> u64 { | ||
110 | ||
} | ||
|
||
fn default_initial_gas_multiplier_pct() -> u64 { | ||
125 | ||
} | ||
|
||
fn default_gas_multiplier_pct() -> u64 { | ||
110 | ||
} | ||
|
||
fn default_gas_multiplier_cap_pct() -> u64 { | ||
600 | ||
} | ||
|
||
fn default_fee_multiplier_pct() -> u64 { | ||
110 | ||
} | ||
|
@@ -253,10 +220,6 @@ fn default_fee_multiplier_cap_pct() -> u64 { | |
impl Default for EscalationPolicyConfig { | ||
fn default() -> Self { | ||
Self { | ||
gas_limit_tolerance_pct: default_gas_limit_tolerance_pct(), | ||
initial_gas_multiplier_pct: default_initial_gas_multiplier_pct(), | ||
gas_multiplier_pct: default_gas_multiplier_pct(), | ||
gas_multiplier_cap_pct: default_gas_multiplier_cap_pct(), | ||
fee_multiplier_pct: default_fee_multiplier_pct(), | ||
fee_multiplier_cap_pct: default_fee_multiplier_cap_pct(), | ||
} | ||
|
@@ -266,10 +229,6 @@ impl Default for EscalationPolicyConfig { | |
impl EscalationPolicyConfig { | ||
pub fn to_policy(&self) -> EscalationPolicy { | ||
EscalationPolicy { | ||
gas_limit_tolerance_pct: self.gas_limit_tolerance_pct, | ||
initial_gas_multiplier_pct: self.initial_gas_multiplier_pct, | ||
gas_multiplier_pct: self.gas_multiplier_pct, | ||
gas_multiplier_cap_pct: self.gas_multiplier_cap_pct, | ||
fee_multiplier_pct: self.fee_multiplier_pct, | ||
fee_multiplier_cap_pct: self.fee_multiplier_cap_pct, | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why is this removed? I know that this check exists in some other places, but if we want to be safe and avoid unintended changes, we can keep it as is?