This repository was archived by the owner on Aug 2, 2021. It is now read-only.
network: Patch crash on pre-capability state store load#1791
Merged
acud merged 1 commit intoethersphere:masterfrom Sep 23, 2019
Merged
network: Patch crash on pre-capability state store load#1791acud merged 1 commit intoethersphere:masterfrom
acud merged 1 commit intoethersphere:masterfrom
Conversation
acud
approved these changes
Sep 23, 2019
Contributor
acud
left a comment
There was a problem hiding this comment.
Approving to get rid of the panic with the prospect that the correct capability will be stored when the peer is connected to
Eknir
approved these changes
Sep 23, 2019
Contributor
Eknir
left a comment
There was a problem hiding this comment.
I can confirm that with this patch my node does not crash anymore. Thanks for the fix!
chadsr
added a commit
to chadsr/swarm
that referenced
this pull request
Sep 23, 2019
* 'master' of github.com:ethersphere/swarm: (32 commits) network/stream: refactor cursors tests (ethersphere#1786) network: Add capabilities if peer from store does not have it (ethersphere#1791) Swap logger (ethersphere#1754) network: Add capability filtered depth calculation (ethersphere#1787) travis: remove go1.12 job (ethersphere#1784) cmd/swarm: correct bzznetworkid flag description (ethersphere#1761) network, pss: Capability in pss (ethersphere#1764) network/stream: handle nil peer in TestNodesExchangeCorrectBinIndexes (ethersphere#1779) protocols, retrieval: swap-enabled messages implement Price (ethersphere#1771) cmd/swarm-smoke: fix waitToPushSynced connection closing (ethersphere#1781) cmd/swarm: simplify testCluster.StartNewNodes (ethersphere#1777) build: increase golangci-lint deadline (ethersphere#1778) docker: ignore build/bin when copying files (ethersphere#1780) swap: fix and rename Peer.getLastSentCumulativePayout (ethersphere#1769) network/stream: more resilient TestNodesCorrectBinsDynamic (ethersphere#1776) network: Add Capabilities to Kademlia database (ethersphere#1713) network: add own address to KademliaInfo (ethersphere#1775) pss: Refactor. Step 2. Refactor forward cache (ethersphere#1742) all: configurable payment/disconnect thresholds (ethersphere#1729) network/stream/v2: more resilient TestNodesExchangeCorrectBinIndexes (ethersphere#1760) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Peer stores saved before Capabilities feature was added do not contain Capabilities member in the serialized BzzAddr. The automatic deserialization in the state store used when loading peers leaves the Capabilities field to nil, which crashes the node on startup.
This patch merely sets the a missing Capabiliity field to the (temporary)
fullCapabilityvalue.Since a hardening of the peer loading routine is planned as part of the kademlia roadmap, a proper evaluation of serialization formats used by the state store will be deferred to the same task.
Since this bug was not caught with any unit or integration tests, a test should be added to audit data integrity in data structures created from the store.