Skip to content

Commit

Permalink
update feeoraclev2 for new xfeemngr vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Zodomo committed Nov 14, 2024
1 parent daed86a commit 82638db
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
18 changes: 9 additions & 9 deletions contracts/avs/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OmniAVS_admin_Test:test_avsDirectory_succeeds() (gas: 17892)
OmniAVS_admin_Test:test_ejectOwner_byOwner_succeeds() (gas: 433687)
OmniAVS_admin_Test:test_ejectOwner_byOwner_succeeds() (gas: 435687)
OmniAVS_admin_Test:test_ejectOwner_notOwner_reverts() (gas: 107965)
OmniAVS_admin_Test:test_getOPeratorRestakedStrategies_notOperator_succeeds() (gas: 108732)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_noStrategies_succeeds() (gas: 516711)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_succeeds() (gas: 581706)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_noStrategies_succeeds() (gas: 519211)
OmniAVS_admin_Test:test_getOperatorRestakedStrategies_succeeds() (gas: 584206)
OmniAVS_admin_Test:test_getRestakeableStrategies_noStrategies_succeeds() (gas: 27757)
OmniAVS_admin_Test:test_getRestakeableStrategies_succeeds() (gas: 90719)
OmniAVS_admin_Test:test_pause_byOwner_succeeds() (gas: 45167)
Expand Down Expand Up @@ -40,21 +40,21 @@ OmniAVS_allowlist_Test:test_disableAllowlist_succeeds() (gas: 29389)
OmniAVS_allowlist_Test:test_enableAllowlist_alreadyEnabled_reverts() (gas: 26027)
OmniAVS_allowlist_Test:test_enableAllowlist_notOwner_reverts() (gas: 17844)
OmniAVS_allowlist_Test:test_enableAllowlist_succeeds() (gas: 29831)
OmniAVS_allowlist_Test:test_registerOperator_allowlistDisabled_succeeds() (gas: 519995)
OmniAVS_allowlist_Test:test_registerOperator_allowlistDisabled_succeeds() (gas: 522495)
OmniAVS_allowlist_Test:test_registerOperator_invalidPubkey_reverts() (gas: 314771)
OmniAVS_allowlist_Test:test_registerOperator_nowAllowed_reverts() (gas: 117028)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 538434)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 540287)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 540934)
OmniAVS_allowlist_Test:test_registerOperator_succeeds() (gas: 542787)
OmniAVS_allowlist_Test:test_registerOperator_wrongPubkey_reverts() (gas: 404418)
OmniAVS_allowlist_Test:test_removeFromAllowlist_notOwner_reverts() (gas: 107967)
OmniAVS_allowlist_Test:test_removeFromAllowlist_succeeds() (gas: 242142)
OmniAVS_canRegister_Test:test_canRegister_allowed() (gas: 331230)
OmniAVS_canRegister_Test:test_canRegister_allowlistDisabled() (gas: 311203)
OmniAVS_canRegister_Test:test_canRegister_alreadyRegistered() (gas: 522800)
OmniAVS_canRegister_Test:test_canRegister_alreadyRegistered() (gas: 525300)
OmniAVS_canRegister_Test:test_canRegister_maxOperatorsReached() (gas: 265051)
OmniAVS_canRegister_Test:test_canRegister_minStakeNotMet() (gas: 331770)
OmniAVS_canRegister_Test:test_canRegister_notAllowed() (gas: 225880)
OmniAVS_canRegister_Test:test_canRegister_notOperator() (gas: 120672)
OmniAVS_initialize_Test:test_initialize_defaultParams_succeeds() (gas: 3596420)
OmniAVS_syncWithOmni_Test:test_depositBeaconEth_succeeds() (gas: 635740)
OmniAVS_syncWithOmni_Test:test_unsupportedStrategyDeposit_succeeds() (gas: 1675178)
OmniAVS_syncWithOmni_Test:test_depositBeaconEth_succeeds() (gas: 638274)
OmniAVS_syncWithOmni_Test:test_unsupportedStrategyDeposit_succeeds() (gas: 1677678)
2 changes: 1 addition & 1 deletion contracts/core/.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Admin_Test:test_pause_unpause_bridge() (gas: 25710460)
Admin_Test:test_pause_unpause_xcall() (gas: 30634703)
Admin_Test:test_pause_unpause_xsubmit() (gas: 30634454)
Admin_Test:test_upgrade() (gas: 34715948)
AllocPredeploys_Test:test_num_allocs() (gas: 1181364529)
AllocPredeploys_Test:test_num_allocs() (gas: 1181319043)
AllocPredeploys_Test:test_predeploys() (gas: 1181300853)
AllocPredeploys_Test:test_preinstalls() (gas: 1182017269)
AllocPredeploys_Test:test_proxies() (gas: 1408944070)
Expand Down
11 changes: 6 additions & 5 deletions lib/contracts/feeoraclev2/feeparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ func destFeeParams(ctx context.Context, srcChain evmchain.Metadata, destChain ev

return bindings.IFeeOracleV2FeeParams{
ChainId: destChain.ChainID,
ExecGasPrice: withGasPriceShield(float64(execGasPrice.Uint64())),
DataGasPrice: withGasPriceShield(float64(dataGasPrice.Uint64())),
ExecGasPrice: withGasPriceOffset(execGasPrice.Uint64()),
DataGasPrice: withGasPriceOffset(dataGasPrice.Uint64()),
ToNativeRate: rateToNumerator(toNativeRate),
}, nil
}
Expand Down Expand Up @@ -126,7 +126,8 @@ func rateToNumerator(r float64) uint64 {
return norm
}

// withGasPriceShield returns the gas price with an added xfeemngr.GasPriceShield pct offset.
func withGasPriceShield(gasPrice float64) uint64 {
return uint64(gasPrice + (xfeemngr.GasPriceShield * gasPrice))
// withGasPriceOffset returns the gas price with an added xfeemngr.GasPriceShield pct offset.
func withGasPriceOffset(gasPrice uint64) uint64 {
gasPriceF := float64(gasPrice)
return uint64(gasPriceF + (xfeemngr.GasPriceBufferOffset * gasPriceF))
}

0 comments on commit 82638db

Please sign in to comment.