params

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FractionMulExpGas           uint64 = 50     // Cost of performing multiplication and exponentiation of fractions to an exponent of up to 10^3.
	ProofOfPossessionGas        uint64 = 350000 // Cost of verifying a BLS proof of possession.
	GetValidatorGas             uint64 = 1000   // Cost of reading a validator's address.
	GetValidatorBLSGas          uint64 = 1000   // Cost of reading a validator's BLS public key.
	GetEpochSizeGas             uint64 = 10     // Cost of querying the number of blocks in an epoch.
	GetBlockNumberFromHeaderGas uint64 = 10     // Cost of decoding a block header.
	HashHeaderGas               uint64 = 10     // Cost of hashing a block header.
	GetParentSealBitmapGas      uint64 = 100    // Cost of reading the parent seal bitmap from the chain.
	// May take a bit more time with 100 validators, need to bench that
	GetVerifiedSealBitmapGas uint64 = 350000           // Cost of verifying the seal on a given RLP encoded header.
	Ed25519VerifyGas         uint64 = 1500             // Gas needed for and Ed25519 signature verification
	Sha2_512BaseGas          uint64 = Sha256BaseGas    // Base price for a Sha2-512 operation
	Sha2_512PerWordGas       uint64 = Sha256PerWordGas // Per-word price for a Sha2-512 operation

	Sha3_256BaseGas     uint64 = Sha3Gas     // Base price for a Sha3-256 operation
	Sha3_256PerWordGas  uint64 = Sha3WordGas // Per-word price for a sha3-256 operation
	Sha3_512BaseGas     uint64 = Sha3Gas     // Base price for a Sha3-512 operation
	Sha3_512PerWordGas  uint64 = Sha3WordGas // Per-word price for a Sha3-512 operation
	Keccak512BaseGas    uint64 = Sha3Gas     // Per-word price for a Keccak512 operation
	Keccak512PerWordGas uint64 = Sha3WordGas // Base price for a Keccak512 operation

	Blake2sBaseGas    uint64 = Sha256BaseGas    // Per-word price for a Blake2s operation
	Blake2sPerWordGas uint64 = Sha256PerWordGas // Base price for a Blake2s
	InvalidCip20Gas   uint64 = 200              // Price of attempting to access an unsupported CIP20 hash function

	Bls12377G1AddGas          uint64 = 600   // Price for BLS12-377 elliptic curve G1 point addition
	Bls12377G1MulGas          uint64 = 12000 // Price for BLS12-377 elliptic curve G1 point scalar multiplication
	Bls12377G2AddGas          uint64 = 4500  // Price for BLS12-377 elliptic curve G2 point addition
	Bls12377G2MulGas          uint64 = 55000 // Price for BLS12-377 elliptic curve G2 point scalar multiplication
	Bls12377PairingBaseGas    uint64 = 65000 // Base gas price for BLS12-377 elliptic curve pairing check
	Bls12377PairingPerPairGas uint64 = 55000 // Per-point pair gas price for BLS12-377 elliptic curve pairing check

	// ColdAccountAccessCostEIP2929 (2600 -> 900), ColdSloadCostEIP2929 (2100 -> 800) are modified according to CIP-0048
	// Links: https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0048.md
	CeloColdAccountAccessCostEIP2929 = uint64(900) // COLD_ACCOUNT_ACCESS_COST
	CeloColdSloadCostEIP2929         = uint64(800) // COLD_SLOAD_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 (ethereum)
	// Which becomes: 5000 - 800 + 1900 = 6100 (celo)
	CeloSstoreClearsScheduleRefundEIP3529 uint64 = SstoreResetGasEIP2200 - CeloColdSloadCostEIP2929 + TxAccessListStorageKeyGas
)

Celo precompiled contracts

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

