Advanced Overview

Pool State

Settings

The name and logo are used for display purposes.

Runtime

An identifier used by the node to automatically load the correct integration.

Version

An internal pool version.

Admins

A list of Arweave addresses, which can update the pools settings. Admins can always remove and add new admins. By default, the pool creator is the only admin.

Paused

A boolean which can be set by the pool admins. When a pool is paused no data can be registered or submitted.

Grace Period

Measured in Arweave blocks. It determines how long a transaction will stay open for voting. The higher the grace period, the longer it takes for a transaction to be fully validated. If set too small, it can cause validators to be unable to vote on it, resulting in a transaction marked as dropped.

Slash Threshold

For every violation, uploaders or validators receive one slashing point. When the slashing points exceed the slash threshold, their stake gets slashed, and points are reset to 0.

Payout

The amount of $KYVE paid out can be configured to be dynamic or static. When the payout is dynamic pay-out is, KYVE measures the number of bytes uploaded by the uploader. The kyvePerBytes setting controls the number of tokens being released. If high computation is required, it makes sense to also set the idleCost option to release a static amount of tokens per payout.

Foreign Contracts

Internal setting. Linking to the governance and treasury contract.

Uploader

The Arweave address of the current uploader. Can be changed by the pool admins.

Bundle Size

The size of an ANS-102 bundle, which gets stored on Arweave. Using bundles reduces costs and prevents spamming the network. The faster the incoming data stream is, the higher the bundle size should be. We recommend sending one bundle every 10 minutes.

Config

A pool-specific configuration. The config object is exposed in the upload and validate functions, allowing developers to inject configurations like API endpoints into the code. Can be changed by the pool admins.

Credit

An internal object to keep track of a user's amount, stake, fund, and slashing points. Tokens in amount can be withdrawn at any time. Staked tokens are used for uploaders and validators as collateral. When their slashing points exceed the threshold, their stake gets slashed. Tokens in fund will be reduced every time a transaction is finalized. When there is not enough funding left in the pool, it pauses until there are enough tokens to fulfill a payout.

Transactions (txs)

An internal object for keeping track of a transaction's status. When the uploader uploads new data, it registers the transaction in the pool. The validator then fetches this transaction and performs the validation logic against the transaction data. The validator then submits its result to the pool. After the grace period has ended a transaction is either valid, invalid or dropped (not enough validators voted).

Invocations & Foreign Calls

Internal objects, used by the foreign call protocol. A SmartWeave specific protocol for interaction with other contracts.

Example State

1
{
2
settings: {
3
name: '',
4
logo: '',
5
foriegnContracts: {
6
governance: 'cpXtKvM0e6cqAgjv-BCfanWQmYGupECt1MxRk1N9Mjk',
7
treasury: 'shwdmXTFCaMq8WaCGg79oCF5GCj0bpb5tNA62cluEQY'
8
},
9
paused: false,
10
uploader: '3dX8Cnz3N64nKt2EKmWpKL1EbErFP3RFjxSDyQHQrkI',
11
bundleSize: 1,
12
gracePeriod: 20,
13
slashThreshold: 5,
14
payout: {
15
kyvePerByte: 0.0002,
16
idleCost: 0
17
}
18
},
19
config: {
20
contracts: [
21
'cETTyJQYxJLVQ6nC3VxzsZf1x2-6TW2LFkGZa91gUWc'
22
]
23
},
24
credit: {
25
vxUdiv2fGHMiIoek5E4l3M5qSuKCZtSaOBYjMRc94JU: {
26
amount: 0,
27
stake: 0,
28
fund: 263.272,
29
points: 0
30
},
31
'3dX8Cnz3N64nKt2EKmWpKL1EbErFP3RFjxSDyQHQrkI': {
32
amount: 560.97504,
33
stake: 100,
34
fund: 0,
35
points: 1
36
},
37
's-hGrOFm1YysWGC3wXkNaFVpyrjdinVpRKiVnhbo2so': {
38
amount: 471.018399999999,
39
stake: 100,
40
fund: 0,
41
points: 0
42
}
43
},
44
txs: {
45
'hH7RGiZGjKWVR1_syiBRQ_7s3kwoo-tpasWC_eK9DcA': {
46
status: 'invalid',
47
closesAt: 718750,
48
yays: [],
49
nays: [
50
Array
51
],
52
voters: [
53
Array
54
],
55
confirmedAt: 718753
56
},
57
EM5i8D1mYT5grk2oa3KTPpLVhlpfhfmKXH_rjMMmb7Q: {
58
status: 'valid',
59
closesAt: 718773,
60
yays: [
61
Array
62
],
63
nays: [],
64
voters: [
65
Array
66
],
67
confirmedAt: 718778
68
},
69
'fxRiSFH5wxjVOpPEcujmlTqM-wOAfE-yk2TikRYzYx0': {
70
status: 'pending',
71
closesAt: 718788,
72
yays: [
73
Array
74
],
75
nays: [],
76
voters: [
77
Array
78
]
79
},
80
},
81
invocations: [],
82
foreignCalls: [
83
{
84
txID: 'U4HybAlJBKd0xGtTEy-SMW7RsTEvid5GTlb2BMZog_U//0',
85
contract: 'cpXtKvM0e6cqAgjv-BCfanWQmYGupECt1MxRk1N9Mjk',
86
input: [
87
Object
88
]
89
},
90
]
91
}
Copied!
Last modified 3mo ago