params

package
v1.10.30 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: GPL-3.0, GPL-3.0 Imports: 5 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 (
	// 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:100 3309567
		Check section:101 3342335
		Check section:102 3375103
		Check section:103 3407871
		Check section:104 3440639
		Check section:105 3473407
		Check section:106 3506175
		Check section:107 3538943
		Check section:108 3571711
		Check section:109 3604479
		Check section:110 3637247
		Check section:111 3670015
		Check section:112 3702783
		Check section:113 3735551
		Check section:114 3768319
		Check section:115 3801087
		Check section:116 3833855
		Check section:117 3866623
		Check section:118 3899391
		Check section:119 3932159
		Check section:120 3964927
		Check section:121 3997695
		Check section:122 4030463
		Check section:123 4063231
		Check section:124 4095999
		Check section:125 4128767
		Check section:126 4161535
		Check section:127 4194303
		Check section:128 4227071
		Check section:129 4259839
		Check section:130 4292607
		Check section:131 4325375
		Check section:132 4358143
		Check section:133 4390911
		Check section:134 4423679
		Check section:135 4456447
		Check section:136 4489215
		Check section:137 4521983
		Check section:138 4554751
		Check section:139 4587519
		Check section:140 4620287
		Check section:141 4653055
		Check section:142 4685823
		Check section:143 4718591
		Check section:144 4751359
		Check section:145 4784127
		Check section:146 4816895
		Check section:147 4849663
		Check section:148 4882431
		Check section:149 4915199
		Check section:150 4947967
		Check section:151 4980735
		Check section:152 5013503
		Check section:153 5046271
		Check section:154 5079039
		Check section:155 5111807
		Check section:156 5144575
		Check section:157 5177343
		Check section:158 5210111
		Check section:159 5242879
		Check section:160 5275647
		Check section:161 5308415
		Check section:162 5341183
		Check section:163 5373951
		Check section:164 5406719
		Check section:165 5439487
		Check section:166 5472255
		Check section:167 5505023
		Check section:168 5537791
		Check section:169 5570559
		Check section:170 5603327
		Check section:171 5636095
		Check section:172 5668863
		Check section:173 5701631
		Check section:174 5734399
		Check section:175 5767167
		Check section:176 5799935
		Check section:177 5832703
		Check section:178 5865471
		Check section:179 5898239
		Check section:180 5931007
		Check section:181 5963775
		Check section:182 5996543
		Check section:183 6029311
		Check section:184 6062079
		Check section:185 6094847
		Check section:186 6127615
		Check section:187 6160383
		Check section:188 6193151
		Check section:189 6225919
		Check section:190 6258687
		Check section:191 6291455
		Check section:192 6324223
		Check section:193 6356991
		Check section:194 6389759
		Check section:195 6422527
		Check section:196 6455295
		Check section:197 6488063

	*/
	ImmutabilityThreshold     = 90000
	FullImmutabilityThreshold = 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
	SstoreSetGasEIP2200               uint64 = 20000 // Once per SSTORE operation from clean zero to non-zero
	SstoreResetGasEIP2200             uint64 = 5000  // Once per SSTORE operation from clean non-zero to something else
	SstoreClearsScheduleRefundEIP2200 uint64 = 15000 // Once per SSTORE operation for clearing an originally existing storage slot

	ColdAccountAccessCostEIP2929 = uint64(2600) // COLD_ACCOUNT_ACCESS_COST
	ColdSloadCostEIP2929         = uint64(2100) // COLD_SLOAD_COST
	WarmStorageReadCostEIP2929   = uint64(100)  // WARM_STORAGE_READ_COST

	// In EIP-2200: SstoreResetGas was 5000.
	// In EIP-2929: SstoreResetGas was changed to '5000 - COLD_SLOAD_COST'.
	// In EIP-3529: SSTORE_CLEARS_SCHEDULE is defined as SSTORE_RESET_GAS + ACCESS_LIST_STORAGE_KEY_COST
	// Which becomes: 5000 - 2100 + 1900 = 4800
	SstoreClearsScheduleRefundEIP3529 uint64 = SstoreResetGasEIP2200 - ColdSloadCostEIP2929 + TxAccessListStorageKeyGas

	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)
	TxAccessListAddressGas    uint64 = 2400  // Per address specified in EIP 2930 access list
	TxAccessListStorageKeyGas uint64 = 1900  // Per storage key specified in EIP 2930 access list

	// 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

	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

	Bls12381G1AddGas          uint64 = 600    // Price for BLS12-381 elliptic curve G1 point addition
	Bls12381G1MulGas          uint64 = 12000  // Price for BLS12-381 elliptic curve G1 point scalar multiplication
	Bls12381G2AddGas          uint64 = 4500   // Price for BLS12-381 elliptic curve G2 point addition
	Bls12381G2MulGas          uint64 = 55000  // Price for BLS12-381 elliptic curve G2 point scalar multiplication
	Bls12381PairingBaseGas    uint64 = 115000 // Base gas price for BLS12-381 elliptic curve pairing check
	Bls12381PairingPerPairGas uint64 = 23000  // Per-point pair gas price for BLS12-381 elliptic curve pairing check
	Bls12381MapG1Gas          uint64 = 5500   // Gas price for BLS12-381 mapping field element to G1 operation
	Bls12381MapG2Gas          uint64 = 110000 // Gas price for BLS12-381 mapping field element to G2 operation
)
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 (
	SPROUT_TIME       = int64(180)
	HEAVY_CHAIN_LIMIT = 256
)
View Source
const (
	VersionMajor = 1        // Major version component of the current release
	VersionMinor = 10       // Minor version component of the current release
	VersionPatch = 30       // 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("0xe02ba89c73d107104af1ec647c8308968b52223e0bcefd9bbd7442b6e15b0b1b")
	DoloresGenesisHash = common.HexToHash("0xe39f1aace1c91078c97e743bd6b7a692ac215e6f9124599cdcabf0a8c7dfeae5")
)

