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

feat: reduce gas fees when posting price #1220

Merged
merged 15 commits into from
Mar 16, 2023
Merged

Conversation

jgimeno
Copy link
Contributor

@jgimeno jgimeno commented Mar 8, 2023

Description

This makes that transactions that include a vote or prevote to provide oracle prices is cheaper. Also it enforces that these kind of transactions can only hold one message, so it does no include a message unrelated to provide price data.

  • It can contain only one message Vote or Prevote.
  • Or maximum 2 if it includes one vote and one prevote.

Purpose

This is important because right now posting a price is expensive and it does not scale well.

@jgimeno jgimeno changed the title fees for post price feat: reduce gas fees when posting price Mar 10, 2023
@jgimeno jgimeno marked this pull request as ready for review March 10, 2023 14:18
@jgimeno jgimeno requested a review from a team as a code owner March 10, 2023 14:18
@jgimeno jgimeno enabled auto-merge (squash) March 10, 2023 19:27
app/ante.go Outdated Show resolved Hide resolved
ctx = ctx.WithGasMeter(types.NewFixedGasMeter(OracleMessageGas))
} else if hasOraclePreVoteMsg || hasOracleVoteMsg {
if len(tx.GetMsgs()) > 1 {
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "a transaction that includes an oracle vote or prevote message cannot have more than a single message")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "a transaction that includes an oracle vote or prevote message cannot have more than a single message")
return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "a transaction that includes an oracle vote or prevote message cannot have more than those two messages")

app/antedecorators/fee/fixed_gas_test.go Outdated Show resolved Hide resolved
app/antedecorators/fee/fixed_gas.go Outdated Show resolved Hide resolved
app/ante.go Show resolved Hide resolved
app/antedecorators/fee/fixed_gas.go Outdated Show resolved Hide resolved
@jgimeno jgimeno merged commit 588bebe into master Mar 16, 2023
@jgimeno jgimeno deleted the feat/fee-fixed-price-post branch March 16, 2023 05:49
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.

None yet

3 participants