Skip to content

Commit

Permalink
Merge pull request #1100 from TRON-US/performance-optimizations
Browse files Browse the repository at this point in the history
adjust some parameters
  • Loading branch information
olenheim authored Aug 18, 2021
2 parents 208e586 + 8593948 commit 7c9305a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 242 deletions.
2 changes: 1 addition & 1 deletion cmd/btfs/send_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

// function to send error message to status server
func TestSendError(t *testing.T) {
err := SendError("Send Error", "http://db.btfs.io", "my peer id", "my HValue")
err := SendError("Send Error", "https://status.btfs.io", "my peer id", "my HValue")
if err != nil {
t.Errorf("Send error message to status server failed, reason: %v", err)
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type BootstrapConfig struct {

// DefaultBootstrapConfig specifies default sane parameters for bootstrapping.
var DefaultBootstrapConfig = BootstrapConfig{
MinPeerThreshold: 4,
MinPeerThreshold: 10,
Period: 30 * time.Second,
ConnectionTimeout: (30 * time.Second) / 3, // Perod / 3
}
Expand Down
4 changes: 2 additions & 2 deletions core/commands/storage/upload/upload/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ func challengeShard(ctxParams *uh.ContextParams, fileHash string, isRepair bool,
in.Signature = sign
// Need to renew another 6 mins due to downloading shard could have already made
// req.Context obsolete
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
var question *guardpb.RequestChallengeQuestion
err = grpc.GuardClient(ctxParams.Cfg.Services.GuardDomain).WithContext(ctx,
func(ctx context.Context, client guardpb.GuardServiceClient) error {
for i := 0; i < 3; i++ {
for i := 0; i < 20; i++ {
question, err = client.RequestChallenge(ctx, in)
if err == nil {
break
Expand Down
2 changes: 1 addition & 1 deletion core/hub/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestGetSettings(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defNs := &nodepb.Node_Settings{StoragePriceAsk: 250000, StorageTimeMin: 30, StoragePriceDefault: 250000}
defNs := &nodepb.Node_Settings{StoragePriceAsk: 125000, StorageTimeMin: 30, StoragePriceDefault: 125000}
if !reflect.DeepEqual(ns, defNs) {
t.Fatal("default settings not equal")
}
Expand Down
3 changes: 2 additions & 1 deletion core/wallet/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ func ConfirmDepositProcess(ctx context.Context, n *core.IpfsNode, prepareRespons
log.Debug(fmt.Sprintf("[Id:%d] ConfirmDepositProcess begin.", prepareResponse.GetId()))

// Continuous call ConfirmDeposit until it responses a FAILED or SUCCESS.
for time.Now().UnixNano()/1e6 < (prepareResponse.GetTronTransaction().GetRawData().GetExpiration() + 480*1000) {
now := time.Now().UnixNano() / 1e6
for time.Now().UnixNano()/1e6 < (now + 7*86400*1000) {
time.Sleep(5 * time.Second)

// ConfirmDeposit after 1min, because watcher need wait for 1min to confirm tron transaction.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/TRON-US/go-btfs-api v0.3.0
github.com/TRON-US/go-btfs-chunker v0.3.0
github.com/TRON-US/go-btfs-cmds v0.2.13
github.com/TRON-US/go-btfs-config v0.7.0
github.com/TRON-US/go-btfs-config v0.11.1
github.com/TRON-US/go-btfs-files v0.2.0
github.com/TRON-US/go-btfs-pinner v0.1.1
github.com/TRON-US/go-btns v0.1.1
Expand Down Expand Up @@ -72,7 +72,7 @@ require (
github.com/libp2p/go-libp2p v0.11.0
github.com/libp2p/go-libp2p-circuit v0.3.1
github.com/libp2p/go-libp2p-connmgr v0.2.4
github.com/libp2p/go-libp2p-core v0.6.1
github.com/libp2p/go-libp2p-core v0.9.0
github.com/libp2p/go-libp2p-crypto v0.1.0
github.com/libp2p/go-libp2p-discovery v0.5.0
github.com/libp2p/go-libp2p-http v0.1.5
Expand Down
235 changes: 2 additions & 233 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package btfs
var CurrentCommit string

// CurrentVersionNumber is the current application's version literal
const CurrentVersionNumber = "1.5.1"
const CurrentVersionNumber = "1.5.2"

const ApiVersion = "/go-btfs/" + CurrentVersionNumber + "/"

Expand Down

0 comments on commit 7c9305a

Please sign in to comment.