Genesis hashes to enforce below configs on.

View Source
var (
	CortexBlockRewardPeriod  = big.NewInt(8_409_600) // Halving every four years: 365 days*24 hours*60 minutes*4 blocks*4 years=8409600
	BernardBlockRewardPeriod = big.NewInt(8_409_600) // TESTING: for testnet Bernard
	DoloresBlockRewardPeriod = big.NewInt(1_000_000) // TESTING: for testnet Dolores
)
View Source
var (
	MainnetTrustedCheckpoint = &TrustedCheckpoint{
		Name:         "mainnet",
		SectionIndex: 156,
		SectionHead:  common.HexToHash("0x227ccb373396dbbf6e336b5f8468da37051cf8dfbf28cca4149510d5e5233b65"),
	}

	DoloresTrustedCheckpoint = &TrustedCheckpoint{
		Name: "dolores",
	}

	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:       big.NewInt(3_230_000),
		NeoBlock:            big.NewInt(4_650_000),
		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),
		NeoBlock:            big.NewInt(5_000_000),
		Clique: &CliqueConfig{
			Period: 3,
			Epoch:  30000,
		},
	}

	// 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:       big.NewInt(0),
		NeoBlock:            big.NewInt(0),
		Cuckoo:              new(CuckooConfig),
	}

	// TestnetChainConfig contains the chain parameters to run a node on the flood test network.
	FloodChainConfig = &ChainConfig{
		ChainID:             big.NewInt(44),
		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),
		NeoBlock:            big.NewInt(0),
		Clique: &CliqueConfig{
			Period: 15,
			Epoch:  30000,
		},
	}

	// 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),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        nil,
		DAOForkSupport:      false,
		EIP150Block:         big.NewInt(0),
		EIP150Hash:          common.Hash{},
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      nil,
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       nil,
		NeoBlock:            nil,
		Cuckoo:              new(CuckooConfig),
		Clique:              nil}

	// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
	// and accepted by the Cortex core developers into the Clique consensus.
	//
	// This configuration is intentionally not using keyed fields to force anyone
	// adding flags to the config to also have to set these fields.
	AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), 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, nil, &CliqueConfig{Period: 0, Epoch: 30000}}

	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_2   = big.NewInt(2) // The bound divisor of the difficulty, used in the update calculations.
	DifficultyBoundDivisor_256 = big.NewInt(256)
	DifficultyBoundDivisor_512 = big.NewInt(512)

	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(299_792_458), big.NewInt(1000000000000000000))
	// |CTXC_INIT|:   For Pre-Allocated CTXCs before Mainnet launch
	CTXC_INIT = big.NewInt(0).Mul(big.NewInt(149_792_458), big.NewInt(1000000000000000000))
	// |CTXC_MINING|: For mining
	CTXC_MINING = big.NewInt(0).Mul(big.NewInt(150_000_000), big.NewInt(1000000000000000000))

	CTXC_F1 = big.NewInt(0).Mul(big.NewInt(20_486_540), big.NewInt(1000000000000000000))
	CTXC_F2 = big.NewInt(0).Mul(big.NewInt(21_285_544), big.NewInt(1000000000000000000))
)
View Source
var BernardBootnodes = []string{
	"enode://cba70f4f25fa9ab33d3a92e1e5350d4e821775fc015223c77487bbe05976c7d9ec0da7f778e97ecfde208cce28e4ca7ab22b131df87419809d44ef317efc8a90@47.88.214.96:37566",
}

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

View Source
var Bls12381MultiExpDiscountTable = [128]uint64{} /* 128 elements not displayed */

Gas discount table for BLS12-381 G1 and G2 multi exponentiation operations

View Source
var DoloresBootnodes = []string{
	"enode://3bba372ec3d25442c20031064bfabb472ab7dae72d447860388797336dc35f6012c7ced2f2946508a0297d0237c7dc42d41c88e7d7ca7a82a288fa46299bda88@47.89.178.175:37566",
}
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://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.

It should be empty for first time

View Source
var V5Bootnodes = []string{
	"enode://838b42c2f6532750c36ac346f66109ac8d904a7e4271a1e999d0909f6563591cfa796cc00af77b7d8bdf8643507cb7afe71a8da7e7c4d66a1a93018eee88f6f7@47.91.147.37:37566",
}
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 KnownDNSNetwork added in v1.10.0

func KnownDNSNetwork(genesis common.Hash, protocol string) string

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)
	NeoBlock            *big.Int `json:"neoBlock,omitempty"`
	// 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) 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) IsNeo added in v1.10.27

func (c *ChainConfig) IsNeo(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, IsNeo 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"`
}

func (*TrustedCheckpoint) Empty added in v1.10.23

func (c *TrustedCheckpoint) Empty() bool

Empty returns an indicator whether the checkpoint is regarded as empty.

func (*TrustedCheckpoint) Hash added in v1.10.23

func (c *TrustedCheckpoint) Hash() common.Hash

Hash returns the hash of checkpoint's four key fields(index, sectionHead, chtRoot and bloomTrieRoot).

func (*TrustedCheckpoint) HashEqual added in v1.10.23

func (c *TrustedCheckpoint) HashEqual(hash common.Hash) bool

HashEqual returns an indicator comparing the itself hash with given one.

Jump to

Keyboard shortcuts

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