52 releases (33 major breaking)

new 35.0.0 May 24, 2024
34.0.0 May 1, 2024
33.0.0 Apr 9, 2024
32.0.0 Mar 18, 2024
2.0.0-alpha.5 Mar 24, 2020

#1057 in Magic Beans

Download history 1236/week @ 2024-02-05 1350/week @ 2024-02-12 1356/week @ 2024-02-19 2057/week @ 2024-02-26 2244/week @ 2024-03-04 1389/week @ 2024-03-11 2401/week @ 2024-03-18 2185/week @ 2024-03-25 2442/week @ 2024-04-01 2011/week @ 2024-04-08 2069/week @ 2024-04-15 1879/week @ 2024-04-22 1885/week @ 2024-04-29 1622/week @ 2024-05-06 1902/week @ 2024-05-13 2005/week @ 2024-05-20

7,640 downloads per month
Used in 25 crates (5 directly)

GPL-3.0-or-later…

2MB
42K SLoC

Substrate offchain workers.

The offchain workers is a special function of the runtime that gets executed after block is imported. During execution it's able to asynchronously submit extrinsics that will either be propagated to other nodes or added to the next block produced by the node as unsigned transactions.

Offchain workers can be used for computation-heavy tasks that are not feasible for execution during regular block processing. It can either be tasks that no consensus is required for, or some form of consensus over the data can be built on-chain for instance via:

  1. Challenge period for incorrect computations
  2. Majority voting for results
  3. etc

License: GPL-3.0-or-later WITH Classpath-exception-2.0


lib.rs:

Substrate offchain workers.

The offchain workers is a special function of the runtime that gets executed after block is imported. During execution it's able to asynchronously submit extrinsics that will either be propagated to other nodes or added to the next block produced by the node as unsigned transactions.

Offchain workers can be used for computation-heavy tasks that are not feasible for execution during regular block processing. It can either be tasks that no consensus is required for, or some form of consensus over the data can be built on-chain for instance via:

  1. Challenge period for incorrect computations
  2. Majority voting for results
  3. etc

Dependencies

~74–115MB
~2M SLoC