params

package
v1.9.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2020 License: GPL-3.0, GPL-3.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Wei    = 1
	GWei   = 1e9
	Cortex = 1e18
)

These are the multipliers for ctxcer denominations. Example: To get the wei value of an amount in 'gwei', use

new(big.Int).Mul(value, big.NewInt(params.GWei))
View Source
const (
	Bucket    = 1024
	Group     = 32
	SyncBatch = 4096
	Delay     = 12
	//Scope     = 4
	TIER  = 3
	LEAFS = 32768
)
View Source
const (
	// BloomBitsBlocks is the number of blocks a single bloom bit section vector
	// contains on the server side.
	BloomBitsBlocks uint64 = 4096

	// BloomConfirms is the number of confirmation blocks before a bloom section is
	// considered probably final and its rotated bits are calculated.
	BloomConfirms = 256

	CHTFrequency = 32768
	/*Check section:41 1376255
	Check section:42 1409023
	Check section:43 1441791
	Check section:44 1474559
	Check section:45 1507327
	Check section:46 1540095
	Check section:47 1572863
	Check section:48 1605631
	Check section:49 1638399
	Check section:50 1671167
	Check section:51 1703935
	Check section:52 1736703
	Check section:53 1769471
	Check section:54 1802239
	Check section:55 1835007
	Check section:56 1867775
	Check section:57 1900543
	Check section:58 1933311
	Check section:59 1966079
	Check section:60 1998847
	*/
	ImmutabilityThreshold = 90000
)
View Source
const (
	//all configs should not be changed
	GasLimitBoundDivisor uint64 = 1024        // The bound divisor of the gas limit, used in update calculations.
	MinGasLimit          uint64 = 8000000     // Minimum the gas limit may ever be.
	GenesisGasLimit      uint64 = MinGasLimit // Gas limit of the Genesis block.
	MinerGasFloor        uint64 = MinGasLimit
	MinerGasCeil         uint64 = 160000000

	MaximumExtraDataSize  uint64 = 32      // Maximum size extra data may be after Genesis.
	ExpByteGas            uint64 = 10      // Times ceil(log256(exponent)) for the EXP instruction.
	SloadGas              uint64 = 50      // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.
	CallValueTransferGas  uint64 = 9000    // Paid for CALL when the value transfer is non-zero.
	CallNewAccountGas     uint64 = 25000   // Paid for CALL when the destination address didn't exist prior.
	TxGas                 uint64 = 21000   // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions.
	TxGasContractCreation uint64 = 53000   // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
	UploadGas             uint64 = 277777  //555555
	TxDataZeroGas         uint64 = 4       // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
	QuadCoeffDiv          uint64 = 512     // Divisor for the quadratic particle of the memory cost equation.
	SstoreSetGas          uint64 = 20000   // Once per SLOAD operation.
	LogDataGas            uint64 = 8       // Per byte in a LOG* operation's data.
	CallStipend           uint64 = 2300    // Free gas given at beginning of call.
	CallInferGas          uint64 = 1000000 // Base gas for call infer
	InferOpsPerGas        uint64 = 20000   // 1 gas infer 10000 ops

	Sha3Gas         uint64 = 30    // Once per SHA3 operation.
	Sha3WordGas     uint64 = 6     // Once per word of the SHA3 operation's data.
	SstoreResetGas  uint64 = 5000  // Once per SSTORE operation if the zeroness changes from zero.
	SstoreClearGas  uint64 = 5000  // Once per SSTORE operation if the zeroness doesn't change.
	SstoreRefundGas uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.

	NetSstoreNoopGas  uint64 = 200   // Once per SSTORE operation if the value doesn't change.
	NetSstoreInitGas  uint64 = 20000 // Once per SSTORE operation from clean zero.
	NetSstoreCleanGas uint64 = 5000  // Once per SSTORE operation from clean non-zero.
	NetSstoreDirtyGas uint64 = 200   // Once per SSTORE operation from dirty.

	NetSstoreClearRefund      uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot
	NetSstoreResetRefund      uint64 = 4800  // Once per SSTORE operation for resetting to the original non-zero value
	NetSstoreResetClearRefund uint64 = 19800 // Once per SSTORE operation for resetting to the original zero value

	SstoreSentryGasEIP2200   uint64 = 2300  // Minimum gas required to be present for an SSTORE call, not consumed
	SstoreNoopGasEIP2200     uint64 = 800   // Once per SSTORE operation if the value doesn't change.
	SstoreDirtyGasEIP2200    uint64 = 800   // Once per SSTORE operation if a dirty value is changed.
	SstoreInitGasEIP2200     uint64 = 20000 // Once per SSTORE operation from clean zero to non-zero
	SstoreInitRefundEIP2200  uint64 = 19200 // Once per SSTORE operation for resetting to the original zero value
	SstoreCleanGasEIP2200    uint64 = 5000  // Once per SSTORE operation from clean non-zero to something else
	SstoreCleanRefundEIP2200 uint64 = 4200  // Once per SSTORE operation for resetting to the original non-zero value
	SstoreClearRefundEIP2200 uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot

	JumpdestGas   uint64 = 1     // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
	EpochDuration uint64 = 30000 // Duration between proof-of-work epochs.

	CallGas                  uint64 = 40    // Once per CALL operation & message call transaction.
	CreateDataGas            uint64 = 20    //200
	CallCreateDepth          uint64 = 1024  // Maximum depth of call/create stack.
	ExpGas                   uint64 = 10    // Once per EXP instruction
	LogGas                   uint64 = 375   // Per LOG* operation.
	CopyGas                  uint64 = 3     //
	StackLimit               uint64 = 1024  // Maximum size of VM stack allowed.
	TierStepGas              uint64 = 0     // Once per operation, for a selection of them.
	LogTopicGas              uint64 = 375   // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.
	CreateGas                uint64 = 32000 // Once per CREATE operation & contract-creation transaction.
	Create2Gas               uint64 = 32000 // Once per CREATE2 operation
	SelfdestructRefundGas    uint64 = 24000 // Refunded following a selfdestruct operation.
	SuicideRefundGas         uint64 = 24000 // Refunded following a suicide operation.
	MemoryGas                uint64 = 3     // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.
	TxDataNonZeroGasFrontier uint64 = 68    // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions.
	TxDataNonZeroGasEIP2028  uint64 = 16    // Per byte of non zero data attached to a transaction after EIP 2028 (part in Istanbul)

	// These have been changed during the course of the chain
	CallGasFrontier              uint64 = 40  // Once per CALL operation & message call transaction.
	CallGasEIP150                uint64 = 700 // Static portion of gas for CALL-derivates after EIP 150 (Tangerine)
	BalanceGasFrontier           uint64 = 20  // The cost of a BALANCE operation
	BalanceGasEIP150             uint64 = 400 // The cost of a BALANCE operation after Tangerine
	BalanceGasEIP1884            uint64 = 700 // The cost of a BALANCE operation after EIP 1884 (part of Istanbul)
	ExtcodeSizeGasFrontier       uint64 = 20  // Cost of EXTCODESIZE before EIP 150 (Tangerine)
	ExtcodeSizeGasEIP150         uint64 = 700 // Cost of EXTCODESIZE after EIP 150 (Tangerine)
	SloadGasFrontier             uint64 = 50
	SloadGasEIP150               uint64 = 200
	SloadGasEIP1884              uint64 = 800  // Cost of SLOAD after EIP 1884 (part of Istanbul)
	SloadGasEIP2200              uint64 = 800  // Cost of SLOAD after EIP 2200 (part of Istanbul)
	ExtcodeHashGasConstantinople uint64 = 400  // Cost of EXTCODEHASH (introduced in Constantinople)
	ExtcodeHashGasEIP1884        uint64 = 700  // Cost of EXTCODEHASH after EIP 1884 (part in Istanbul)
	SelfdestructGasEIP150        uint64 = 5000 // Cost of SELFDESTRUCT post EIP 150 (Tangerine)

	// EXP has a dynamic portion depending on the size of the exponent
	ExpByteFrontier uint64 = 10 // was set to 10 in Frontier
	ExpByteEIP158   uint64 = 50 // was raised to 50 during Eip158 (Spurious Dragon)

	// Extcodecopy has a dynamic AND a static cost. This represents only the
	// static portion of the gas. It was changed during EIP 150 (Tangerine)
	ExtcodeCopyBaseFrontier uint64 = 20
	ExtcodeCopyBaseEIP150   uint64 = 700

	// CreateBySelfdestructGas is used when the refunded account is one that does
	// not exist. This logic is similar to call.
	// Introduced in Tangerine Whistle (Eip 150)
	CreateBySelfdestructGas uint64 = 25000

	MaxCodeSize = 24576 // Maximum bytecode to permit for a contract

	EcrecoverGas        uint64 = 3000 // Elliptic curve sender recovery gas price
	Sha256BaseGas       uint64 = 60   // Base price for a SHA256 operation
	Sha256PerWordGas    uint64 = 12   // Per-word price for a SHA256 operation
	Ripemd160BaseGas    uint64 = 600  // Base price for a RIPEMD160 operation
	Ripemd160PerWordGas uint64 = 120  // Per-word price for a RIPEMD160 operation
	IdentityBaseGas     uint64 = 15   // Base price for a data copy operation
	IdentityPerWordGas  uint64 = 3    // Per-work price for a data copy operation
	ModExpQuadCoeffDiv  uint64 = 20   // Divisor for the quadratic particle of the big int modular exponentiation

	Bn256AddGasByzantium             uint64 = 500    // Byzantium gas needed for an elliptic curve addition
	Bn256AddGasIstanbul              uint64 = 150    // Gas needed for an elliptic curve addition
	Bn256ScalarMulGasByzantium       uint64 = 40000  // Byzantium gas needed for an elliptic curve scalar multiplication
	Bn256ScalarMulGasIstanbul        uint64 = 6000   // Gas needed for an elliptic curve scalar multiplication
	Bn256PairingBaseGasByzantium     uint64 = 100000 // Byzantium base price for an elliptic curve pairing check
	Bn256PairingBaseGasIstanbul      uint64 = 45000  // Base price for an elliptic curve pairing check
	Bn256PairingPerPointGasByzantium uint64 = 80000  // Byzantium per-point price for an elliptic curve pairing check
	Bn256PairingPerPointGasIstanbul  uint64 = 34000  // Per-point price for an elliptic curve pairing check
)
View Source
const (
	SeedingBlks = 6   // TESTING: for torrent seed spreading
	MatureBlks  = 100 // Blocks between model uploading tx and model ready for use.
	// For the full node to synchronize the models
	BernardMatureBlks = 10                  // TESTING: For the full node to synchronize the models, in dolores testnet
	DoloresMatureBlks = 1                   // TESTING: For the full node to synchronize the models, in dolores testnet
	ExpiredBlks       = 1000000000000000000 // TESTING: Model expire blocks. Not effective. 8409600

	PER_UPLOAD_BYTES       uint64 = 1 * 512 * 1024     // Step of each progress update about how many bytes per upload tx
	DEFAULT_UPLOAD_BYTES   uint64 = 0                  // Default upload bytes
	MODEL_MIN_UPLOAD_BYTES        = 0                  // Minimum size of a model
	MODEL_MAX_UPLOAD_BYTES uint64 = 1024 * 1024 * 1024 // Maximum size of a model
	MODEL_GAS_LIMIT        uint64 = 20000              // Max gas limit for a model inference's reward to the author
	MODEL_GAS_UP_LIMIT     uint64 = 400000

	BLOCK_QUOTA         = 65536       // Upon the generation of a new valid block, 64kB file quota is added to the network. Empty blocks also count.
	Bernard_BLOCK_QUOTA = 65536       // for bernard
	Dolores_BLOCK_QUOTA = 65536 * 128 // for dolores
)
View Source
const (
	VersionMajor = 1        // Major version component of the current release
	VersionMinor = 9        // Minor version component of the current release
	VersionPatch = 55       // Patch version component of the current release
	VersionMeta  = "stable" // Version metadata to append to the version string
)

