mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 22:26:47 +00:00
Increase p2p msg size and reset utxo after ibd (#1847)
* Don't build unnecessary binaries * Reset UTXO index after IBD * Enlarge max msg size to 1gb * Fix UTXO chunks logic * Revert UTXO set override change * Fix sendPruningPointUTXOSet * Increase tests timeout to 20 minutes Co-authored-by: Kaspa Profiler <>
This commit is contained in:
parent
cd8341ef57
commit
9b81f5145e
8
.github/workflows/deploy.yaml
vendored
8
.github/workflows/deploy.yaml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: Build and upload assets
|
name: Build and upload assets
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [ published ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
# `-tags netgo,osusergo` means use pure go replacements for "os/user" and "net"
|
# `-tags netgo,osusergo` means use pure go replacements for "os/user" and "net"
|
||||||
# `-s -w` strips the binary to produce smaller size binaries
|
# `-s -w` strips the binary to produce smaller size binaries
|
||||||
run: |
|
run: |
|
||||||
go build -v -ldflags="-s -w -extldflags=-static" -tags netgo,osusergo -o ./bin/ ./...
|
go build -v -ldflags="-s -w -extldflags=-static" -tags netgo,osusergo -o ./bin/ . ./cmd/...
|
||||||
archive="bin/kaspad-${{ github.event.release.tag_name }}-linux.zip"
|
archive="bin/kaspad-${{ github.event.release.tag_name }}-linux.zip"
|
||||||
asset_name="kaspad-${{ github.event.release.tag_name }}-linux.zip"
|
asset_name="kaspad-${{ github.event.release.tag_name }}-linux.zip"
|
||||||
zip -r "${archive}" ./bin/*
|
zip -r "${archive}" ./bin/*
|
||||||
@ -47,7 +47,7 @@ jobs:
|
|||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
go build -v -ldflags="-s -w" -o bin/ ./...
|
go build -v -ldflags="-s -w" -o bin/ . ./cmd/...
|
||||||
archive="bin/kaspad-${{ github.event.release.tag_name }}-win64.zip"
|
archive="bin/kaspad-${{ github.event.release.tag_name }}-win64.zip"
|
||||||
asset_name="kaspad-${{ github.event.release.tag_name }}-win64.zip"
|
asset_name="kaspad-${{ github.event.release.tag_name }}-win64.zip"
|
||||||
powershell "Compress-Archive bin/* \"${archive}\""
|
powershell "Compress-Archive bin/* \"${archive}\""
|
||||||
@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Build on MacOS
|
- name: Build on MacOS
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: |
|
run: |
|
||||||
go build -v -ldflags="-s -w" -o ./bin/ ./...
|
go build -v -ldflags="-s -w" -o ./bin/ . ./cmd/...
|
||||||
archive="bin/kaspad-${{ github.event.release.tag_name }}-osx.zip"
|
archive="bin/kaspad-${{ github.event.release.tag_name }}-osx.zip"
|
||||||
asset_name="kaspad-${{ github.event.release.tag_name }}-osx.zip"
|
asset_name="kaspad-${{ github.event.release.tag_name }}-osx.zip"
|
||||||
zip -r "${archive}" ./bin/*
|
zip -r "${archive}" ./bin/*
|
||||||
|
@ -102,14 +102,17 @@ func (flow *handleRequestPruningPointUTXOSetFlow) sendPruningPointUTXOSet(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(pruningPointUTXOs) < step && chunksSent%ibdBatchSize == 0 {
|
finished := len(pruningPointUTXOs) < step
|
||||||
|
if finished && chunksSent%ibdBatchSize != 0 {
|
||||||
log.Debugf("Finished sending UTXOs for pruning block %s",
|
log.Debugf("Finished sending UTXOs for pruning block %s",
|
||||||
msgRequestPruningPointUTXOSet.PruningPointHash)
|
msgRequestPruningPointUTXOSet.PruningPointHash)
|
||||||
|
|
||||||
return flow.outgoingRoute.Enqueue(appmessage.NewMsgDonePruningPointUTXOSetChunks())
|
return flow.outgoingRoute.Enqueue(appmessage.NewMsgDonePruningPointUTXOSetChunks())
|
||||||
}
|
}
|
||||||
|
|
||||||
fromOutpoint = pruningPointUTXOs[len(pruningPointUTXOs)-1].Outpoint
|
if len(pruningPointUTXOs) > 0 {
|
||||||
|
fromOutpoint = pruningPointUTXOs[len(pruningPointUTXOs)-1].Outpoint
|
||||||
|
}
|
||||||
chunksSent++
|
chunksSent++
|
||||||
|
|
||||||
// Wait for the peer to request more chunks every `ibdBatchSize` chunks
|
// Wait for the peer to request more chunks every `ibdBatchSize` chunks
|
||||||
@ -123,6 +126,13 @@ func (flow *handleRequestPruningPointUTXOSetFlow) sendPruningPointUTXOSet(
|
|||||||
return protocolerrors.Errorf(true, "received unexpected message type. "+
|
return protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||||
"expected: %s, got: %s", appmessage.CmdRequestNextPruningPointUTXOSetChunk, message.Command())
|
"expected: %s, got: %s", appmessage.CmdRequestNextPruningPointUTXOSetChunk, message.Command())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if finished {
|
||||||
|
log.Debugf("Finished sending UTXOs for pruning block %s",
|
||||||
|
msgRequestPruningPointUTXOSet.PruningPointHash)
|
||||||
|
|
||||||
|
return flow.outgoingRoute.Enqueue(appmessage.NewMsgDonePruningPointUTXOSetChunks())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ go build $FLAGS -o kaspad .
|
|||||||
|
|
||||||
if [ -n "${NO_PARALLEL}" ]
|
if [ -n "${NO_PARALLEL}" ]
|
||||||
then
|
then
|
||||||
go test -parallel=1 $FLAGS ./...
|
go test -timeout 20m -parallel=1 $FLAGS ./...
|
||||||
else
|
else
|
||||||
go test $FLAGS ./...
|
go test -timeout 20m $FLAGS ./...
|
||||||
fi
|
fi
|
@ -18,7 +18,7 @@ type p2pServer struct {
|
|||||||
gRPCServer
|
gRPCServer
|
||||||
}
|
}
|
||||||
|
|
||||||
const p2pMaxMessageSize = 100 * 1024 * 1024 // 100MB
|
const p2pMaxMessageSize = 1024 * 1024 * 1024 // 1GB
|
||||||
|
|
||||||
// p2pMaxInboundConnections is the max amount of inbound connections for the P2P server.
|
// p2pMaxInboundConnections is the max amount of inbound connections for the P2P server.
|
||||||
// Note that inbound connections are not limited by the gRPC server. (A value of 0 means
|
// Note that inbound connections are not limited by the gRPC server. (A value of 0 means
|
||||||
|
Loading…
x
Reference in New Issue
Block a user