33 releases (19 major breaking)

new 21.0.0 Mar 26, 2023
20.0.0 Mar 5, 2023
19.0.0 Feb 26, 2023
18.0.0 Feb 19, 2023
2.0.0-alpha.5 Mar 24, 2020

#875 in Magic Beans

Download history 771/week @ 2022-12-04 1117/week @ 2022-12-11 1014/week @ 2022-12-18 446/week @ 2022-12-25 255/week @ 2023-01-01 686/week @ 2023-01-08 393/week @ 2023-01-15 957/week @ 2023-01-22 1101/week @ 2023-01-29 747/week @ 2023-02-05 394/week @ 2023-02-12 1177/week @ 2023-02-19 264/week @ 2023-02-26 1310/week @ 2023-03-05 447/week @ 2023-03-12 609/week @ 2023-03-19

2,662 downloads per month
Used in 18 crates (2 directly)

GPL-3.0-or-later…

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

~53–93MB
~2M SLoC