Variables

View Source
var (
	MainnetGenesisHash = common.HexToHash("0x21d6ce908e2d1464bd74bbdbf7249845493cc1ba10460758169b978e187762c1")
	BernardGenesisHash = common.HexToHash("0x89df382cf5508d366755f5f00c16666759a3267c1c244a6524bada1901237cd3")
	DoloresGenesisHash = common.HexToHash("0xe39f1aace1c91078c97e743bd6b7a692ac215e6f9124599cdcabf0a8c7dfeae5")
)

Genesis hashes to enforce below configs on.

View Source
var (
	CortexBlockRewardPeriod  = big.NewInt(8409600) // Halving every four years: 365 days*24 hours*60 minutes*4 blocks*4 years=8409600
	BernardBlockRewardPeriod = big.NewInt(8409600) // TESTING: for testnet Bernard
	DoloresBlockRewardPeriod = big.NewInt(1000000) // TESTING: for testnet Dolores
)
View Source
var (
	MainnetTrustedCheckpoint = &TrustedCheckpoint{
		Name:          "mainnet",
		SectionIndex:  45,
		SectionHead:   common.HexToHash("0xfdd213598bb6b203ce72730768083a3184f5cd6e3864a1e07e448e5081a029df"),
		TfsBlocks:     96,
		TfsFiles:      46,
		TfsCheckPoint: 395964,
		TfsRoot:       common.HexToHash("0xb07f9a8a8300db4a82da72d3d024fb86bae3742d24a91a7160d2838a13e2520a"),
	}
	//0x78c5f644c046fb0ea544b50a898ca5d2a926c419863853ac8ba22c10fc380fd6
	DoloresTrustedCheckpoint = &TrustedCheckpoint{
		Name:         "dolores",
		SectionIndex: 1,
		SectionHead:  common.HexToHash("0xb7b7f06c6cc9dc5fe3b8a673fa3e18ef7bcbce033fa54051a4fb37d8fdb87d6c"),
	}

	BernardTrustedCheckpoint = &TrustedCheckpoint{
		Name: "bernard",
	}

	MainnetCheckpointOracle = &CheckpointOracleConfig{
		Address:   common.HexToAddress("0x9a9070028361F7AAbeB3f2F2Dc07F82C4a98A02a"),
		Signers:   []common.Address{},
		Threshold: 2,
	}
	// MainnetChainConfig is the chain parameters to run a node on the main network.
	MainnetChainConfig = &ChainConfig{
		ChainID:        big.NewInt(21),
		HomesteadBlock: big.NewInt(0),
		DAOForkBlock:   big.NewInt(0),
		DAOForkSupport: false,
		EIP150Block:    big.NewInt(0),
		EIP150Hash:     common.HexToHash("0x"),
		EIP155Block:    big.NewInt(0),
		EIP158Block:    big.NewInt(0),
		ByzantiumBlock: big.NewInt(0),

		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       nil,
		Cuckoo:              new(CuckooConfig),
	}

	// TestnetChainConfig contains the chain parameters to run a node on the Bernard test network.
	BernardChainConfig = &ChainConfig{
		ChainID:             big.NewInt(42),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        big.NewInt(0),
		DAOForkSupport:      false,
		EIP150Block:         big.NewInt(0),
		EIP150Hash:          common.HexToHash("0x"),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		Cuckoo:              new(CuckooConfig),
	}

	// TestnetChainConfig contains the chain parameters to run a node on the Dolores test network.
	DoloresChainConfig = &ChainConfig{
		ChainID:             big.NewInt(43),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        big.NewInt(0),
		DAOForkSupport:      false,
		EIP150Block:         big.NewInt(0),
		EIP150Hash:          common.HexToHash("0x"),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       nil,
		Cuckoo:              new(CuckooConfig),
	}

	// AllCuckooProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Cortex core developers into the Cuckoo consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllCuckooProtocolChanges = &ChainConfig{
		ChainID: big.NewInt(1337),

		DAOForkSupport: false,

		ByzantiumBlock:      nil,
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       nil,
		EWASMBlock:          nil,
		Cuckoo:              new(CuckooConfig),
		Clique:              nil}

	TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, new(CuckooConfig), nil}
	TestRules       = TestChainConfig.Rules(new(big.Int))
)
View Source
var (
	// GasTableHomestead contain the gas prices for
	// the homestead phase.
	GasTableHomestead = GasTable{
		ExtcodeSize: 20,
		ExtcodeCopy: 20,
		Balance:     20,
		SLoad:       50,
		Calls:       40,
		Suicide:     0,
		ExpByte:     10,
	}

	// GasTableEIP150 contain the gas re-prices for
	// the EIP150 phase.
	GasTableEIP150 = GasTable{
		ExtcodeSize: 700,
		ExtcodeCopy: 700,
		Balance:     400,
		SLoad:       200,
		Calls:       700,
		Suicide:     5000,
		ExpByte:     10,

		CreateBySuicide: 25000,
	}
	// GasTableEIP158 contain the gas re-prices for
	// the EIP155/EIP158 phase.
	GasTableEIP158 = GasTable{
		ExtcodeSize: 700,
		ExtcodeCopy: 700,
		Balance:     400,
		SLoad:       200,
		Calls:       700,
		Suicide:     5000,
		ExpByte:     50,

		CreateBySuicide: 25000,
	}
	// GasTableConstantinople contain the gas re-prices for
	// the constantinople phase.
	GasTableConstantinople = GasTable{
		ExtcodeSize: 700,
		ExtcodeCopy: 700,
		ExtcodeHash: 400,
		Balance:     400,
		SLoad:       200,
		Calls:       700,
		Suicide:     5000,
		ExpByte:     50,

		CreateBySuicide: 25000,
	}
)

