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

feat: Show elapsed epoch and PSD wait epochs in UI #1480

Merged
merged 4 commits into from
May 31, 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
1 change: 1 addition & 0 deletions docker/devnet/boost/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if [ ! -f $BOOST_PATH/.init.boost ]; then

echo Setting port in boost config...
sed -i 's|ip4/0.0.0.0/tcp/0|ip4/0.0.0.0/tcp/50000|g' $BOOST_PATH/config.toml
sed -i 's|127.0.0.1|0.0.0.0|g' $BOOST_PATH/config.toml

echo Done
touch $BOOST_PATH/.init.boost
Expand Down
2 changes: 1 addition & 1 deletion docker/devnet/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ services:
environment:
HTTP_BIND: "${HTTP_BIND:-127.0.0.1}"
HTTP_PORT: "${HTTP_PORT:-4080}"
network_mode: host
network_mode: host
10 changes: 7 additions & 3 deletions gql/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"math"
"time"

"github.com/dustin/go-humanize"
"github.com/filecoin-project/boost-gfm/piecestore"
Expand All @@ -26,6 +27,7 @@ import (
"github.com/filecoin-project/boost/transport"
"github.com/filecoin-project/dagstore"
"github.com/filecoin-project/lotus/api/v1api"
"github.com/filecoin-project/lotus/build"
lotus_repo "github.com/filecoin-project/lotus/node/repo"
"github.com/google/uuid"
"github.com/graph-gophers/graphql-go"
Expand Down Expand Up @@ -527,14 +529,14 @@ func (dr *dealResolver) Retry() string {
}

func (dr *dealResolver) Message(ctx context.Context) string {
msg := dr.message(ctx, dr.ProviderDealState.Checkpoint)
msg := dr.message(ctx, dr.ProviderDealState.Checkpoint, dr.ProviderDealState.CheckpointAt)
if dr.ProviderDealState.Retry != types.DealRetryFatal && dr.ProviderDealState.Err != "" {
msg = "Paused at '" + msg + "': " + dr.ProviderDealState.Err
}
return msg
}

func (dr *dealResolver) message(ctx context.Context, checkpoint dealcheckpoints.Checkpoint) string {
func (dr *dealResolver) message(ctx context.Context, checkpoint dealcheckpoints.Checkpoint, checkpointAt time.Time) string {
switch checkpoint {
case dealcheckpoints.Accepted:
if dr.IsOffline {
Expand Down Expand Up @@ -570,7 +572,9 @@ func (dr *dealResolver) message(ctx context.Context, checkpoint dealcheckpoints.
case dealcheckpoints.Transferred:
return "Ready to Publish"
case dealcheckpoints.Published:
return "Awaiting Publish Confirmation"
elapsedEpochs := uint64(time.Since(checkpointAt).Seconds()) / build.BlockDelaySecs
confidenceEpochs := build.MessageConfidence * 2
return fmt.Sprintf("Awaiting Publish Confirmation (%d/%d epochs)", elapsedEpochs, confidenceEpochs)
case dealcheckpoints.PublishConfirmed:
return "Adding to Sector"
case dealcheckpoints.AddedPiece:
Expand Down