47 releases (28 major breaking)

new 30.0.0 Feb 13, 2024
29.0.0 Jan 23, 2024
28.0.0 Dec 13, 2023
27.0.0 Nov 20, 2023
2.0.0-alpha.5 Mar 24, 2020

#697 in Magic Beans

Download history 1315/week @ 2023-10-30 1354/week @ 2023-11-06 1048/week @ 2023-11-13 1493/week @ 2023-11-20 1218/week @ 2023-11-27 1004/week @ 2023-12-04 1202/week @ 2023-12-11 1293/week @ 2023-12-18 939/week @ 2023-12-25 738/week @ 2024-01-01 1230/week @ 2024-01-08 1308/week @ 2024-01-15 1357/week @ 2024-01-22 1037/week @ 2024-01-29 1557/week @ 2024-02-05 1618/week @ 2024-02-12

5,599 downloads per month
Used in 21 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

~58–100MB
~2M SLoC