Update gas limits, update storage-fsm

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-07-15 21:21:53 +02:00
parent 7b14d445b4
commit 399c171f03
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
7 changed files with 22 additions and 19 deletions

View File

@ -91,7 +91,7 @@ const VerifSigCacheSize = 32000
// TODO: If this is gonna stay, it should move to specs-actors
const BlockMessageLimit = 512
const BlockGasLimit = 100_000_000_000
const BlockGasLimit = 7_500_000_000
var DrandConfig = dtypes.DrandConfig{
Servers: []string{

2
go.mod
View File

@ -32,7 +32,7 @@ require (
github.com/filecoin-project/sector-storage v0.0.0-20200712023225-1d67dcfa3c15
github.com/filecoin-project/specs-actors v0.7.2
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea
github.com/filecoin-project/storage-fsm v0.0.0-20200712045002-6e92d6a6f080
github.com/filecoin-project/storage-fsm v0.0.0-20200715191202-7e92e888bf41
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1
github.com/go-kit/kit v0.10.0
github.com/go-ole/go-ole v1.2.4 // indirect

6
go.sum
View File

@ -258,8 +258,6 @@ github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZO
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b h1:fkRZSPrYpk42PV3/lIXiL0LHetxde7vyYYvSsttQtfg=
github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8=
github.com/filecoin-project/sector-storage v0.0.0-20200615154852-728a47ab99d6/go.mod h1:M59QnAeA/oV+Z8oHFLoNpGMv0LZ8Rll+vHVXX7GirPM=
github.com/filecoin-project/sector-storage v0.0.0-20200625154333-98ef8e4ef246 h1:NfYQRmVRe0LzlNbK5Ket3vbBOwFD5TvtcNtfo/Sd8mg=
github.com/filecoin-project/sector-storage v0.0.0-20200625154333-98ef8e4ef246/go.mod h1:8f0hWDzzIi1hKs4IVKH9RnDsO4LEHVz8BNat0okDOuY=
github.com/filecoin-project/sector-storage v0.0.0-20200712023225-1d67dcfa3c15 h1:miw6hiusb/MkV1ryoqUKKWnvHhPW00AYtyeCj0L8pqo=
github.com/filecoin-project/sector-storage v0.0.0-20200712023225-1d67dcfa3c15/go.mod h1:salgVdX7qeXFo/xaiEQE29J4pPkjn71T0kt0n+VDBzo=
github.com/filecoin-project/specs-actors v0.0.0-20200210130641-2d1fbd8672cf/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA=
@ -274,8 +272,8 @@ github.com/filecoin-project/specs-storage v0.1.0 h1:PkDgTOT5W5Ao7752onjDl4QSv+sg
github.com/filecoin-project/specs-storage v0.1.0/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k=
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea h1:iixjULRQFPn7Q9KlIqfwLJnlAXO10bbkI+xy5GKGdLY=
github.com/filecoin-project/specs-storage v0.1.1-0.20200622113353-88a9704877ea/go.mod h1:Pr5ntAaxsh+sLG/LYiL4tKzvA83Vk5vLODYhfNwOg7k=
github.com/filecoin-project/storage-fsm v0.0.0-20200712045002-6e92d6a6f080 h1:WZonjI7/GFLi4NxziBCefS9x7bm8S405RWkmFuDfRLA=
github.com/filecoin-project/storage-fsm v0.0.0-20200712045002-6e92d6a6f080/go.mod h1:SXO4VnXG056B/lXHL8HZv54eMqlsyynm+v93BlLwlOY=
github.com/filecoin-project/storage-fsm v0.0.0-20200715191202-7e92e888bf41 h1:K2DI5+IKuY0cOjX/r1Agy6rYcAhU89LVNOjutCUib4g=
github.com/filecoin-project/storage-fsm v0.0.0-20200715191202-7e92e888bf41/go.mod h1:TDNjb0HYG2fppxWH5EsiNCZu97iJZNuPYmivSK13Ao0=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6 h1:u/UEqS66A5ckRmS4yNpjmVH56sVtS/RfclBAYocb4as=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=

View File

@ -138,7 +138,7 @@ func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address,
From: addr,
Value: amount,
GasPrice: types.NewInt(0),
GasLimit: 100_000_000,
GasLimit: 200_000_000,
Method: builtin.MethodsMarket.AddBalance,
})
if err != nil {

View File

@ -78,7 +78,7 @@ func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemark
From: mi.Worker,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: 100_000_000,
GasLimit: 600_000_000,
Method: builtin.MethodsMarket.PublishStorageDeals,
Params: params,
})
@ -175,7 +175,7 @@ func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address
From: addr,
Value: amount,
GasPrice: types.NewInt(0),
GasLimit: 100_000_000,
GasLimit: 200_000_000,
Method: builtin.MethodsMarket.AddBalance,
})
if err != nil {

View File

@ -7,6 +7,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/types"
"github.com/stretchr/testify/assert"
)
func mustIDAddr(i uint64) address.Address {
@ -26,11 +27,11 @@ func TestMessageFiltering(t *testing.T) {
actors := map[address.Address]*types.Actor{
a1: {
Nonce: 3,
Balance: types.NewInt(1200),
Balance: types.FromFil(1200),
},
a2: {
Nonce: 1,
Balance: types.NewInt(1000),
Balance: types.FromFil(1000),
},
}
@ -43,7 +44,7 @@ func TestMessageFiltering(t *testing.T) {
From: a1,
To: a1,
Nonce: 3,
Value: types.NewInt(500),
Value: types.FromFil(500),
GasLimit: 100_000_000,
GasPrice: types.NewInt(1),
},
@ -51,7 +52,7 @@ func TestMessageFiltering(t *testing.T) {
From: a1,
To: a1,
Nonce: 4,
Value: types.NewInt(500),
Value: types.FromFil(500),
GasLimit: 100_000_000,
GasPrice: types.NewInt(1),
},
@ -59,7 +60,7 @@ func TestMessageFiltering(t *testing.T) {
From: a2,
To: a1,
Nonce: 1,
Value: types.NewInt(800),
Value: types.FromFil(800),
GasLimit: 100_000_000,
GasPrice: types.NewInt(1),
},
@ -67,7 +68,7 @@ func TestMessageFiltering(t *testing.T) {
From: a2,
To: a1,
Nonce: 0,
Value: types.NewInt(800),
Value: types.FromFil(800),
GasLimit: 100_000_000,
GasPrice: types.NewInt(1),
},
@ -75,7 +76,7 @@ func TestMessageFiltering(t *testing.T) {
From: a2,
To: a1,
Nonce: 2,
Value: types.NewInt(150),
Value: types.FromFil(150),
GasLimit: 100,
GasPrice: types.NewInt(1),
},
@ -86,9 +87,7 @@ func TestMessageFiltering(t *testing.T) {
t.Fatal(err)
}
if len(outmsgs) != 3 {
t.Fatal("filtering didnt work as expected")
}
assert.Len(t, outmsgs, 3, "filtering didnt work as expected")
was, expected := outmsgs[0].Message, msgs[2]
if was.From != expected.From || was.Nonce != expected.Nonce {

View File

@ -90,6 +90,12 @@ func (a *MpoolAPI) MpoolPushMessage(ctx context.Context, msg *types.Message) (*t
if msg.Nonce != 0 {
return nil, xerrors.Errorf("MpoolPushMessage expects message nonce to be 0, was %d", msg.Nonce)
}
if msg.GasLimit == 0 {
msg.GasLimit = 100_000_000 // TODO: gas limit estimation
}
if types.BigCmp(msg.GasPrice, types.NewInt(0)) == 0 {
msg.GasPrice = types.NewInt(1) // TODO: gas price estimation
}
return a.Mpool.PushWithNonce(ctx, msg.From, func(from address.Address, nonce uint64) (*types.SignedMessage, error) {
msg.Nonce = nonce