Variables containing gas prices for different cortex phases.

View Source
var (
	DifficultyBoundDivisor = big.NewInt(2)   // The bound divisor of the difficulty, used in the update calculations.
	GenesisDifficulty      = big.NewInt(512) // Difficulty of the Genesis block.
	MinimumDifficulty      = big.NewInt(2)   // The minimum that the difficulty may ever be.

	MeanDifficultyBoundDivisor = big.NewInt(1024)

	HighDifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.

	DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.

	// For Mainnet
	// |CTXC_TOP|:    Total Amount of Cortex Coin(CTXC) is lightspeed in vacuum: 299792458 m/s
	CTXC_TOP = big.NewInt(0).Mul(big.NewInt(299792458), big.NewInt(1000000000000000000))
	// |CTXC_INIT|:   For Pre-Allocated CTXCs before Mainnet launch
	CTXC_INIT = big.NewInt(0).Mul(big.NewInt(149792458), big.NewInt(1000000000000000000))
	// |CTXC_MINING|: For mining
	CTXC_MINING = big.NewInt(0).Mul(big.NewInt(150000000), big.NewInt(1000000000000000000))
)
View Source
var BernardBootnodes = []string{

	"enode://72f70e8e77f68f5526d730f1003e04caa0995eb5c8fb66644da72b23656dc8c16075b0f740d687a3c2aa9d0db1337bf826715c69ae2adb64dc106d3d4165fd79@47.91.91.217:37566",
	"enode://c5780febab5e5a7bd6387a20a2662df3f1b16a10d93931a40a147e0f6cfd89a576c2e2f758e0e886c3f91a1bc43b3c7fa01af0c8b8ce39c8004c048ca880bccf@47.74.1.234:37566",
	"enode://9b3b10d4223e010b01411a252312fb69da63b88fd610c07adb5bfa941a8598009a4bb2deeac42c41498acbdaec2196e2cc1fe746286c46f0b5c47d42c5c777b3@47.88.7.24:37566",
}

TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the Bernard test network.

View Source
var BernardTrackers = MainnetTrackers //[]string{
View Source
var KnownDNSNetworks = map[common.Hash]string{

	MainnetGenesisHash: dnsPrefix + "all.mainnet.coinbag.org",
}
View Source
var MainnetBootnodes = []string{
	"enode://72f70e8e77f68f5526d730f1003e04caa0995eb5c8fb66644da72b23656dc8c16075b0f740d687a3c2aa9d0db1337bf826715c69ae2adb64dc106d3d4165fd79@47.91.91.217:37566",
	"enode://c5780febab5e5a7bd6387a20a2662df3f1b16a10d93931a40a147e0f6cfd89a576c2e2f758e0e886c3f91a1bc43b3c7fa01af0c8b8ce39c8004c048ca880bccf@47.74.1.234:37566",
	"enode://9b3b10d4223e010b01411a252312fb69da63b88fd610c07adb5bfa941a8598009a4bb2deeac42c41498acbdaec2196e2cc1fe746286c46f0b5c47d42c5c777b3@47.88.7.24:37566",
	"enode://8a379f3aa5d6b35ea9b594252f092f416ea583f3d2fbf7494db2fcfffc91fda9fdd38b34c2e6b6ff003d03ecf67c67326388a53b953361307daf956902c2187f@47.91.43.70:37566",
	"enode://6c284d3f0bcbbce419ebdee0510c3cd07207edf1d70de3a3e75c5bcb66c84c56d5eec7caec191770173a9a995d3592469cb9052ef65e2da775136006a9ff9c79@47.91.106.117:37566",
	"enode://838b42c2f6532750c36ac346f66109ac8d904a7e4271a1e999d0909f6563591cfa796cc00af77b7d8bdf8643507cb7afe71a8da7e7c4d66a1a93018eee88f6f7@47.91.147.37:37566",
	"enode://3bba372ec3d25442c20031064bfabb472ab7dae72d447860388797336dc35f6012c7ced2f2946508a0297d0237c7dc42d41c88e7d7ca7a82a288fa46299bda88@47.89.178.175:37566",
	"enode://cba70f4f25fa9ab33d3a92e1e5350d4e821775fc015223c77487bbe05976c7d9ec0da7f778e97ecfde208cce28e4ca7ab22b131df87419809d44ef317efc8a90@47.88.214.96:37566",
}

MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main Cortex network.

View Source
var MainnetTrackers = []string{
	"://dht.cortexlabs.ai:5008",
	"://tracker.cortexlabs.ai:5008",
}
View Source
var TorrentBoostNodes = []string{
	"http://storage.cortexlabs.ai:7881",
}

It should be empty for first time

View Source
var Version = func() string {
	return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch)
}()

Version holds the textual version string.

View Source
var VersionWithMeta = func() string {
	v := Version
	if VersionMeta != "" {
		v += "-" + VersionMeta
	}
	return v
}()

VersionWithMeta holds the textual version string including the metadata.

Functions

func ArchiveVersion

func ArchiveVersion(gitCommit string) string

ArchiveVersion holds the textual version string used for Ctxc archives. e.g. "1.8.11-dea1ce05" for stable releases, or

"1.8.13-unstable-21c059b6" for unstable releases

func VersionWithCommit

func VersionWithCommit(gitCommit, gitDate string) string

Types

type ChainConfig

type ChainConfig struct {
	ChainID *big.Int `json:"chainId"` // chainId identifies the current chain and is used for replay protection

	HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead)

	DAOForkBlock   *big.Int `json:"daoForkBlock,omitempty"`   // TheDAO hard-fork switch block (nil = no fork)
	DAOForkSupport bool     `json:"daoForkSupport,omitempty"` // Whether the nodes supports or opposes the DAO hard-fork

	// EIP150 implements the Gas price changes (https://github.com/cortex/EIPs/issues/150)
	EIP150Block *big.Int    `json:"eip150Block,omitempty"` // EIP150 HF block (nil = no fork)
	EIP150Hash  common.Hash `json:"eip150Hash,omitempty"`  // EIP150 HF hash (needed for header only clients as only gas pricing changed)

	EIP155Block *big.Int `json:"eip155Block,omitempty"` // EIP155 HF block
	EIP158Block *big.Int `json:"eip158Block,omitempty"` // EIP158 HF block

	ByzantiumBlock      *big.Int `json:"byzantiumBlock,omitempty"`      // Byzantium switch block (nil = no fork, 0 = already on byzantium)
	ConstantinopleBlock *big.Int `json:"constantinopleBlock,omitempty"` // Constantinople switch block (nil = no fork, 0 = already activated)
	PetersburgBlock     *big.Int `json:"petersburgBlock,omitempty"`     // Petersburg switch block (nil = same as Constantinople)
	IstanbulBlock       *big.Int `json:"istanbulBlock,omitempty"`       // Istanbul switch block (nil = no fork, 0 = already on istanbul)
	EWASMBlock          *big.Int `json:"ewasmBlock,omitempty"`          // EWASM switch block (nil = no fork, 0 = already activated)
	// Various consensus engines
	Cuckoo *CuckooConfig `json:"cuckoo,omitempty"`
	Clique *CliqueConfig `json:"clique,omitempty"`
}