These are the multipliers for ether 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

	// BloomBitsBlocksClient is the number of blocks a single bloom bit section vector
	// contains on the light client side
	BloomBitsBlocksClient uint64 = 32768

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

	// CHTFrequency is the block frequency for creating CHTs
	CHTFrequency = 32768

	// BloomTrieFrequency is the block frequency for creating BloomTrie on both
	// server/client sides.
	BloomTrieFrequency = 32768

	// HelperTrieConfirmations is the number of confirmations before a client is expected
	// to have the given HelperTrie available.
	HelperTrieConfirmations = 2048

	// HelperTrieProcessConfirmations is the number of confirmations before a HelperTrie
	// is generated
	HelperTrieProcessConfirmations = 256

	// CheckpointFrequency is the block frequency for creating checkpoint
	CheckpointFrequency = 32768

	// CheckpointProcessConfirmations is the number before a checkpoint is generated
	CheckpointProcessConfirmations = 256

	// FullImmutabilityThreshold is the number of blocks after which a chain segment is
	// considered immutable (i.e. soft finality). It is used by the downloader as a
	// hard limit against deep ancestors, by the blockchain against deep reorgs, by
	// the freezer as the cutoff threshold and by clique as the snapshot trust limit.
	FullImmutabilityThreshold = 90000

	// LightImmutabilityThreshold is the number of blocks after which a header chain
	// segment is considered immutable for light client(i.e. soft finality). It is used by
	// the downloader as a hard limit against deep ancestors, by the blockchain against deep
	// reorgs, by the light pruner as the pruning validity guarantee.
	LightImmutabilityThreshold = 30000
)
View Source
const (
	// GasLimitBoundDivisor uint64 = 1024    // The bound divisor of the gas limit, used in update calculations.
	// MinGasLimit          uint64 = 5000    // Minimum the gas limit may ever be.
	GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block.

	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.
	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.
	LogDataGas            uint64 = 8     // Per byte in a LOG* operation's data.
	CallStipend           uint64 = 2300  // Free gas given at beginning of call.

	Sha3Gas     uint64 = 30 // Once per SHA3 operation.
	Sha3WordGas uint64 = 6  // Once per word of the SHA3 operation's data.

	SstoreSetGas    uint64 = 20000 // Once per SSTORE operation.
	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     // Once per JUMPDEST operation.
	EpochDuration uint64 = 30000 // Duration between proof-of-work epochs.

	CreateDataGas         uint64 = 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.
	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

	BaseFeeChangeDenominator = 8          // Bounds the amount the base fee can change between blocks.
	ElasticityMultiplier     = 2          // Bounds the maximum gas limit an EIP-1559 block may have.
	InitialBaseFee           = 1000000000 // Initial base fee for EIP-1559 blocks.

	MaxCodeSize              = 65536           // Maximum bytecode to permit for a contract (2^16)
	MaxTxDataPerBlock uint64 = 1024 * 1024 * 5 // Maximum size of all the rlp encoded transactions of a block (5mb) [Gingerbread]

	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 = 800   // Price for BLS12-381 elliptic curve G2 point addition
	Bls12381G2MulGas          uint64 = 45000 // Price for BLS12-381 elliptic curve G2 point scalar multiplication
	Bls12381PairingBaseGas    uint64 = 65000 // Base gas price for BLS12-381 elliptic curve pairing check
	Bls12381PairingPerPairGas uint64 = 43000 // 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 = 75000 // Gas price for BLS12-381 mapping field element to G2 operation
	// The Refund Quotient is the cap on how much of the used gas can be refunded. Before EIP-3529,
	// up to half the consumed gas could be refunded. Redefined as 1/5th in EIP-3529
	RefundQuotient        uint64 = 2
	RefundQuotientEIP3529 uint64 = 5
)
View Source
const (
	VersionMajor = 1        // Major version component of the current release
	VersionMinor = 8        // Minor version component of the current release
	VersionPatch = 4        // Patch version component of the current release
	VersionMeta  = "stable" // Version metadata to append to the version string
)

On master, the version should be the UPCOMING one and "unstable" e.g. if the latest release was v1.3.2, master should be 1.4.0-unstable On release branches, it should be a beta or stable. For example: "1.3.0-beta", "1.3.0-beta.2", etc. and then "1.3.0-stable", "1.3.1-stable", etc.

View Source
const (
	DefaultGasLimit uint64 = 20000000 // Gas limit of the blocks before BlockchainParams contract is loaded.
)

Variables

View Source
var (
	MainnetGenesisHash   = common.HexToHash("0x19ea3339d3c8cda97235bc8293240d5b9dadcdfbb5d4b0b90ee731cac1bd11c3")
	AlfajoresGenesisHash = common.HexToHash("0xe423b034e7f0282c1b621f7bbc1cea4316a2a80b1600490769eae77777e4b67e")
	BaklavaGenesisHash   = common.HexToHash("0xbd1db1803638c0c151cdd10179c0117fedfffa4a3f0f88a8334708a4ea1a5fda")
)

Genesis hashes to enforce below configs on.

View Source
var (
	MainnetNetworkId   = uint64(42220)
	BaklavaNetworkId   = uint64(62320)
	AlfajoresNetworkId = uint64(44787)
)
View Source
var (
	// MainnetChainConfig is the chain parameters to run a node on the main network.
	MainnetChainConfig = &ChainConfig{
		ChainID:             big.NewInt(int64(MainnetNetworkId)),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        nil,
		DAOForkSupport:      true,
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		ChurritoBlock:       big.NewInt(6774000),
		DonutBlock:          big.NewInt(6774000),
		EspressoBlock:       big.NewInt(11838440),
		GingerbreadBlock:    big.NewInt(21616000),
		GingerbreadP2Block:  big.NewInt(21616000),
		Istanbul: &IstanbulConfig{
			Epoch:          17280,
			ProposerPolicy: 2,
			BlockPeriod:    5,
			RequestTimeout: 3000,
			LookbackWindow: 12,
		},
	}

	// BaklavaChainConfig contains the chain parameters to run a node on the Baklava test network.
	BaklavaChainConfig = &ChainConfig{
		ChainID:             big.NewInt(int64(BaklavaNetworkId)),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        nil,
		DAOForkSupport:      true,
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		ChurritoBlock:       big.NewInt(2719099),
		DonutBlock:          big.NewInt(5002000),
		EspressoBlock:       big.NewInt(9195000),
		GingerbreadBlock:    big.NewInt(18785000),
		GingerbreadP2Block:  big.NewInt(19157000),
		Istanbul: &IstanbulConfig{
			Epoch:          17280,
			ProposerPolicy: 2,
			BlockPeriod:    5,
			RequestTimeout: 3000,
			LookbackWindow: 12,
		},
	}

	// AlfajoresChainConfig contains the chain parameters to run a node on the Alfajores test network.
	AlfajoresChainConfig = &ChainConfig{
		ChainID:             big.NewInt(int64(AlfajoresNetworkId)),
		HomesteadBlock:      big.NewInt(0),
		DAOForkBlock:        nil,
		DAOForkSupport:      true,
		EIP150Block:         big.NewInt(0),
		EIP155Block:         big.NewInt(0),
		EIP158Block:         big.NewInt(0),
		ByzantiumBlock:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),
		ChurritoBlock:       big.NewInt(4960000),
		DonutBlock:          big.NewInt(4960000),
		EspressoBlock:       big.NewInt(9472000),
		GingerbreadBlock:    big.NewInt(19814000),
		GingerbreadP2Block:  big.NewInt(19814000),
		Istanbul: &IstanbulConfig{
			Epoch:          17280,
			ProposerPolicy: 2,
			BlockPeriod:    5,
			RequestTimeout: 10000,
			LookbackWindow: 12,
		},
	}

	TestChainConfig = &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:      big.NewInt(0),
		ConstantinopleBlock: big.NewInt(0),
		PetersburgBlock:     big.NewInt(0),
		IstanbulBlock:       big.NewInt(0),

		ChurritoBlock:      big.NewInt(0),
		DonutBlock:         big.NewInt(0),
		EspressoBlock:      big.NewInt(0),
		GingerbreadBlock:   big.NewInt(0),
		GingerbreadP2Block: big.NewInt(0),

		Istanbul: &IstanbulConfig{
			Epoch:          30000,
			ProposerPolicy: 0,
		},

		FullHeaderChainAvailable: true,
		Faker:                    true,
		FakeBaseFee:              common.Big0,
	}
	IstanbulTestChainConfig = TestChainConfig.
							DeepCopy().
							OverrideFakerConfig(false).
							OverrideChainIdConfig(big.NewInt(1337)).
							OverrideIstanbulConfig(
			&IstanbulConfig{
				Epoch:          300,
				ProposerPolicy: 0,
				RequestTimeout: 1000,
				BlockPeriod:    1,
			},
		)
	TestRules = TestChainConfig.Rules(new(big.Int))

	// This is a hardcoded set of gas limit changes derived from historical
	// state. They allow non archive nodes to return the gas limit for blocks
	// before gingerbread (where we added gas limit to the block header).
	// Additionally they ensure that archive nodes return the correct value at
	// the beginning of the chain, before the blockchain parameters contract
	// was deployed and activated.
	PreGingerbreadNetworkGasLimits = map[uint64]*GasLimits{
		MainnetNetworkId:   mainnetGasLimits,
		AlfajoresNetworkId: alfajoresGasLimits,
		BaklavaNetworkId:   baklavaGasLimits,
	}
)
View Source
var AlfajoresBootnodes = []string{
	"enode://322f16487eb79832b66fe9091d8cc51cad861068d3e52f06ef391ecb89fe9342cfb8bd58020ece66ad8e081e9f08cb621201e4ad160092d7ff158cc03865d114@34.83.107.15:30301",
	"enode://e99a883d0b7d0bacb84cde98c4729933b49adbc94e718b77fdb31779c7ed9da6c49236330a9ae096f42bcbf6e803394229120201704b7a4a3ae8004993fa0876@34.83.92.243:30303",
	"enode://b3b42a9a6ef1125006f39b95850c624422eadb6340ac86e4023e47d5452914bb3d17340f9455cd1cdd0d246058b1fec2d3c500eeddbeafa49abd71f8f144b04e@35.199.145.251:30303",
	"enode://af5677afe5bf99a00bdb86d0f80f948b2e25f8978867b38cba8e860a6426507cbc37e15900f798305ceff6b7ac7f4057195827274d6b5f6a7e547ce512ff26ba@35.230.21.97:30303",
	"enode://02d18a52c4e097c12412ac3da9a9af24745cff182306e21fb1d3d691fe0c25f65c60586302b933bb9ec300b7fb00ed719d26a4d57af91d447691bac2b2d778af@35.247.59.117:30303",
	"enode://05977f6b7d3e16a99d27b714f8a029a006e41ec7732167d373dd920d31f72b3a1776650798d8763560854369d36867e9564dad13b4b60a90c347feeb491d83a9@34.83.42.50:30303",
	"enode://822366c6b9f80c3f3fdf7748209399ddd888bd54882958f6c75d05b8156c6274f54c8a1a6b468c3e85cade93a7dee2a2b701ccfc820b7669507d4bee855ebbf1@35.247.105.237:30303",
	"enode://5bb26439782fb6f9d0d997f907968f4ada618d49d83a2e6d202a107d7b17c67c680877ee733e2f92656714697e6f5eb0da25f26180c3e13d5dc39dc037160651@34.83.234.156:30303",
	"enode://29373f661cbea23f4f566d54470fae6ef5419c2a88aa52f306628df2d143f86807c02fd19b3d2d6d2e2a98d99a2db44643c6274e3aadd3632bd744a8be498768@34.105.6.12:30303",
	"enode://cc11ee6b035c8948dfaca5b09d676e28b0986585dac7a819376f12a8ee8b6b0ffd31907bb0d8bda27ef0a2296ee614d31773c7c5ea4333a121d80e0ba9bae801@34.83.51.187:30303",
	"enode://703cf979becdc501c4221090296fe75299cb9520f19a344098154c14c7133ebf6b649dad7f3f42947ad96312930bea5380a8ff86faa5a3795b0b6cc483adcfc8@35.230.23.131:30303",
}

AlfajoresBootnodes are the enode URLs of the P2P bootstrap nodes running on the Alfajores test network.

View Source
var BaklavaBootnodes = []string{
	"enode://5aaf10664b12431c250597e980aacd7d5373cae00f128be5b00364344bb96bce7555b50973664bddebd1cb7a6d3fb927bec81527f80e22a26fa373c375fcdefc@35.247.103.141:30301",
	"enode://be3a43b8a04a02cdee034ec2d133c6bd331429574cad91b739200ac88872dbd6acc81c20d1f891d598da77e47bb01e405464458d214052c1043f9b3d50d94f5c@34.105.120.49:30303",
	"enode://1044681acf8d7c120bc53c1a9e84adde71ac7155789525580ae786448111a877a96b8bd9b4a39ca6a891a3c7beb90080f7ebe5eae4beef75c0d4e8725a2b16e6@35.203.142.37:30303",
	"enode://c34cdb9b4a8b7c54c007ff27395b98de934653549b4ff73cdc9b913f558f2403ad837e6c0e202fe56b19f2fe914fa863eee86dd12ddd3d200f185d0f899d36b4@34.105.26.151:30303",
	"enode://b09158aefac3370e0b75b1ef01af5c0cf54914e517e4ad6c7893346d41aafa4441fe3bf9ef66e665214d673a3dc4c3b6ff62d546db417de63d4dcec6b53581d2@35.247.40.78:30303",
	"enode://269ef649fa4a8cd50661a150559696c931d51267a20010b74fa916610ae09f8f2d606263017f203528c4ad748e8808df5f1c97726b0df4860c199af3369bd7e1@35.233.157.112:30303",
	"enode://6e5c01a689fbe51cf0f5313426a3bd48189f3cdfe068018ff170838518c50e8a9acd4ef49828afe0e50372b4e477658b6677be5978f80df0085d3bed38ddab15@35.247.123.65:30303",
	"enode://29fa29d0e985ffd1ae5c5569a5140bdcc8380d9ac847d319fb824c02ef990440506dff6c005a17b737c4f4b31fc4286c423c868c3dedbd904bc525fa6a64815f@35.197.32.163:30303",
}

