Skip to content
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

improve(Relayer): Add total gas price to info log when relayer sends fill #1949

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nicholaspai
Copy link
Member

This will help debugging and give us broad oversight into how accurate our gas price estimates are. We probably should refactor the overall relay fee calculation flow but this PR uses the data we already have (native and token gas costs) to derive the gas price easily.

This PR also adds to the ProfitClient's updateGasCosts function a simple change to print out the gas price estimate per chain.

A more helpful fix might be to add the gasPrice field to the TransactionCostEstimate type in the SDK and force functions like sdk.common.estimateTotalGasRequiredByUnsignedTransaction() to return the priority fee and base fee broken down so the relayer can log it

…s fill

This will help debugging and give us broad oversight into how accurate our gas price estimates are. We probably should refactor the overall relay fee calculation flow but this PR uses the data we already have (native and token gas costs) to derive the gas price easily.

This PR also adds to the ProfitClient's `updateGasCosts` function a simple change to print out the gas price estimate per chain.

A more helpful fix might be to add the `gasPrice` field to the `TransactionCostEstimate` type in the SDK and force functions like `sdk.common.estimateTotalGasRequiredByUnsignedTransaction()` to return the priority fee and base fee broken down so the relayer can log it
this.totalGasCosts[destinationChainId] = await this._getTotalGasCost(deposit, relayer);
const { nativeGasCost, tokenGasCost } = await this._getTotalGasCost(deposit, relayer);
const gasPrice = tokenGasCost.div(nativeGasCost);
this.totalGasCosts[destinationChainId] = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds the gas price estimate early in the relayer run to the ProfitClient's update function log

@nicholaspai nicholaspai marked this pull request as draft December 16, 2024 14:49
@nicholaspai nicholaspai marked this pull request as ready for review December 16, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant