PackageTrack
Sign in Get early access

madsim

Deterministic Simulator for distributed systems.

0.2.34 6.4M downloads/mo #3998 most downloaded on crates.io madsim-rs/madsim

What this package is like to depend on

Last release 10 months ago

11 Oct 2025

Release timing varies

gaps range from 9 days to 8 months

Nearly every release is documented

notes for 39 of 39 stable releases

Nothing withdrawn

no release was ever pulled

5 years old

46 releases · first in 2021

1 release in the last 12 months

see the full history below

Release timeline

46 releases · Aug 2021 to Oct 2025
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 46
  1. 0.2.34 11 Oct 2025
    Release notes

    Changed

    • Name of the default node is changed from main to madsim-main.
    • libc::gethostname now returns the name of the current node, or madsim-node-{id} if it's unnamed.
    Open source →
  2. 0.2.33 31 Jul 2025
    Release notes

    Changed

    • Update dependency toml to v0.9.
    Open source →
  3. 0.2.32 24 Jun 2025
    Release notes

    Fixed

    • Fix the problem where random is not deterministic on OSX (#244).
    Open source →
  4. 0.2.31 18 Oct 2024
    Release notes

    Fixed

    • Fix the problem where spawn in drop panics (#228).
    Open source →
  5. 0.2.30 06 Jun 2024
    Release notes

    Removed

    • Remove Handle::spawn and Handle::spawn_blocking as the implementation is incorrect.
    Open source →
  6. 0.2.29 27 May 2024
    Release notes

    Added

    • Implement Debug for Handle and AbortHandle.

    Fixed

    • When MADSIM_ALLOW_SYSTEM_THREAD is set, executor won't panic when no task is ready.
    Open source →
  7. 0.2.28 17 May 2024
    Release notes

    Fixed

    • Fix the problem that Handle::spawn spawns the task in a new node.
    Open source →
  8. 0.2.27 07 Apr 2024
    Release notes

    Added

    • Add Runtime::handle().
    Open source →
  9. 0.2.26 18 Mar 2024
    Release notes

    Added

    • Add a fake runtime::Handle. Note that this is a re-export of madsim::task::Handle. Tasks spawned with this handle are not correctly associated with the tokio runtime.
    Open source →
  10. 0.2.25 26 Feb 2024
    Release notes

    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Removed

    • Remove stats feature to allow tokio >=1.33.
    Open source →
  11. 0.2.24 06 Jan 2024
    Release notes
    • fix time on x86_64 macos

    Signed-off-by: Runji Wang [email protected]

    • add path to madsim deps

    Signed-off-by: Runji Wang [email protected]

    • update deps for madsim

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Fixed

    • Fix intercepting time on x86_64 macOS, Rust 1.75.0.
    Open source →
  12. 0.2.23 27 Oct 2023
    Release notes

    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Fixed

    • madsim: Return an error instead of panicking when lookup_host receives an invalid address.
    Open source →
  13. 0.2.22 19 Apr 2023
    Release notes
    • add restart_on_panic_matching

    Signed-off-by: Runji Wang [email protected]

    • bump version

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Added

    • madsim: Add restart_on_panic_matching to support auto restarting on panic with certain messages.
    Open source →
  14. 0.2.21 14 Apr 2023
    Release notes
    • tonic: fix panic on connection reset

    Signed-off-by: Runji Wang [email protected]

    • bump version

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Added

    • madsim: Add time::advance.

    Fixed

    • tonic: Fix panic on bi-directional streaming server closed.
    Open source →
  15. 0.2.20 13 Apr 2023
    Release notes
    • add metric num_tasks_by_node_by_spawn

    Signed-off-by: Runji Wang [email protected]

    • record task spawn time

    Signed-off-by: Runji Wang [email protected]

    • don't spawn task for connection

    Signed-off-by: Runji Wang [email protected]

    • etcd: fix server task leak

    Signed-off-by: Runji Wang [email protected]

    • fix clippy

    Signed-off-by: Runji Wang [email protected]

    • bump version

    Signed-off-by: Runji Wang [email protected]

    • tonic: drop RPC task on client closed

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Added

    • madsim: Add detailed metrics for tasks.

    Changed

    • madsim: Avoid spawning tasks for connection.

    Fixed

    • madsim: Fix leak of task introduced in 0.2.19.
    • tonic: Fix leak of RPC task in server.
    Open source →
  16. 0.2.19 07 Apr 2023
    Release notes

    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Added

    • madsim: Print context information on panic.
    • madsim: Add AbortHandle.
    • madsim: Add RuntimeMetrics.
    • tokio: Support dropping Runtime.

    Changed

    • madsim: Futures of a killed node are dropped after a while.
    Open source →
  17. 0.2.18 08 Mar 2023
    Release notes
    • tonic: fix the error when server stream is broken

    Signed-off-by: Runji Wang [email protected]

    • update CHANGELOG

    Signed-off-by: Runji Wang [email protected]

    • release v0.2.18

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Added

    • tonic: Support request timeout.

    Fixed

    • madsim: Replace SmallRng with Xoshiro256PlusPlus for reproducibility across platforms.
    • tonic: Return an error when the server stream is broken.
    Open source →
  18. 0.2.17 17 Feb 2023
    Release notes
    • remove printing MADSIM_CONFIG_HASH to avoid confusion

    Signed-off-by: Runji Wang [email protected]

    • s3: make fields public for *Output

    Signed-off-by: Runji Wang [email protected]

    • bump version to v0.2.17

    Signed-off-by: Runji Wang [email protected]

    • mention patching tokio-stream in README

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Fixed

    • madsim: Prevent deadlock when killing a node.
    • s3: Make fields public for *Output structs.
    Open source →
  19. 0.2.16 14 Feb 2023
    Release notes
    • fix clock_id=7

    Signed-off-by: Runji Wang [email protected]

    • add changelog and bump version

    Signed-off-by: Runji Wang [email protected]

    • s3: don't return error when deleted object is not found

    Signed-off-by: Runji Wang [email protected]

    • add changelog

    Signed-off-by: Runji Wang [email protected]


    Signed-off-by: Runji Wang [email protected]

    Open source →
    Release notes

    Fixed

    • madsim: Fix clock_gettime(CLOCK_BOOTTIME = 7) on Linux.
    • s3: Don't return error when deleted object is not found.
    Open source →
  20. 0.2.15 07 Feb 2023
    Release notes

    Added

    • madsim: Add buggify.
    • madsim: Add JoinHandle::{id, is_finished}.
    • madsim: Add signal::ctrl_c and Handle::send_ctrl_c.
    • madsim: Add Handle::is_exit.
    • Add S3 simulator.

    Changed

    • madsim: After the initial task completes, the other tasks of the node are dropped.
    Open source →
  21. 0.2.14 30 Jan 2023
    Release notes

    Added

    • madsim: Add NetSim::add_dns_record.
    • madsim: Add a global IPVS for load balancing.

    Fixed

    • tonic/rdkafka: Resolve DNS on connection.
    Open source →
  22. 0.2.13 09 Jan 2023
    Release notes

    Fixed

    • madsim: Fix join cancelled tasks.
    Open source →
  23. 0.2.12 13 Dec 2022
    Release notes

    Changed

    • madsim: No longer initialize the global logger on #[main] or #[test].

    Fixed

    • madsim: Fix Instant interception on ARM64 macOS caused by change in Rust nightly.
    Open source →
  24. 0.2.11 02 Dec 2022
    Release notes

    Added

    • tokio: Add task::Builder::new_current_thread but panic inside.
    • tonic: Add service module and Extensions.
    • tonic: Support interceptor.

    Fixed

    • tonic: Fix passing metadata in request and response. Add content-type and date field.
    • tonic: Fix panic on unimplemented error.
    Open source →
  25. 0.2.10 09 Nov 2022
    Release notes

    Fixed

    • madsim: Fix panic on TLS access error.
    Open source →
  26. 0.2.9 28 Oct 2022
    Release notes

    Fixed

    • madsim: Fix internal structure change of nightly std::time::{SystemTime, Interval}.
    Open source →
  27. 0.2.8 26 Sep 2022
    Release notes

    Added

    • madsim: Expose JoinHandle::cancel_on_drop.
    Open source →
  28. 0.2.7 13 Sep 2022
    Release notes

    Added

    • tokio: Add fake Runtime.

    Changed

    • madsim: Change the default seed to the nanosecond of current time.
    • madsim: Wait for a while after panicking before restart.

    Fixed

    • madsim: Avoid closing socket of a restarted node.
    Open source →
  29. 0.2.6 05 Sep 2022
    Release notes

    Added

    • madsim: Add hook function for RPC.

    Removed

    • madsim: Deprecate Network::(dis)connect(2) functions. Rename them to (un)clog_*.
    Open source →
  30. 0.2.5 02 Sep 2022
    Release notes

    Changed

    • madsim: Forbid creating system thread in simulation.
    • madsim: Drop futures on killing node.
    • madsim: Make Endpoint clonable.
    Open source →
  31. 0.2.4 25 Aug 2022
    Release notes

    Fixed

    • madsim: Fix panic from minstant crate on Linux virtual machine.
    • tonic: Fix panic when server sends a response but client has closed the stream.
    Open source →
  32. 0.2.3 24 Aug 2022
    Release notes

    Fixed

    • madsim: Fix lookup_host on 'localhost'.
    Open source →
  33. 0.2.2 24 Aug 2022
    Release notes

    Added

    • madsim: Add task::Builder API.
    • madsim: Support auto restarting a node on panic.

    Changed

    • madsim: Rename TaskNodeHandle to Spawner.

    Removed

    • madsim: Deprecate spawn_blocking.
    Open source →
  34. 0.2.1 19 Aug 2022
    Release notes

    Added

    • madsim: Add basic net::UdpSocket.

    Changed

    • madsim: Refactor network simulator with a new connection primitive.
    • madsim: Migrate logging facility to tracing. Replace env_logger with tracing-subscriber.
    • madsim: Migrate std lock to spin lock.
    • tonic: Reduce dependencies in simulation build.

    Fixed

    • madsim: Fix the address of TcpStream accepted from TcpListener.
    • madsim: Fix the socket address space. A TCP and a UDP sockets can have the same address in a node.
    • tonic: Close the stream when the connection is broken.
    Open source →
  35. 0.2.0 10 Aug 2022
    Release notes

    Added

    • madsim-tonic: Add missing methods of Endpoint and Server.

    Fixed

    • madsim-tokio: #[tokio::main] no longer requires madsim crate.

    Removed

    • madsim: Remove collections module since we can use std's directly.
    Open source →
  36. 0.2.0-alpha.7 06 Aug 2022 pre-release
    Release notes

    Added

    • madsim: Allow user to set the number of CPU cores and simulate std::thread::available_parallelism.
    • madsim: Add MADSIM_TEST_JOBS environment variable to set the number of jobs to run simultaneously.
    • madsim: Introduce runtime Builder.
    • madsim: Expose seed via Handle::seed.

    Fixed

    • madsim: Fix the local address after bind 0.0.0.0.
    • madsim-tonic: Client connecting to an invalid address should return error.

    Removed

    • madsim: Remove Runtime::{enable_determinism_check, take_rand_log}. Replaced by check_determinism.
    Open source →
  37. 0.2.0-alpha.6 01 Aug 2022 pre-release
    Release notes

    Added

    • Make deterministic on rand and std::{collections::{HashMap, HashSet}, time::{SystemTime, Instant}}.

      Exception: rand is not deterministic on linux. use madsim::rand instead.

    Changed

    • madsim-macros: Every simulation now runs on a new thread to ensure the determinism.
    • madsim-tonic: Update tonic to v0.8. Additional system protoc is required.
    Open source →
  38. 0.2.0-alpha.5 26 Jul 2022 pre-release
    Release notes

    Added

    • Migrate a new crate madsim-tokio-postgres for simulation.
    • madsim-tokio: Add task_local, task::LocalKey, signal::ctrl_c.
    • madsim-tonic: Support Request::remote_addr and returning error from server.

    Fixed

    • madsim: Refactor TCP simulator and fix several bugs. (#18)
    • madsim: Avoid some panics on panicking.
    Open source →
  39. 0.2.0-alpha.4 18 Jul 2022 pre-release
    Release notes

    Added

    • madsim: Add TCP simulation.
    • madsim-tokio: Add task::consume_budget and task::Id.

    Fixed

    • madsim: Avoid duplicate connection and close unused connection on TCP.
    • madsim-tokio: Fix full feature.
    Open source →
  40. 0.2.0-alpha.3 25 May 2022 pre-release
    Release notes

    Added

    • madsim: Add serde API to HashMap.
    • madsim-norandom: A preview library for intercepting libc getrandom.

    Changed

    • Breaking: Change the way to enable simulation: #[cfg(feature = "sim")] -> #[cfg(madsim)].

    Fixed

    • Lock version on madsim dependencies to prevent API broken.
    Open source →
  41. 0.2.0-alpha.2 21 May 2022 pre-release
    Release notes

    Added

    • Add a new crate madsim-tokio for tokio simulation.
    • madsim/sim: Add time::interval and task::yield_now.
    • madsim/sim: Complete methods for Sleep, Elapsed, JoinError and JoinHandle.
    • madsim-tonic: Add Server::layer but don't implement it.

    Changed

    • Breaking: madsim: Switch JoinHandle to tokio style which won't cancel task on drop.
    • madsim-macros: Improve error message on panic in simulation.

    Fixed

    • madsim: Fix TCP performance issue by setting NODELAY.
    Open source →
  42. 0.2.0-alpha.1 12 May 2022 pre-release
    Release notes

    TODO

    Added

    • A real world backend.
    Open source →
  43. 0.1.3 30 Nov 2021
    Release notes

    Fixed

    • Fix deadlock on M1 macOS: add epsilon on time increasing
    Open source →
  44. 0.1.2 04 Nov 2021
    Release notes

    Added

    • API to get the local socket address.
    Open source →
  45. 0.1.1 24 Aug 2021
    Release notes

    Added

    • Deterministic check on test.

    Changed

    • Remove default time limit (300s) on test.
    • Improve error message on context missing.

    Fixed

    • Fix double panic in the executor.
    • Fix deterministic in time::timeout.
    Open source →
  46. 0.1.0 22 Aug 2021
    Release notes

    Added

    • Deterministic async runtime.
    • Basic simulated network and file system.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive