Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const NEO_BLOCKCHAIN_PERSIST_BLOCK_DURATION_SECONDS = metrics.createHistogram({
name: 'neo_blockchain_persist_block_duration_seconds',
});
const NEO_BLOCKCHAIN_PERSIST_BLOCK_FAILURES_TOTAL = metrics.createCounter({
name: 'neo_blockchain_persist_block_failures_total',
});
const NEO_BLOCKCHAIN_BLOCK_INDEX_GAUGE = metrics.createGauge({
name: 'neo_blockchain_block_index',
help: 'The current block index',
});
const NEO_BLOCKCHAIN_PERSISTING_BLOCK_INDEX_GAUGE = metrics.createGauge({
name: 'neo_blockchain_persisting_block_index',
help: 'The current in progress persist index',
});
const NEO_BLOCKCHAIN_PERSIST_BLOCK_LATENCY_SECONDS = metrics.createHistogram({
name: 'neo_blockchain_persist_block_latency_seconds',
help: 'The latency from block timestamp to persist',
buckets: [1, 2, 5, 7.5, 10, 12.5, 15, 17.5, 20],
});
export default class Blockchain {
_monitor: Monitor;
_blockIndexGauge: Gauge;
_persistingBlockIndexGauge: Gauge;
_persistBlockLatencyHistogram: Histogram;
deserializeWireContext: $PropertyType<
BlockchainType,
'deserializeWireContext',
>;
serializeJSONContext: $PropertyType;
feeContext: $PropertyType;
type SpentCoin = {|
output: Output,
startHeight: number,
endHeight: number,
claimed: boolean,
|};
type Vote = {|
publicKeys: Array,
count: BN,
|};
const NAMESPACE = 'blockchain';
const NEO_BLOCKCHAIN_PERSIST_BLOCK_DURATION_SECONDS = metrics.createHistogram({
name: 'neo_blockchain_persist_block_duration_seconds',
});
const NEO_BLOCKCHAIN_PERSIST_BLOCK_FAILURES_TOTAL = metrics.createCounter({
name: 'neo_blockchain_persist_block_failures_total',
});
const NEO_BLOCKCHAIN_BLOCK_INDEX_GAUGE = metrics.createGauge({
name: 'neo_blockchain_block_index',
help: 'The current block index',
});
const NEO_BLOCKCHAIN_PERSISTING_BLOCK_INDEX_GAUGE = metrics.createGauge({
name: 'neo_blockchain_persisting_block_index',
help: 'The current in progress persist index',
});
const NEO_BLOCKCHAIN_PERSIST_BLOCK_LATENCY_SECONDS = metrics.createHistogram({
name: 'neo_blockchain_persist_block_latency_seconds',
help: 'The latency from block timestamp to persist',