ChainConfig is the core config which determines the blockchain settings.

ChainConfig is stored in the database on a per block basis. This means that any network, identified by its genesis block, can have its own set of configuration options.

func (*ChainConfig) CheckCompatible

func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError

CheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.

func (*ChainConfig) CheckConfigForkOrder added in v1.9.51

func (c *ChainConfig) CheckConfigForkOrder() error

to guarantee that forks can be implemented in a different order than on official networks

func (*ChainConfig) GasTable

func (c *ChainConfig) GasTable(num *big.Int) GasTable

GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).

The returned GasTable's fields shouldn't, under any circumstances, be changed.

func (*ChainConfig) GetBlockQuota added in v1.9.51

func (c *ChainConfig) GetBlockQuota(num *big.Int) uint64

Get Block uploading quota

func (*ChainConfig) GetMatureBlock added in v1.0.0

func (c *ChainConfig) GetMatureBlock() int64

Get Mature Block

func (*ChainConfig) IsByzantium

func (c *ChainConfig) IsByzantium(num *big.Int) bool

IsByzantium returns whether num is either equal to the Byzantium fork block or greater.

func (*ChainConfig) IsConstantinople

func (c *ChainConfig) IsConstantinople(num *big.Int) bool

IsConstantinople returns whether num is either equal to the Constantinople fork block or greater.

