Skip to content

Commit

Permalink
Merge pull request #341 from ava-labs/priority-fee-estimation
Browse files Browse the repository at this point in the history
Decrease max suggested tip
  • Loading branch information
aaronbuchwald authored Aug 16, 2021
2 parents 791a57e + 64e8199 commit e27f988
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
ARG AVALANCHE_VERSION

# ============= Compilation Stage ================
FROM golang:1.15.5-alpine AS builder
RUN apk add --no-cache bash git make gcc musl-dev linux-headers git ca-certificates g++
FROM golang:1.15.5-buster AS builder
RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64=4.19+105+deb10u12

WORKDIR /build
# Copy and download avalanche dependencies using go mod
Expand Down
7 changes: 4 additions & 3 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ import (

// DefaultFullGPOConfig contains default gasprice oracle settings for full node.
var DefaultFullGPOConfig = gasprice.Config{
Blocks: 20,
Percentile: 60,
MaxPrice: gasprice.DefaultMaxPrice,
Blocks: 20,
Percentile: 60,
MaxPrice: gasprice.DefaultMaxPrice,
IgnorePrice: gasprice.DefaultIgnorePrice,
}

// DefaultConfig contains default settings for use on the Avalanche main net.
Expand Down
4 changes: 2 additions & 2 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
const sampleNumber = 3 // Number of transactions sampled in a block

var (
DefaultMaxPrice = big.NewInt(500 * params.GWei)
DefaultMaxPrice = big.NewInt(10 * params.GWei)
DefaultIgnorePrice = big.NewInt(2 * params.Wei)
)

Expand Down Expand Up @@ -110,7 +110,7 @@ func NewOracle(backend OracleBackend, config Config) *Oracle {
}
return &Oracle{
backend: backend,
lastPrice: big.NewInt(0),
lastPrice: new(big.Int).Set(maxPrice),
maxPrice: maxPrice,
ignorePrice: ignorePrice,
checkBlocks: blocks,
Expand Down
8 changes: 4 additions & 4 deletions eth/gasprice/gasprice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ func TestSuggestTipCap(t *testing.T) {
expect *big.Int // Expected gasprice suggestion
}{
{nil, big.NewInt(params.GWei * int64(225))},
{big.NewInt(0), big.NewInt(params.GWei * int64(30))}, // Fork point in genesis
{big.NewInt(1), big.NewInt(params.GWei * int64(30))}, // Fork point in first block
{big.NewInt(32), big.NewInt(params.GWei * int64(453))}, // Fork point in last block
{big.NewInt(33), big.NewInt(params.GWei * int64(454))}, // Fork point in the future
{big.NewInt(0), big.NewInt(params.GWei * int64(10))}, // Fork point in genesis
{big.NewInt(1), big.NewInt(params.GWei * int64(10))}, // Fork point in first block
{big.NewInt(32), big.NewInt(params.GWei * int64(10))}, // Fork point in last block
{big.NewInt(33), big.NewInt(params.GWei * int64(10))}, // Fork point in the future
}
for _, c := range cases {
backend := newTestBackend(t, c.fork)
Expand Down
4 changes: 2 additions & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1735,9 +1735,9 @@ func SubmitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c

if tx.To() == nil {
addr := crypto.CreateAddress(from, tx.Nonce())
log.Info("Submitted contract creation", "hash", tx.Hash().Hex(), "from", from, "nonce", tx.Nonce(), "contract", addr.Hex(), "value", tx.Value(), "type", tx.Type())
log.Info("Submitted contract creation", "hash", tx.Hash().Hex(), "from", from, "nonce", tx.Nonce(), "contract", addr.Hex(), "value", tx.Value(), "type", tx.Type(), "gasFeeCap", tx.GasFeeCap(), "gasTipCap", tx.GasTipCap(), "gasPrice", tx.GasPrice())
} else {
log.Info("Submitted transaction", "hash", tx.Hash().Hex(), "from", from, "nonce", tx.Nonce(), "recipient", tx.To(), "value", tx.Value(), "type", tx.Type())
log.Info("Submitted transaction", "hash", tx.Hash().Hex(), "from", from, "nonce", tx.Nonce(), "recipient", tx.To(), "value", tx.Value(), "type", tx.Type(), "gasFeeCap", tx.GasFeeCap(), "gasTipCap", tx.GasTipCap(), "gasPrice", tx.GasPrice())
}
return tx.Hash(), nil
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Set up the versions to be used
coreth_version=${CORETH_VERSION:-'v0.5.8'}
coreth_version=${CORETH_VERSION:-'v0.6.0'}
# Don't export them as they're used in the context of other calls
avalanche_version=${AVALANCHE_VERSION:-'v1.4.13-rc.0'}
avalanche_version=${AVALANCHE_VERSION:-'v1.5.0-fuji'}

0 comments on commit e27f988

Please sign in to comment.