griffin_core/
lib.rs

1//! This crate contains all the fundamental building blocks for the Griffin
2//! ledger, runtime, and wallet.
3//!
4//! It was initially based on
5//! [tuxedo_core](https://off-narrative-labs.github.io/Tuxedo/tuxedo_core/index.html),
6//! and it now includes a clone of six crates from the
7//! [Pallas](https://github.com/txpipe/pallas) suite, with modifications in
8//! order to be used in a `no-std` setting.
9//!
10//! The Core main purpose is to bring the Griffin node to life. The node is
11//! based on Substrate / Polkadot SDK, and the instructions to make it run can
12//! be found
13//! [here](https://github.com/txpipe/griffin/tree/main?tab=readme-ov-file#griffin).
14
15#![cfg_attr(not(feature = "std"), no_std)]
16
17#[macro_use]
18extern crate alloc;
19
20mod executive;
21
22pub mod checks_interface;
23pub mod genesis;
24pub mod h224;
25pub mod pallas_addresses;
26pub mod pallas_applying;
27pub mod pallas_codec;
28pub mod pallas_crypto;
29pub mod pallas_interface;
30pub mod pallas_primitives;
31pub mod pallas_traverse;
32pub mod support_macros;
33pub mod types;
34pub mod uplc;
35use h224::H224;
36pub mod utxo_set;
37pub use executive::Executive;
38
39/// The Aura slot duration. When things are working well, this will also be the block time.
40pub const MILLI_SECS_PER_SLOT: u32 = 3000;
41
42/// A storage key that will store the slot number of the first block in the chain.
43pub const ZERO_SLOT: &[u8] = b"zero-slot";
44
45/// A storage key that will store the start POSIX time of ZERO_SLOT, in milliseconds.
46pub const ZERO_TIME: &[u8] = b"zero-time";
47
48/// A Griffin-specific target for diagnostic node log messages
49const LOG_TARGET: &str = "griffin-core";
50
51/// A transient storage key that will hold the partial header while a block is being built.
52/// This key is cleared before the end of the block.
53const HEADER_KEY: &[u8] = b"header";
54
55/// A storage key that will store the block height during and after execution.
56/// This allows the block number to be available in the runtime even during off-chain api calls.
57pub const HEIGHT_KEY: &[u8] = b"height";
58
59/// A transient storage key that will hold the list of extrinsics that have been applied so far.
60/// This key is cleared before the end of the block.
61pub const EXTRINSIC_KEY: &[u8] = b"extrinsics";