func (*ChainConfig) IsDAOFork

func (c *ChainConfig) IsDAOFork(num *big.Int) bool

IsDAOFork returns whether num is either equal to the DAO fork block or greater.

func (*ChainConfig) IsEIP150

func (c *ChainConfig) IsEIP150(num *big.Int) bool

IsEIP150 returns whether num is either equal to the EIP150 fork block or greater.

func (*ChainConfig) IsEIP155

func (c *ChainConfig) IsEIP155(num *big.Int) bool

IsEIP155 returns whether num is either equal to the EIP155 fork block or greater.

func (*ChainConfig) IsEIP158

func (c *ChainConfig) IsEIP158(num *big.Int) bool

IsEIP158 returns whether num is either equal to the EIP158 fork block or greater.

func (*ChainConfig) IsEWASM added in v1.0.0

func (c *ChainConfig) IsEWASM(num *big.Int) bool

IsEWASM returns whether num represents a block number after the EWASM fork

func (*ChainConfig) IsHomestead

func (c *ChainConfig) IsHomestead(num *big.Int) bool

IsHomestead returns whether num is either equal to the homestead block or greater.

func (*ChainConfig) IsIstanbul added in v1.9.51

func (c *ChainConfig) IsIstanbul(num *big.Int) bool

func (*ChainConfig) IsPetersburg added in v1.0.0