BaklavaBootnodes are the enode URLs of the P2P bootstrap nodes running on the Baklava test network.

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

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

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 CheckpointOracles = map[common.Hash]*CheckpointOracleConfig{}

CheckpointOracles associates each known checkpoint oracles with the genesis hash of the chain it belongs to.

View Source
var Fixidity1 = math.BigPow(10, 24)

Scale factor for the solidity fixidity library

View Source
var MainnetBootnodes = []string{

	"enode://5c9a3afb564b48cc2fa2e06b76d0c5d8f6910e1930ea7d0930213a0cbc20450434cd442f6483688eff436ad14dc29cb90c9592cc5c1d27ca62f28d4d8475d932@34.82.79.155:30301",

	"enode://6d1702b599db61bbdf23a6201b3d1595b526e536194c5140904e7b34d79162b9905a75a257e9a64bd2ee1ed3ef40e404b14e4f1eb985cc180d9912497fd81b0d@34.105.94.71:30303",
	"enode://306053e90aa90d7ef2dc3fd3fcbd14c4014c70040cdc767e7ca807e4981d596aa67ba5f798ac7fefd10ff8eb7d00aa190a703e5fa07b7b762f28068f56234c68@35.197.123.152:30303",
	"enode://e5d0a8c8d944d54d58b58e2214df15865b1f8c5363dbe871a95698494e6b04a0b230b31ee017f34dbe54a1648cb1a784c8aa9f8de3f3f3e8b96f2b4c2149e908@35.247.42.51:30303",
	"enode://c4c4cb1bd636fa25cd456462abd4d287c6ce94b91dfa1518fc40b61d7da868f7fe78d5ad30913609711b68ab06b9f5bc3a42c9dc220ecade03cbf18a50172090@34.83.140.127:30303",
	"enode://eec61e6e63e69ac4c612d06ec2f4169363a0945568a8555954e39c89a98a93ef04b3fe7925fbf832a329b6f2b4fe3c8066cca15edd3967d672f7cb9676a89dbc@35.230.33.130:30303",
	"enode://f11356a0802466235b470da8588b04e8831d0d4dccbe9c943c70b1b641f7f916c4d2534bffba1363489dfff8140bbee8dc16abe33b63abd3181b80976153f8c2@35.230.108.150:30303",

	"enode://c28fe08a1969bcbaaefdd5425f1d558cab4da45122cf9ecef6033c4004945d43c09f78cb6c82fa1bcfc4d22952562252e8513fd39eb043390d64e0976eb6cbfd@35.195.185.50:30303",
	"enode://e4a2a85656c8c6e40650a52874a29f96fa8546a6d2ce3a87720b4f2e0138b138419e440935462eea070ef8647dba9c2d417231790f3ece5b53117c9c9c5cbb3f@34.76.108.87:30303",
	"enode://00975d8863bd00bfd3a10457c1daf84ce991337f4dd266564d05efb21b54968f3db8125302a3e15d2047f795aa428051894dfc3707096429e7ad6401a0c347ee@34.76.60.59:30303",
	"enode://3413ca8a97908e0260b2c2e1c0b0c50e1d75b3a944195e1e403bb6978a2854841f937fb305cce76cdee59a970ff907bbfcc1642242f0db66e8b115e4b8a1c8cd@35.205.108.193:30303",
}

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

