Skip to main content

43 posts tagged with "network"

View All Tags

· 3 min read
Marcin Szamotulski

High-level overview of sprint 42

Eclipse Evasion

We merged and released a new version of the ouroboros-network package (version 0.9.0.0) which includes big ledger peers feature. This is the primary peer selection mechanism to defend against eclipses. We also prepared a PR to updated ouroboros-cosnensus and ekg-forward packages.

CDDL specs for protocol codecs

We made the cddl spec for network codec more inline with the implementation which is highly polymorphic. cddl doesn't have the notion of polymorphism, but has any which can generate any valid cbor term. We matched it with an Any type on the Haskell side and made all remaining tests & specs use it. This simplified the specifications and made it easier to understand which parts are defined in the spec, and which parts are left unspecified. See ouroboros-network#4595.

Ouroboros-Network-Framework API changes

We also released ouroboros-network-framework and other network components. The ouroboros-network-framework package contains a redesign of API exposed to ouroboros-consensus. We consolidated, cleaned it and made it easier to extend in the future if there will be new arguments that need to be passed to mini-protocol initiator and responders which comes from the low-level network layer.

Nix setup (CI)

We also made a major review of our nix setup. With help from our DevX team we ended up with a clean flake.nix file which can:

  • compile & test the code on x86_64-linux, x86_64-darwin and aarch64-darwin
  • cross-compile to Windows on x86_64-linux

And provides a shell which contains all the build tools, including ghc-9.6, hls, cddl, and more. See ouroboros-network#4640, ouroboros-network#4643.

Other contributions

Cardano Network Service Assurance

  • The work and writeup in finishing up the CNSA, first stage (first contract).
  • Getting Sam Cowger (Galois Inc) up to speed.
  • The IOG Networking team carried a reivew of CNSA project progress: a limitted code & design review.

Galois Review

Sam Cowger and Mark Tullsen (Galois Inc) have made some progress on each of the tech debt issues

scoping, requirements, and getting started.

CI

We added a nightly run for GitHub actions and made the GitHub actions test be executed with extra concurrency ouroboros-network#4637, ouroboros-network#4649.

We also added GitHub's dependabot ouroboros-network#4650.

Bootstrap Peers

We settled on implementation design of bootstrap peers which is being implemented, ouroboros-network#4615.

· 2 min read
Marcin Szamotulski

High-level overview of sprint 41

24th July - 6th August 2023

We started the implementation of bootstrap peers. Bootstrap peers are designed to provide a safety guarantee for nodes joining the network while still taking advantage of the distributed network for nodes that are synced. This will be an intermediate step before Genesis which will allow for further distribute the system. The bootstrap peers will be run by some trusted partners like CF, Emurgo or IOG. They are primarily designed for leaf nodes (e.g. full node wallets), which often end up syncing and require access to the honest chain. See ouroboros-network#4615 for a more detailed implementation plan.

Other contributions

We started to use nothunks library to discover if we have any unevaluated thunks which can lead to memory leaks ouroboros-network#4633. We found a small one in the peer metric component of the P2P networking stack. Fixing it put us on a small detour of fixing the API of the strict-checked-vars package: cardano-base#431, cardano-base#432, as well as adding NFData instance to io-classes. We also improved nothunks library to make debugging easier and we provided a NoThunks instance for ThreadId which we will need in the future (see nothunks#33).

We released a new version of io-classes (version 1.2.0.0) and related packages to Hackage.

We addressed all review comments on the eclipse evasion PR which introduces big ledger peers, ouroboros-network#3886.

We fixed how SIGHUP signal handlers are registered, so it's not possible to shutdown a node which was starting while trying to update network topology, see cardano-node#5421.

I didn't mention that in the previous update, so here it goes: in the previous sprint we released ouroboros-network-0.8.2.0 and ouroboros-network-framework-0.7.0.0.

· 3 min read
Marcin Szamotulski

Network Update (Sprints 39 & 40)

The network updates got distracted. Mostly because of me leaving for the meeting in Edinburgh, Scotland and the being away. It was great to see and talk to so many of the community members.

Sprint 39 (Jun 26 - Jul 09)

Major changes

Now the following list of traces will be turned on by default:

node-to-client protocol
  • LocalConnectionManagerTracer
  • LocalInboundGovernor
  • LocalHandshake
  • LocalServer
node-to-node protocol
  • Server

See cardano-node#5353. This will be released in node-8.2.0.

We made sure that cardano-client-0.1.0.x library (which is db-sync) is not using the experimental node-to-client protocol. The cardano-client-0.2.0.0 was not affected. See ouroboros-network#4612.

We merged the dynamic block production feature to ouroboros-consensus (also available in the cardano-node-8.2.0 release). Dynamic block production enables hot-swap p2p nodes, which are important for the p2p deployment of block-producing nodes. See ouroboros-network#3159, [ouroboros-consensu#140].

We continued to review the implementation of big ledger peers for eclipse evasion, see ouroboros-network#4462.

Minor changes

Sprint 40 (Jul 09 - Jul 23)

Major changes

