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

libp2p blocking fails at syncing #4833

Open
nugaon opened this issue Sep 20, 2024 · 1 comment · May be fixed by #4871
Open

libp2p blocking fails at syncing #4833

nugaon opened this issue Sep 20, 2024 · 1 comment · May be fixed by #4871
Assignees
Labels
needs-triaging new issues that need triaging

Comments

@nugaon
Copy link
Member

nugaon commented Sep 20, 2024

⚠️ Support requests in an issue-format will be closed immediately. For support, go to Swarm's Discord.

Context

I'm testing out GSOC functionality which uses fdp-play for environment (5 nodes network).

Related logs

"time"="2024-09-20 14:29:32.265097" "level"="debug" "logger"="node/libp2p" "msg"="blocklist: could not blocklist peer" "peer_id"="Qmexzx5TQexfw1zeNsr3zPX8wPEqTfAVSAzxZN29urfEdD" "error"="cannot blocklist peer when network not available"
"time"="2024-09-20 14:29:32.265113" "level"="error" "logger"="node/libp2p" "msg"="unable to blocklist peer" "peer_id"="Qmexzx5TQexfw1zeNsr3zPX8wPEqTfAVSAzxZN29urfEdD"
"time"="2024-09-20 14:29:32.265122" "level"="debug" "logger"="node/libp2p" "msg"="handle protocol failed" "protocol"="pushsync" "version"="1.3.0" "stream"="pushsync" "peer"="
676790fcae312292ffc17b7f7c84d5b9acc51ef0ea3f27d0ff3bada3362abc5d" "error"="unexpected request while in light mode"
"time"="2024-09-20 14:29:32.265239" "level"="debug" "logger"="node/libp2p" "msg"="blocklist: could not blocklist peer" "peer_id"="QmdRzETjLwPReW134dbG9hfCure8RELWTESyfQpeG3iCm7" "error"="cannot blocklist peer when network not available"

also at pull sync

"time"="2024-09-20 14:54:48.866819" "level"="debug" "logger"="node/libp2p" "msg"="blocklist: could not blocklist peer" "peer_id"="QmdRzETjLwPReW134dbG9hfCure8RELWTESyfQpeG3iCm7" "error"="cannot blocklist peer when network not available"
"time"="2024-09-20 14:54:48.866854" "level"="error" "logger"="node/libp2p" "msg"="unable to blocklist peer" "peer_id"="QmdRzETjLwPReW134dbG9hfCure8RELWTESyfQpeG3iCm7"
"time"="2024-09-20 14:54:48.866876" "level"="debug" "logger"="node/libp2p" "msg"="handle protocol failed" "protocol"="pullsync" "version"="1.4.0" "stream"="cursors" "peer"="48013b5c5142e482759f08ef60057b4bbb7cb2e77790b44e3f06b235493347d4" "error"="unexpected request while in light mode"

Summary

Even though swarm-cli status gives back Mode: full - as expected based on the Bee configuration as well -, libp2p assumes it as a light node.

It tries to blocklist peers but it cannot and refers to some network availability issue.

Eventually, the chunks push seems successful since the API request returns with 201.

Expected behavior

Bee does blocklist when it wants to.

Actual behavior

It fails blocklisting.

Steps to reproduce

Run FDP Play and push chunks.

Possible solution

@nugaon nugaon added the needs-triaging new issues that need triaging label Sep 20, 2024
@acha-bill acha-bill linked a pull request Oct 21, 2024 that will close this issue
4 tasks
@acha-bill
Copy link
Contributor

The linked PR fixes the blocklist issue but the "unexpected request while in light mode" error is expected.

The queen node is bootnode mode.
bee printconfig from the docker container returns

# cause the node to always accept incoming connections
bootnode-mode: "true"

When in bootnode mode (or light mode), bee will replace the p2p stream handlers with an always erroring handler. (error above)

bee/pkg/node/node.go

Lines 974 to 984 in 0e42d83

if o.FullNodeMode && !o.BootnodeMode {
logger.Info("starting in full mode")
} else {
if chainEnabled {
logger.Info("starting in light mode")
} else {
logger.Info("starting in ultra-light mode")
}
p2p.WithBlocklistStreams(p2p.DefaultBlocklistTime, retrieveProtocolSpec)
p2p.WithBlocklistStreams(p2p.DefaultBlocklistTime, pushSyncProtocolSpec)
p2p.WithBlocklistStreams(p2p.DefaultBlocklistTime, pullSyncProtocolSpec)

You can also see this from the logs

"level"="info" "logger"="node" "msg"="starting in light mode"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triaging new issues that need triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants