Documentation
¶
Overview ¶
This package does its best to ensure deterministic encoding by sorting various fields as specified by the GP appendix D. This allows for more useful JSON diffing.
Index ¶
- func DumpBlockSnapshot(b block.Block) string
- func DumpStateSnapshot(state state.State) string
- func RestoreBlockSnapshot(b []byte) block.Block
- func RestoreStateSnapshot(b []byte) state.State
- type Account
- type AccountData
- type Accounts
- type AccumulatedQueue
- type ActivityStatistics
- type Assurance
- type AuthPools
- type AuthQueues
- type AvailabilityAssigment
- type AvailabilityAssigments
- type Block
- type BlockHistory
- type BlockInfo
- type CoreStatistics
- type Culprit
- type DisputeRecords
- type Disputes
- type EntropyPool
- type EpochMark
- type EpochMarkValidator
- type Extrinsic
- type Fault
- type Guarantee
- type GuaranteeSignature
- type Header
- type LookupMetaInfo
- type LookupMetaKey
- type MMR
- type Preimage
- type PreimageInfo
- type PrivilegedServices
- type ReadyQueue
- type ReadyRecord
- type RefineContext
- type RefineLoad
- type Reported
- type SafroleState
- type SegmentRootLookupItem
- type ServiceInfo
- type ServiceStatistics
- type ServiceStatisticsEntry
- type ServiceStatisticsRecord
- type State
- type Storage
- type TicketBody
- type TicketProof
- type TicketsAccumulator
- type TicketsOrKeys
- type ValidatorData
- type ValidatorStatistics
- type ValidatorsData
- type Verdict
- type VerdictVote
- type WorkPackageSpec
- type WorkReport
- type WorkResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpBlockSnapshot ¶
func DumpStateSnapshot ¶
func RestoreBlockSnapshot ¶
func RestoreStateSnapshot ¶
Types ¶
type Account ¶
type Account struct {
ID uint32 `json:"id"`
Data AccountData `json:"data"`
}
type AccountData ¶
type AccountData struct {
Service ServiceInfo `json:"service"`
Preimages []PreimageInfo `json:"preimages"`
LookupMeta []LookupMetaInfo `json:"lookup_meta"`
Storage *Storage `json:"storage"`
}
func NewAccountData ¶
func NewAccountData(account service.ServiceAccount) AccountData
func (AccountData) To ¶
func (ad AccountData) To() service.ServiceAccount
type Accounts ¶
type Accounts []Account
func NewAccounts ¶
func NewAccounts(accounts service.ServiceState) Accounts
func (Accounts) To ¶
func (a Accounts) To() service.ServiceState
type AccumulatedQueue ¶
type AccumulatedQueue [][]string
func NewAccumulatedQueue ¶
func NewAccumulatedQueue(history state.AccumulationHistory) AccumulatedQueue
func (AccumulatedQueue) To ¶
func (a AccumulatedQueue) To() state.AccumulationHistory
type ActivityStatistics ¶
type ActivityStatistics struct {
ValsCurrent []ValidatorStatistics `json:"vals_current"`
ValsLast []ValidatorStatistics `json:"vals_last"`
Cores []CoreStatistics `json:"cores"`
Services ServiceStatistics `json:"services"`
}
func NewActivityStatistics ¶
func NewActivityStatistics(stats validator.ActivityStatisticsState) ActivityStatistics
func (ActivityStatistics) To ¶
func (as ActivityStatistics) To() validator.ActivityStatisticsState
type AuthPools ¶
type AuthPools [][]string
func NewAuthPools ¶
func NewAuthPools(pools state.CoreAuthorizersPool) AuthPools
func (AuthPools) To ¶
func (ap AuthPools) To() state.CoreAuthorizersPool
type AuthQueues ¶
type AuthQueues [][]string
func NewAuthQueues ¶
func NewAuthQueues(queues state.PendingAuthorizersQueues) AuthQueues
func (AuthQueues) To ¶
func (aq AuthQueues) To() state.PendingAuthorizersQueues
type AvailabilityAssigment ¶
type AvailabilityAssigment struct {
Report *WorkReport `json:"report,omitempty"`
Timeout uint32 `json:"timeout"`
}
type AvailabilityAssigments ¶
type AvailabilityAssigments []*AvailabilityAssigment
func NewAvailabilityAssigments ¶
func NewAvailabilityAssigments(assignments state.CoreAssignments) AvailabilityAssigments
func (AvailabilityAssigments) To ¶
func (aa AvailabilityAssigments) To() state.CoreAssignments
type BlockHistory ¶
type BlockHistory []BlockInfo
func NewBlockHistory ¶
func NewBlockHistory(blocks []state.BlockState) BlockHistory
func (BlockHistory) To ¶
func (bh BlockHistory) To() []state.BlockState
type BlockInfo ¶
type BlockInfo struct {
HeaderHash string `json:"header_hash"`
MMR MMR `json:"mmr"`
StateRoot string `json:"state_root"`
Reported []Reported `json:"reported"`
}
func NewBlockInfo ¶
func NewBlockInfo(blockState state.BlockState) BlockInfo
func (BlockInfo) To ¶
func (bi BlockInfo) To() state.BlockState
type CoreStatistics ¶
type CoreStatistics struct {
DALoad uint32 `json:"da_load"`
Popularity uint16 `json:"popularity"`
Imports uint16 `json:"imports"`
Exports uint16 `json:"exports"`
ExtrinsicSize uint32 `json:"extrinsic_size"`
ExtrinsicCount uint16 `json:"extrinsic_count"`
BundleSize uint32 `json:"bundle_size"`
GasUsed uint64 `json:"gas_used"`
}
type DisputeRecords ¶
type DisputeRecords struct {
Good []string `json:"good"`
Bad []string `json:"bad"`
Wonky []string `json:"wonky"`
Offenders []string `json:"offenders"`
}
func NewDisputeRecords ¶
func NewDisputeRecords(judgements state.Judgements) DisputeRecords
func (DisputeRecords) To ¶
func (d DisputeRecords) To() state.Judgements
type EntropyPool ¶
type EntropyPool []string
func NewEntropyPool ¶
func NewEntropyPool(entropyPool state.EntropyPool) EntropyPool
func (EntropyPool) To ¶
func (ep EntropyPool) To() state.EntropyPool
type EpochMark ¶
type EpochMark struct {
Entropy string `json:"entropy"`
TicketsEntropy string `json:"tickets_entropy"`
Validators []EpochMarkValidator `json:"validators"`
}
type EpochMarkValidator ¶
type Extrinsic ¶
type Extrinsic struct {
Tickets []TicketProof `json:"tickets"`
Preimages []Preimage `json:"preimages"`
Guarantees []Guarantee `json:"guarantees"`
Assurances []Assurance `json:"assurances"`
Disputes Disputes `json:"disputes"`
}
func NewExtrinsic ¶
type Guarantee ¶
type Guarantee struct {
Report WorkReport `json:"report"`
Slot jamtime.Timeslot `json:"slot"`
Signatures []GuaranteeSignature `json:"signatures"`
}
type GuaranteeSignature ¶
type Header ¶
type Header struct {
Parent string `json:"parent"`
ParentStateRoot string `json:"parent_state_root"`
ExtrinsicHash string `json:"extrinsic_hash"`
Slot jamtime.Timeslot `json:"slot"`
EpochMark *EpochMark `json:"epoch_mark"`
TicketsMark *[]TicketBody `json:"tickets_mark"`
OffendersMark []string `json:"offenders_mark"`
AuthorIndex uint16 `json:"author_index"`
EntropySource string `json:"entropy_source"`
Seal string `json:"seal"`
}
type LookupMetaInfo ¶
type LookupMetaInfo struct {
Key LookupMetaKey `json:"key"`
Value []uint32 `json:"value"`
}
type LookupMetaKey ¶
type PreimageInfo ¶
type PrivilegedServices ¶
type PrivilegedServices struct {
ManagerService uint32 `json:"chi_m"`
AssignService uint32 `json:"chi_a"`
DesignateService uint32 `json:"chi_v"`
GasUsed map[uint32]uint64 `json:"chi_g"`
}
func NewPrivilegedServices ¶
func NewPrivilegedServices(services service.PrivilegedServices) PrivilegedServices
func (PrivilegedServices) To ¶
func (p PrivilegedServices) To() service.PrivilegedServices
type ReadyQueue ¶
type ReadyQueue [][]ReadyRecord
func NewReadyQueue ¶
func NewReadyQueue(queue state.AccumulationQueue) ReadyQueue
func (ReadyQueue) To ¶
func (rq ReadyQueue) To() state.AccumulationQueue
type ReadyRecord ¶
type ReadyRecord struct {
Report WorkReport
Dependencies []string
}
type RefineContext ¶
type RefineContext struct {
Anchor string `json:"anchor"`
StateRoot string `json:"state_root"`
BeefyRoot string `json:"beefy_root"`
LookupAnchor string `json:"lookup_anchor"`
LookupAnchorSlot uint32 `json:"lookup_anchor_slot"`
Prerequisites []string `json:"prerequisites"`
}
func NewRefineContext ¶
func NewRefineContext(context block.RefinementContext) RefineContext
func (RefineContext) To ¶
func (r RefineContext) To() block.RefinementContext
type RefineLoad ¶
type SafroleState ¶
type SafroleState struct {
PendingValidators ValidatorsData `json:"gamma_k"`
RingCommitment string `json:"gamma_z"`
SealingKeySeries TicketsOrKeys `json:"gamma_s"`
TicketsAccumulator TicketsAccumulator `json:"gamma_a"`
}
func NewSafroleState ¶
func NewSafroleState(state safrole.State) SafroleState
func (SafroleState) To ¶
func (s SafroleState) To() safrole.State
type SegmentRootLookupItem ¶
type ServiceInfo ¶
type ServiceStatistics ¶
type ServiceStatistics []ServiceStatisticsEntry
func NewServiceStatistics ¶
func NewServiceStatistics(s validator.ServiceStatistics) ServiceStatistics
func (ServiceStatistics) To ¶
func (s ServiceStatistics) To() validator.ServiceStatistics
type ServiceStatisticsEntry ¶
type ServiceStatisticsEntry struct {
ID uint32 `json:"id"`
Record ServiceStatisticsRecord `json:"record"`
}
type ServiceStatisticsRecord ¶
type ServiceStatisticsRecord struct {
ProvidedCount uint16 `json:"provided_count"`
ProvidedSize uint32 `json:"provided_size"`
RefinementCount uint32 `json:"refinement_count"`
RefinementGasUsed uint64 `json:"refinement_gas_used"`
Imports uint32 `json:"imports"`
Exports uint32 `json:"exports"`
ExtrinsicSize uint32 `json:"extrinsic_size"`
ExtrinsicCount uint32 `json:"extrinsic_count"`
AccumulateCount uint32 `json:"accumulate_count"`
AccumulateGasUsed uint64 `json:"accumulate_gas_used"`
OnTransfersCount uint32 `json:"on_transfers_count"`
OnTransfersGasUsed uint64 `json:"on_transfers_gas_used"`
}
type State ¶
type State struct {
AuthPools AuthPools `json:"alpha"`
AuthQueues AuthQueues `json:"varphi"`
BlockHistory BlockHistory `json:"beta"`
SafroleState SafroleState `json:"gamma"`
DisputeRecords DisputeRecords `json:"psi"`
EntropyPool EntropyPool `json:"eta"`
QueuedValidators ValidatorsData `json:"iota"`
ActiveValidators ValidatorsData `json:"kappa"`
ArchivedValidators ValidatorsData `json:"lambda"`
AvailabilityAssignments AvailabilityAssigments `json:"rho"`
Timeslot uint32 `json:"tau"`
PrivilegedServices PrivilegedServices `json:"chi"`
ActivityStatistics ActivityStatistics `json:"pi"`
ReadyQueue ReadyQueue `json:"theta"`
AccumulatedQueue AccumulatedQueue `json:"xi"`
Accounts Accounts `json:"accounts"`
}
type TicketBody ¶
func NewTicketBody ¶
func NewTicketBody(ticket block.Ticket) TicketBody
func (TicketBody) To ¶
func (tb TicketBody) To() block.Ticket
type TicketProof ¶
type TicketsAccumulator ¶
type TicketsAccumulator []TicketBody
func NewTicketsAccumulator ¶
func NewTicketsAccumulator(tickets []block.Ticket) TicketsAccumulator
func (TicketsAccumulator) To ¶
func (ta TicketsAccumulator) To() []block.Ticket
type TicketsOrKeys ¶
type TicketsOrKeys struct {
Keys []string `json:"keys,omitempty"`
Tickets []TicketBody `json:"tickets,omitempty"`
}
func NewTicketsOrKeys ¶
func NewTicketsOrKeys(sealingKeys safrole.SealingKeys) TicketsOrKeys
func (TicketsOrKeys) To ¶
func (tk TicketsOrKeys) To() safrole.SealingKeys
type ValidatorData ¶
type ValidatorData struct {
Bandersnatch string `json:"bandersnatch"`
Ed25519 string `json:"ed25519"`
Bls string `json:"bls"`
Metadata string `json:"metadata"`
}
func NewValidatorData ¶
func NewValidatorData(vk crypto.ValidatorKey) ValidatorData
func (ValidatorData) To ¶
func (vd ValidatorData) To() crypto.ValidatorKey
type ValidatorStatistics ¶
type ValidatorsData ¶
type ValidatorsData []ValidatorData
func NewValidatorsData ¶
func NewValidatorsData(validators safrole.ValidatorsData) ValidatorsData
func (ValidatorsData) To ¶
func (vd ValidatorsData) To() safrole.ValidatorsData
type Verdict ¶
type Verdict struct {
Target string `json:"target"`
Age uint32 `json:"age"`
Votes []VerdictVote `json:"votes"`
}
type VerdictVote ¶
type WorkPackageSpec ¶
type WorkPackageSpec struct {
Hash string `json:"hash"`
Length uint32 `json:"length"`
ErasureRoot string `json:"erasure_root"`
ExportsRoot string `json:"exports_root"`
ExportsCount uint16 `json:"exports_count"`
}
func NewWorkPackageSpec ¶
func NewWorkPackageSpec(spec block.WorkPackageSpecification) WorkPackageSpec
func (WorkPackageSpec) To ¶
func (w WorkPackageSpec) To() block.WorkPackageSpecification
type WorkReport ¶
type WorkReport struct {
PackageSpec WorkPackageSpec `json:"package_spec"`
Context RefineContext `json:"context"`
CoreIndex uint16 `json:"core_index"`
AuthorizerHash string `json:"authorizer_hash"`
AuthOutput string `json:"auth_output"`
SegmentRootLookup []SegmentRootLookupItem `json:"segment_root_lookup"`
Results []WorkResult `json:"results"`
AuthGasUsed uint64 `json:"auth_gas_used"`
}
func NewWorkReport ¶
func NewWorkReport(report block.WorkReport) WorkReport
func (WorkReport) To ¶
func (w WorkReport) To() block.WorkReport
type WorkResult ¶
type WorkResult struct {
ServiceID uint32 `json:"service_id"`
CodeHash string `json:"code_hash"`
PayloadHash string `json:"payload_hash"`
AccumulateGas uint64 `json:"accumulate_gas"`
Result map[string]*string `json:"result"`
RefineLoad RefineLoad `json:"refine_load"`
}
func NewWorkResult ¶
func NewWorkResult(result block.WorkResult) WorkResult
func (WorkResult) To ¶
func (w WorkResult) To() block.WorkResult
Click to show internal directories.
Click to hide internal directories.