49 releases (30 major breaking)

new 32.0.0 Mar 18, 2024
31.0.0 Feb 26, 2024
30.0.0 Feb 13, 2024
29.0.0 Jan 23, 2024
2.0.0-alpha.5 Mar 24, 2020

#1085 in Magic Beans

Download history 976/week @ 2023-11-26 592/week @ 2023-12-03 860/week @ 2023-12-10 971/week @ 2023-12-17 532/week @ 2023-12-24 450/week @ 2023-12-31 896/week @ 2024-01-07 1014/week @ 2024-01-14 994/week @ 2024-01-21 699/week @ 2024-01-28 998/week @ 2024-02-04 1423/week @ 2024-02-11 1425/week @ 2024-02-18 2068/week @ 2024-02-25 1671/week @ 2024-03-03 992/week @ 2024-03-10

6,352 downloads per month
Used in 20 crates (4 directly)

GPL-3.0-or-later…

1.5MB
36K 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

~61–105MB
~2M SLoC