View Source
var NetworkIdHelp = fmt.Sprintf("Mainnet=%v, Baklava=%v, Alfajores=%v", MainnetNetworkId, BaklavaNetworkId, AlfajoresNetworkId)
View Source
var TrustedCheckpoints = map[common.Hash]*TrustedCheckpoint{}

TrustedCheckpoints associates each known checkpoint with the genesis hash of the chain it belongs to.

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 Geth archives. e.g. "1.8.11-dea1ce05" for stable releases, or

"1.8.13-unstable-21c059b6" for unstable releases

func KnownDNSNetwork added in v1.4.0

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

KnownDNSNetwork returns the address of a public DNS-based node list for the given genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more information.

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/ethereum/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)
	// MuirGlacierBlock    *big.Int `json:"muirGlacierBlock,omitempty"`    // Eip-2384 (bomb delay) switch block (nil = no fork, 0 = already activated)
	// BerlinBlock         *big.Int `json:"berlinBlock,omitempty"`         // Berlin switch block (nil = no fork, 0 = already on berlin)
	// LondonBlock         *big.Int `json:"londonBlock,omitempty"`         // London switch block (nil = no fork, 0 = already on london)
	ChurritoBlock      *big.Int `json:"churritoBlock,omitempty"`      // Churrito switch block (nil = no fork, 0 = already activated)
	DonutBlock         *big.Int `json:"donutBlock,omitempty"`         // Donut switch block (nil = no fork, 0 = already activated)
	EspressoBlock      *big.Int `json:"espressoBlock,omitempty"`      // Espresso switch block (nil = no fork, 0 = already activated)
	GingerbreadBlock   *big.Int `json:"gingerbreadBlock,omitempty"`   // Gingerbread switch block (nil = no fork, 0 = already activated)
	GingerbreadP2Block *big.Int `json:"gingerbreadP2Block,omitempty"` // GingerbreadP2 switch block (nil = no fork, 0 = already activated)

	Istanbul *IstanbulConfig `json:"istanbul,omitempty"`
	// This does not belong here but passing it to every function is not possible since that breaks
	// some implemented interfaces and introduces churn across the geth codebase.
	FullHeaderChainAvailable bool // False for lightest Sync mode, true otherwise

	// Requests mock engine if true
	Faker       bool     `json:"faker,omitempty"`
	FakeBaseFee *big.Int `json:"baseFee,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. This configuration is intentionally not using keyed fields to force anyone adding flags to the config to also have to set these fields.

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

func (c *ChainConfig) CheckConfigForkOrder() error

CheckConfigForkOrder checks that we don't "skip" any forks, geth isn't pluggable enough to guarantee that forks can be implemented in a different order than on official networks

func (*ChainConfig) DeepCopy added in v1.8.0

func (c *ChainConfig) DeepCopy() *ChainConfig

func (*ChainConfig) DisableGingerbread added in v1.8.0

func (c *ChainConfig) DisableGingerbread() *ChainConfig

func (*ChainConfig) IsBerlin added in v1.8.0

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

IsBerlin returns whether num is either equal to the Berlin fork block or greater. Celo change: This is used to keep code close to upstream, but uses Espresso activation 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) IsChurrito

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

IsChurrito returns whether num represents a block number after the Churrito fork

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) IsDonut

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

IsDonut returns whether num represents a block number after the Donut fork

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) IsEspresso added in v1.5.0

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

IsEspresso returns whether num represents a block number after the Espresso fork

func (*ChainConfig) IsGingerbread added in v1.8.0

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

IsGingerbread returns whether num represents a block number after the Gingerbread fork

func (*ChainConfig) IsGingerbreadP2 added in v1.8.0

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

IsGingerbreadP2 returns whether num represents a block number after the GingerbreadP2 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

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

IsIstanbul returns whether num is either equal to the Istanbul fork block or greater.

func (*ChainConfig) IsLondon added in v1.8.0

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

IsLondon returns whether num is either equal to the London fork block or greater. Celo change: This is used to keep code close to upstream, but uses Espresso activation block

func (*ChainConfig) IsPetersburg

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) OverrideChainIdConfig added in v1.8.0

func (c *ChainConfig) OverrideChainIdConfig(chainId *big.Int) *ChainConfig

func (*ChainConfig) OverrideFakerConfig added in v1.8.0

func (c *ChainConfig) OverrideFakerConfig(faker bool) *ChainConfig

func (*ChainConfig) OverrideIstanbulConfig added in v1.8.0

func (c *ChainConfig) OverrideIstanbulConfig(istanbulConfig *IstanbulConfig) *ChainConfig

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

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

CheckpointOracleConfig represents a set of checkpoint contract(which acts as an oracle) config which used for light client checkpoint syncing.

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 GasLimits added in v1.8.1

type GasLimits struct {
	// contains filtered or unexported fields
}

func (*GasLimits) Limit added in v1.8.1

func (g *GasLimits) Limit(block *big.Int) uint64

type IstanbulConfig

type IstanbulConfig struct {
	Epoch          uint64 `json:"epoch"`                 // Epoch length to reset votes and checkpoint
	ProposerPolicy uint64 `json:"policy"`                // The policy for proposer selection
	LookbackWindow uint64 `json:"lookbackwindow"`        // The number of blocks to look back when calculating uptime
	BlockPeriod    uint64 `json:"blockperiod,omitempty"` // Default minimum difference between two consecutive block's timestamps in second

	// The base timeout for each Istanbul round in milliseconds. The first
	// round will have a timeout of exactly this and subsequent rounds will
	// have timeouts of this + additional time that increases with round
	// number.
	RequestTimeout uint64 `json:"requesttimeout,omitempty"`
}

IstanbulConfig is the consensus engine configs for Istanbul based sealing.

func (*IstanbulConfig) String

func (c *IstanbulConfig) String() string

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

type LimitChange added in v1.8.1

type LimitChange struct {
	// contains filtered or unexported fields
}

type Rules

type Rules struct {
	ChainID                                                 *big.Int
	IsHomestead, IsEIP150, IsEIP155, IsEIP158               bool
	IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
	IsBerlin, IsLondon                                      bool
	IsChurrito, IsDonut, IsEspresso                         bool
	IsGingerbread, IsGingerbreadP2                          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

type TrustedCheckpoint struct {
	SectionIndex uint64      `json:"sectionIndex"`
	SectionHead  common.Hash `json:"sectionHead"`
	CHTRoot      common.Hash `json:"chtRoot"`
	BloomRoot    common.Hash `json:"bloomRoot"`
}

TrustedCheckpoint represents a set of post-processed trie roots (CHT and BloomTrie) associated with the appropriate section index and head hash. It is used to start light syncing from this checkpoint and avoid downloading the entire header chain while still being able to securely access old headers/logs.

func (*TrustedCheckpoint) Empty

func (c *TrustedCheckpoint) Empty() bool

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

func (*TrustedCheckpoint) Hash

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

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

func (*TrustedCheckpoint) HashEqual

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