We integrated ouroboros-network-0.8.2.0 with the master branch of cardano-node for the 8.2.0 release (the version match between ouroboros-network and cardano-node is purely accidental). This includes:

  • integration with dynamic block production feature. This feature is documented in the following PR.
  • Warm valency for local root peers (see below).

For the full list of features included in the 8.2.0 release from the network side, please take a look at the pre-release nodes.

We improved the memory footprint of peer metrics measured by the P2P stack. Peer metrics are used to decide which peers to demote every churn interval (roughly every hour with some probabilistic fluctuation). See ouroboros-network#4620. The improvement will be available in cardano-node-8.2.0.

We added an optional explicit warm valency to local root peers of the P2P topology file. Previously we used an implicit valency, e.g. the node keeps connections to all of the local roots; with local warm valency the node will pick only that many peers from the local root peers group to connect to. The hot valency (previously known simply as valency) hasn't changed, but it must be smaller than the warm valency as hot peers are selected from warm ones. Warm valency is a useful feature to limit resource consumption if one of the domain names in the local root peer group resolves to many IP addresses. See ouroboros-network#4575, cardano-node#5409.

· 2 min read
Marcin Szamotulski

Network Update

Key contributions

We held a series of session to review the implementation of big ledger peers (eclipse evasion). See #4462.

We get a request from a 3rd party to clarify an inconsistency between CDDL spec and protocol implementation. We worked out a nice solution which takes advantage of the any notion available in CDDL. On the Haskell side we provide Any type which gen generate almost any CBOR term (some are excluded only because they are not decoded back to the same form, and we relay on that property). See #4580.

We fixed a bunch of problems of the cardano-cli ping command. It also now has a limited support of node-to-client mini-protocol (the -c option is ignored, as it cannot be supported by node-to-client protocol). Note that the format of messages has changed, timestamps are printed in ISO8601 format. See #4601, #5326, #5313, #30

In order to provide a new flag in the topology file which enables ledger peers when the chain is close to the tip, we continued to work on #4530. This is currently in review, the consensus team will need to provide us with the new api. This feature is useful for two reasons: makes it easier to maintain a topology file, it will also limit the traffic on public roots generated by for example full node wallets and distribute it to ledger peers.

We also continued to work on a blog post which describes the journey of design & implementation of the dynamic P2P network layer. Too be announced soon :).

Other smaller changes

We limit the concurrency of resolving dns names. Up to 8 root peers or ledger peers DNS names are resolved concurrently, and at most 2 local root peer DNS names. See #4596.

We fixed handshake query timeout in #4603.

We renamed one of the block-fetch decision constructors as requested by the consensus team, see #4608.

· 3 min read
Marcin Szamotulski

Network Update

Key contributions and advances

We merged light peer sharing feature, which allows to include inbound peers into outbound governor known peers. This is the primary way for new unregistered nodes to enter the network, which then can be shared using peer sharing. Note that peer sharing is an experimental feature which is disabled until genesis & eclipse evasion as fully implemented. See #3596.

We are making progress reviewing eclipse evasion, #3886.

We fixed another bug in local root peers. We found out that if the local roots where ignored until the first domain name was resolved, see #4583. The bug fix was backported and released in ouroboros-network-0.8.1.1.

We re-started working on dynamically enabling block forging to address issue #3159, which will enable us to release P2P on block producing nodes. See #140.

New cardano-ping / cardano-cli ping release

We prepared a new release of cardano-ping library which supports the new query feature (query supported versions). See #4589, #4593 and #5313. The new version of cardano-cli ping will use ISO8601 formatted timestamps; also the formatting of ping results is slightly improved, and it will introduce the new --query-versions (-Q) switch. If the remote site supports the query parameter, the command will print:

redacted-ip:port network rtt: 0.064
redacted-ip:port handshake rtt: 0.064010896s
redacted-ip:port Queried versions [NodeToNodeVersionV11 764824073 InitiatorAndResponder,NodeToNodeVersionV10 764824073 InitiatorAndResponder,NodeToNodeVersionV9 764824073 Initiat
orAndResponder,NodeToNodeVersionV8 764824073 InitiatorAndResponder,NodeToNodeVersionV7 764824073 InitiatorAndResponder]

otherwise it will print the negotiation results

redacted-ip:port network rtt: 0.045
redacted-ip:port handshake rtt: 0.101867615s
redacted-ip:port Negotiated version NodeToNodeVersionV10 764824073 InitiatorAndResponder

Note that in that case cardano-cli ping offers InitiatorAndResponder, which allows us to detect whether the remote side is an InitiatorOnly or InitiatorAndResponder. Also cardano-cli ping will no longer announce itself as InitiatorAndResponder, except for the case mentioned above.

Other smaller contributions

On a request from the Marlow Team, we published haddocks of typed-protocols, which are now available here (#40, #41).

We made a new release of strict-stm-1.1.0.1 on Hackage, which fixed a bug in package description file, #101 .

We also helped to debug a deadlock when using named pipes on Windows in the new RawBearer API. The API is being used to store secret keys only in memory. The PR #4395 is under review.

We also have two more PRs which are under review:

  • #4530: enabling ledger peers on a fixed number of slots before the tip of the chain;
  • #4580: a PR which fixes inconsistencies in one of our cddl specs.