Skip to main content

46 posts tagged with "network"

View All Tags

· 3 min read
Marcin Szamotulski

High-level overview of sprint 45

Bootstrap Peers

We started reviewing the bootstrap peers PR, ouroboros-network#4615.

Towards Typed Protocols 0.2.0.0

We discovered a performance regression when using typed-protocols-0.2.0.0, and we started investigating where it comes from. Currently, we see that typed-protocols-0.2.0.0 can outperform typed-protocols-0.1.0.0 when running in isolation with a simple ping-pong protocol, so the regression might be in the new block fetch implementation which comes with typed-protocols-0.2.0.0 See typed-protocols#3.

Tech Debt

We merged two PRs written by Galois engineers:

  • a pull request which refactors the main entry function for P2P, see ouroboros-network#3834;
  • a pull request which reviews usage of unsafe function in the network code based.

Galois also made progress with the following two issues:

IO-Sim

IOSimPOR

We found and fixed a bug in IOSimPOR. We'd like to thank Prof. John Hughes (Quviq AB) for helping us with debugging the issue.

We also provided a more uniform API for IOSimPOR, and added ways to make the debugging similar problems in the future easier.

Technical Details on IOSim refactoring
We removed the usage of `unsafePerformIO` from `IOSimPOR`, which also means removing parallel evaluation of discovered races. We found out that it gives only 25% better performance. In the future QuickCheck will offer running different cases in parallel which should provide better performance as there are no dependencies between the evaluation of different test cases, while schedules are discovered while running which limits the possible gains from running them concurrently. The performance was not the only factor though. When using parallelism in the lazy `ST` monad we'd need to rely on memory guarantees of `STRefs`. In `GHC-9.6` they share the implementation with `IORef`s, but it might not be the case in the future.

IOSim

To prepare for the next release, we consolidate packages taking advantage of the public sublibraries supported now both by cabal and Hackage. This is a work in progress, io-sim#114.

Cardano Newtork Service Assurance

Galois made the following progress:

  • A test run of spinning up a CNSA instance was done, as a result documentation was updated.
  • Based on the IOG code review of the CNSA code, updates to the CNSA code were made.
  • Galois has started the design for adding a CNSA analysis for "fetched bytes over time while node is syncing".

P2P adoption

In the last two weeks, we've seen increase in P2P adoption. P2P relays

The following graphs show several different versions of relays running on the mainnet. The green line NodeToNodeVersionV10.True denotes P2P relays. node versions

Open Source

We upstreamed our FFI bindings to Windows named pipes to Win32 package, the PR was accepted and merged.

We also received an external contribution which enhanced our documentation, see ouroboros-network#4676.

· 2 min read
Marcin Szamotulski

High-level overview of sprint 44

Bootstrap Peers

In this sprint, we focused on developing bootstrap peers.

Thanks to the input from Samuel Leathers (IOG) and John Lotoski (IOG), we identified a possible improvement to bootstrap peers. A more detailed description is available here.

Cardano-Node-8.4.0 Release

We also were responsible for the cardano-node-8.4.0-pre release. A final integration PR is currently being merged. We published new versions of ouroboros-consensus, cardano-api and cardano-cli.

Towards Typed Protocols 0.2.0.0

We also updated the future typed-protocols-0.2.0.0 and its integration with cardano-node. This is towards our goal which we planned for the next quarter. The identified tasks are to fix breaking tests, and then measure and address possible performance regressions.

Tech Debt

Mark Tullsen (Galois) submitted two more PRs: ouroboros-network-#4663, ouroboros-network-#4664. We provided feedback on their other pull requests: ouroboros-network-#4661 and ouroboros-network-#4660.

P2P adoption

In the last two weeks, there was a regression in P2P adoption concerning the number of SPOs or stakes, although the number of overall P2P relays has increased. Karl Knutsson (Cardano Foundation) is investigating this issue. P2P relays

The following graphs show several different versions of relays running on the mainnet. The green line NodeToNodeVersionV10.True denotes P2P relays, which slowly increase over time. The V9 and earlier versions of the node-to-node the protocol indicates nodes version 1.35.x or earlier. node versions

Data has been kindly provided by Cardano Foundation and their mainnet monitoring infrastructure.

Open Source

We are in the process of upstreaming our ffi to Windows Named Pipes API to the Win32 package, see [win32-220].

· 3 min read
Marcin Szamotulski

High-level overview of sprint 43

In this sprint, we received contributions from CF & Galois. Karl Knutsson (CF) has addressed various issues regarding peer churning in P2P, timeouts and our WireShark dissector. While the Galois developers focused on addressing issues from their review last year. See below for more details.

We continued working on bootstrap peers ouroboros-network-#4661.

We refactored our test suites: they are split into io-tests which require to be run natively on all platforms (these tests mostly contain tests that require IO system calls) and sim-tests which are platform independent. We run io-tests on all supported platforms (e.g. x86_64-linux, x86-64-darwin, aarch64-darwin and x86_64-w64-mingw32 (Windows)) natively. The sim-tests are not executed on Windows due to memory limitations on GitHub Actions runners. ouroboros-network-#4653

We also started rebasing typed-protocols refactoring branches.

Marcin was appointed as the cardano-node release engineer for the 8.4.0-pre version. So far he integrated cardano-ledger-conway-1.8 and ouroboros-network-0.9.1.0 to ouroboros-consensus, cardano-cli and cardano-api. Once we will have an integration branch for cardano-node, cardano-ledger-conway-1.8 and ouroboros-consensus packages can be released to CHaP and PRs can be merged once they go through review & CI.

We also fixed some smaller issues regarding peer sharing (both were discovered by Karl from CF). More details are included below.

Progress on P2P addoption

SPO relays

There are currently ~2000 relays running P2P enabled nodes that belong to 557 pools with a combined stake of 7900Mil Ada. On 16th of August it was ~1700 relays, 531 pools with a combined stake of 7700Mil Ada.

P2P relays

The following graphs show several different versions of relays running on the mainnet. The green line NodeToNodeVersionV10.True denotes P2P relays, which slowly increase over time. The V9 and earlier versions of the node-to-node the protocol indicates nodes version 1.35.x or earlier. node versions

Data has been kindly provided by CF and their mainnet monitoring infrastructure.

IOG relays

As of this week, 90% of IOG relays are running a P2P setup. In the next sprint all IOG relays will be running P2P.

Detailed description

In this sprint, we got a few contributions from CF:

  • Karl made peer churning mechanism less aggressive ouroboros-network-#4656; and
  • he added timeouts for idle states in ChainSync & KeepAlive miniprotocols. These timeouts help a node remove idle connections from the responder (server) side ouroboros-network-#4648.
  • he improved the WireShark dissector by adding support for the peer-sharing mini-protocol ouroboros-network-#4656.

Galois has been making progress in addressing some of the issues they raised in their review (last year):

Peer Sharing

  • Light peer sharing is only enabled when peer sharing is turned on ouroboros-network-#4652;
  • Handshake incorrectly reports peer sharing value. It's supposed to relay the remote value, but instead, it returns the local value. ouroboros-network-#4642 (in review).

Async Demotion Test Fix

  • We fixed an async demotion test failure which turned out to be a weakness of the test itself rather than a bug in the connection manager. ouroboros-network-#4655

· 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.