func (c *ChainConfig) IsPetersburg(num *big.Int) bool

IsPetersburg returns whether num is either - equal to or greater than the PetersburgBlock fork block, - OR is nil, and Constantinople is active

func (*ChainConfig) Rules

func (c *ChainConfig) Rules(num *big.Int) Rules

Rules ensures c's ChainID is not nil.

func (*ChainConfig) String

func (c *ChainConfig) String() string

String implements the fmt.Stringer interface.

type CheckpointOracleConfig added in v1.9.51

type CheckpointOracleConfig struct {
	Address   common.Address   `json:"address"`
	Signers   []common.Address `json:"signers"`
	Threshold uint64           `json:"threshold"`
}

type CliqueConfig

type CliqueConfig struct {
	Period uint64 `json:"period"` // Number of seconds between blocks to enforce
	Epoch  uint64 `json:"epoch"`  // Epoch length to reset votes and checkpoint
}

CliqueConfig is the consensus engine configs for proof-of-authority based sealing.

func (*CliqueConfig) String

func (c *CliqueConfig) String() string

String implements the stringer interface, returning the consensus engine details.

type ConfigCompatError

type ConfigCompatError struct {
	What string
	// block numbers of the stored and new configurations
	StoredConfig, NewConfig *big.Int
	// the block number to which the local chain must be rewound to correct the error
	RewindTo uint64
}

ConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.

func (*ConfigCompatError) Error

func (err *ConfigCompatError) Error() string

type CuckooConfig added in v1.0.0

type CuckooConfig struct{}

func (*CuckooConfig) String added in v1.0.0

func (c *CuckooConfig) String() string

String implements the stringer interface, returning the consensus engine details.

type GasTable

type GasTable struct {
	ExtcodeSize uint64
	ExtcodeCopy uint64
	ExtcodeHash uint64
	Balance     uint64
	SLoad       uint64
	Calls       uint64
	Suicide     uint64

	ExpByte uint64

	// CreateBySuicide occurs when the
	// refunded account is one that does
	// not exist. This logic is similar
	// to call. May be left nil. Nil means
	// not charged.
	CreateBySuicide uint64
}

GasTable organizes gas prices for different cortex phases.

type Rules

type Rules struct {
	ChainID                                                 *big.Int
	IsHomestead, IsEIP150, IsEIP155, IsEIP158               bool
	IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
}

Rules wraps ChainConfig and is merely syntactic sugar or can be used for functions that do not have or require information about the block.

Rules is a one time interface meaning that it shouldn't be used in between transition phases.

type TrustedCheckpoint added in v1.0.0

type TrustedCheckpoint struct {
	Name          string      `json:"-"`
	SectionIndex  uint64      `json:"sectionIndex"`
	SectionHead   common.Hash `json:"sectionHead"`
	TfsBlocks     uint64      `json:"tfsBlocks"`
	TfsCheckPoint uint64      `json:"tfsCheckPoint"`
	TfsFiles      uint64      `json:"tfsFiles"`
	TfsRoot       common.Hash `json:"tfsRoot"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL