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

fix(blob): use default min gas price from core #2306

Merged
merged 2 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/types"
logging "github.com/ipfs/go-log/v2"

"github.com/celestiaorg/celestia-app/pkg/appconsts"
"github.com/celestiaorg/celestia-app/pkg/shares"
apptypes "github.com/celestiaorg/celestia-app/x/blob/types"
"github.com/celestiaorg/nmt/namespace"
Expand All @@ -25,10 +26,6 @@ var (
log = logging.Logger("blob")
)

// TODO(@vgonkivs): remove after bumping celestia-app
// defaultMinGasPrice is the default min gas price.
const defaultMinGasPrice = 0.001

type Service struct {
// accessor dials the given celestia-core endpoint to submit blobs.
accessor *state.CoreAccessor
Expand Down Expand Up @@ -58,7 +55,7 @@ func (s *Service) Submit(ctx context.Context, blobs []*Blob) (uint64, error) {

var (
gasLimit = estimateGas(blobs...)
fee = int64(defaultMinGasPrice * float64(gasLimit))
fee = int64(appconsts.DefaultMinGasPrice * float64(gasLimit))
b = make([]*apptypes.Blob, len(blobs))
)

Expand Down
3 changes: 2 additions & 1 deletion nodebuilder/tests/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"testing"
"time"

"github.com/celestiaorg/nmt/namespace"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/celestiaorg/nmt/namespace"

"github.com/celestiaorg/celestia-node/blob"
"github.com/celestiaorg/celestia-node/blob/blobtest"
"github.com/celestiaorg/celestia-node/nodebuilder/node"
Expand Down