core

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: LGPL-3.0 Imports: 69 Imported by: 0

Documentation

Overview

Package core implements the Ethereum consensus protocol.

Index

Constants

View Source
const (

	// BlockChainVersion ensures that an incompatible database forces a resync from scratch.
	BlockChainVersion = 3
)
View Source
const (
	// CxPoolSize is the maximum size of the pool
	CxPoolSize = 50
)
View Source
const (
	// GenesisEpoch is the number of the genesis epoch.
	GenesisEpoch = 0
)
View Source
const GenesisTestFoundationBalance = 100000000

GenesisTestFoundationBalance is the initial total number of token for NON-MAINNET in the genesis block.

Variables

View Source
var (
	// ErrKnownBlock is returned when a block to import is already known locally.
	ErrKnownBlock = errors.New("block already known")

	// ErrGasLimitReached is returned by the gas pool if the amount of gas required
	// by a transaction is higher than what's left in the block.
	ErrGasLimitReached = errors.New("gas limit reached")

	// ErrBlacklistedHash is returned if a block to import is on the blacklist.
	ErrBlacklistedHash = errors.New("blacklisted hash")

	// ErrNonceTooHigh is returned if the nonce of a transaction is higher than the
	// next one expected based on the local chain.
	ErrNonceTooHigh = errors.New("nonce too high")

	// ErrShardStateNotMatch is returned if the calculated shardState hash not equal that in the block header
	ErrShardStateNotMatch = errors.New("shard state root hash not match")
)
View Source
var (
	// ErrInvalidSender is returned if the transaction contains an invalid signature.
	ErrInvalidSender = errors.New("invalid sender")

	// ErrInvalidShard is returned if the transaction is for the wrong shard.
	ErrInvalidShard = errors.New("invalid shard")

	// ErrNonceTooLow is returned if the nonce of a transaction is lower than the
	// one present in the local chain.
	ErrNonceTooLow = errors.New("nonce too low")

	// ErrUnderpriced is returned if a transaction's gas price is below the minimum
	// configured for the transaction pool.
	ErrUnderpriced = errors.New("transaction underpriced")

	// ErrReplaceUnderpriced is returned if a transaction is attempted to be replaced
	// with a different one without the required price bump.
	ErrReplaceUnderpriced = errors.New("replacement transaction underpriced")

	// ErrInsufficientFunds is returned if the total cost of executing a transaction
	// is higher than the balance of the user's account.
	ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value")

	// ErrIntrinsicGas is returned if the transaction is specified to use less gas
	// than required to start the invocation.
	ErrIntrinsicGas = errors.New("intrinsic gas too low")

	// ErrGasLimit is returned if a transaction's requested gas limit exceeds the
	// maximum allowance of the current block.
	ErrGasLimit = errors.New("exceeds block gas limit")

	// ErrNegativeValue is a sanity error to ensure noone is able to specify a
	// transaction with a negative value.
	ErrNegativeValue = errors.New("negative value")

	// ErrOversizedData is returned if the input data of a transaction is greater
	// than some meaningful limit a user might use. This is not a consensus error
	// making the transaction invalid, rather a DOS protection.
	ErrOversizedData = errors.New("oversized data")

	// ErrKnownTransaction is returned if a transaction that is already in the pool
	// attempting to be added to the pool.
	ErrKnownTransaction = errors.New("known transaction")

	// ErrInvalidMsgForStakingDirective is returned if a staking message does not
	// match the related directive
	ErrInvalidMsgForStakingDirective = errors.New("staking message does not match directive message")

	// ErrBlacklistFrom is returned if a transaction's from/source address is blacklisted
	ErrBlacklistFrom = errors.New("`from` address of transaction in blacklist and not in allowlist")

	// ErrBlacklistTo is returned if a transaction's to/destination address is blacklisted
	ErrBlacklistTo = errors.New("`to` address of transaction in blacklist")

	ErrAllowedTxs = errors.New("transaction allowed whitelist check failed.")
)
View Source
var DefaultTxPoolConfig = TxPoolConfig{
	Journal:   "transactions.rlp",
	Rejournal: time.Hour,

	PriceLimit: 100e9,
	PriceBump:  1,

	AccountSlots: 16,
	GlobalSlots:  4096,
	AccountQueue: 64,
	GlobalQueue:  1024,

	Lifetime: 30 * time.Minute,

	Blacklist:  map[common.Address]struct{}{},
	AllowedTxs: map[common.Address]AllowedTxData{},
}

DefaultTxPoolConfig contains the default configurations for the transaction pool.

View Source
var (

	// ErrNoGenesis is the error when there is no genesis.
	ErrNoGenesis = errors.New("Genesis not found in chain")
)
View Source
var GenesisAllocDevnet = map[string]GenesisAccount{
	"0x89Edf385780aAE08F8aa15bB52FB913EF8C43433": {
		Balance: toStorableBalance(GenesisTestFoundationBalance),
	},
}
View Source
var GenesisAllocDockernet = map[string]GenesisAccount{

	"0xA5241513DA9F4463F1d4874b548dFBAC29D91f34": {
		Balance: toStorableBalance(GenesisTestFoundationBalance),
	},
}
View Source
var GenesisAllocLocalnet = map[string]GenesisAccount{

	"0xA5241513DA9F4463F1d4874b548dFBAC29D91f34": {
		Balance: toStorableBalance(GenesisTestFoundationBalance),
	},
}
View Source
var GenesisAllocMainNet = map[string]GenesisAccount{
	"0xdE8CEfB471f20292021399A4E56af4edEB926BB5": {

		Balance: toStorableBalance(60000),
	},
	"0x0000000000000000000000000000000000001001": {

		Balance: toStorableBalance(89940000),
		Code:    common.FromHex("0x60806040526004361061012a5760003560e01c80638129fc1c116100ab578063c13f0e0d1161006f578063c13f0e0d146103bd578063c81b1662146103d4578063da66b65e146103ff578063f4c6e6bd1461042a578063f90130f414610453578063fd6a68791461047c5761012a565b80638129fc1c146102da5780638278ef6d146102f15780638ade54861461031a5780639015fe4c14610343578063ba292227146103805761012a565b80633f1e4244116100f25780633f1e42441461020257806350e1735a1461022d5780636769a8bb146102565780637007b08014610272578063770cd9191461029d5761012a565b8063038601961461012f578063092193ab1461015a57806314c1e1f7146101835780631f0b1c8e146101ae57806324405fbc146101d9575b600080fd5b34801561013b57600080fd5b506101446104a7565b6040516101519190611c8d565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906118bb565b6104cd565b005b34801561018f57600080fd5b506101986106e0565b6040516101a59190611c8d565b60405180910390f35b3480156101ba57600080fd5b506101c3610706565b6040516101d09190611c8d565b60405180910390f35b3480156101e557600080fd5b5061020060048036038101906101fb9190611933565b61072c565b005b34801561020e57600080fd5b506102176107ca565b6040516102249190611ed5565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f919061195c565b6107d0565b005b610270600480360381019061026b9190611998565b61086e565b005b34801561027e57600080fd5b50610287610c2b565b6040516102949190611ed5565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf9190611933565b610c31565b6040516102d19190611c8d565b60405180910390f35b3480156102e657600080fd5b506102ef610c6e565b005b3480156102fd57600080fd5b50610318600480360381019061031391906118e4565b610d64565b005b34801561032657600080fd5b50610341600480360381019061033c9190611933565b6110ef565b005b34801561034f57600080fd5b5061036a60048036038101906103659190611933565b6111c0565b6040516103779190611cdf565b60405180910390f35b34801561038c57600080fd5b506103a760048036038101906103a29190611933565b61122d565b6040516103b49190611c8d565b60405180910390f35b3480156103c957600080fd5b506103d261126a565b005b3480156103e057600080fd5b506103e9611532565b6040516103f69190611c8d565b60405180910390f35b34801561040b57600080fd5b50610414611558565b6040516104219190611c8d565b60405180910390f35b34801561043657600080fd5b50610451600480360381019061044c919061195c565b61157e565b005b34801561045f57600080fd5b5061047a60048036038101906104759190611933565b61169d565b005b34801561048857600080fd5b5061049161176e565b60405161049e9190611c8d565b60405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461055d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055490611d55565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff1660065460405161058590611c78565b60006040518083038185875af1925050503d80600081146105c2576040519150601f19603f3d011682016040523d82523d6000602084013e6105c7565b606091505b505090508061060b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060290611eb5565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660075460405161065590611c78565b60006040518083038185875af1925050503d8060008114610692576040519150601f19603f3d011682016040523d82523d6000602084013e610697565b606091505b50509050806106db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d290611db5565b60405180910390fd5b505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b390611e55565b60405180910390fd5b6107c7816000611794565b50565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085790611e55565b60405180910390fd5b61086a8282611794565b5050565b600860009054906101000a900460ff16156108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b590611d95565b60405180910390fd5b6001600860006101000a81548160ff0219169083151502179055506007546006546108e99190612043565b811161092a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092190611dd5565b60405180910390fd5b6000600a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c990611d35565b60405180910390fd5b60006009600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7190611d15565b60405180910390fd5b34831115610abd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab490611e95565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166392b2c3358684638278ef6d60e01b858989604051602401610b1a93929190611ca8565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518463ffffffff1660e01b8152600401610b9593929190611fcd565b600060405180830381600087803b158015610baf57600080fd5b505af1158015610bc3573d6000803e3d6000fd5b505050506000600860006101000a81548160ff0219169083151502179055507f752a2bfed77c22e59eeaf9351f545a08f5ee0110b8d6de0e7bcaf32a5dfa661b85600083338888604051610c1c96959493929190611f6c565b60405180910390a15050505050565b60075481565b60006009600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b670de0b6b3a7640000600681905550670de0b6b3a764000060078190555073cbd10403a63cc46b7cf35c39dc4966349cb416d5600a60006038815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550735ca42204cdaa70d5c773946e69de942b85ca6706600960006038815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d6261126a565b565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610deb90611d55565b60405180910390fd5b600080610dff611823565b91509150600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6a90611e75565b60405180910390fd5b6000600a600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1290611e35565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8090611d75565b60405180910390fd5b600754600654610f999190612043565b8411610fda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd190611dd5565b60405180910390fd5b600060075460065486610fed9190612099565b610ff79190612099565b905060008673ffffffffffffffffffffffffffffffffffffffff168260405161101f90611c78565b60006040518083038185875af1925050503d806000811461105c576040519150601f19603f3d011682016040523d82523d6000602084013e611061565b606091505b50509050806110a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109c90611e15565b60405180910390fd5b7f3008be2f38f2c92605e65a39c193c4b67868ea0dd742f5b9d6f228c9e258ece1858560008a8a6040516110dd959493929190611f19565b60405180910390a15050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690611e55565b60405180910390fd5b806007819055507fb5bc923069c0d19f6e5ef33aa66c240207f375112b41aa279dbb75e368274757816040516111b59190611ed5565b60405180910390a150565b60006009600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6000600a600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060019054906101000a900460ff1615905080801561129b5750600160008054906101000a900460ff1660ff16105b806112c857506112aa30611859565b1580156112c75750600160008054906101000a900460ff1660ff16145b5b611307576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fe90611df5565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015611344576001600060016101000a81548160ff0219169083151502179055505b611001600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550801561152f5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516115269190611cfa565b60405180910390a15b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160590611e55565b60405180910390fd5b80600a600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fba6710d369f7b6310c4351bad2c65bb51b1fd08998b462f1d38674ebedb8d3f48282604051611691929190611ef0565b60405180910390a15050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461172d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172490611e55565b60405180910390fd5b806006819055507fd35f02eb7775b40ef5e7937d15e317890e459e7646af295308735bad2bd65dd6816040516117639190611ed5565b60405180910390a150565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b806009600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fdd97d5b0d0146d50ccc2e2c7f31ed0de2d530369c3379afee4a9da32433e9df48282604051611817929190611ef0565b60405180910390a15050565b600080366000803691509150600082829050905060206034820360003760005194506014808203600c3760005193505050509091565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008135905061188b81612586565b92915050565b6000813590506118a08161259d565b92915050565b6000813590506118b5816125b4565b92915050565b6000602082840312156118cd57600080fd5b60006118db84828501611891565b91505092915050565b6000806000606084860312156118f957600080fd5b60006119078682870161187c565b935050602061191886828701611891565b9250506040611929868287016118a6565b9150509250925092565b60006020828403121561194557600080fd5b6000611953848285016118a6565b91505092915050565b6000806040838503121561196f57600080fd5b600061197d858286016118a6565b925050602061198e8582860161187c565b9150509250929050565b6000806000606084860312156119ad57600080fd5b60006119bb868287016118a6565b93505060206119cc8682870161187c565b92505060406119dd868287016118a6565b9150509250925092565b6119f081612134565b82525050565b6119ff816120cd565b82525050565b611a0e816120f1565b82525050565b6000611a1f8261200b565b611a298185612016565b9350611a3981856020860161217c565b611a42816121de565b840191505092915050565b611a5681612146565b82525050565b6000611a69603883612032565b9150611a74826121ef565b604082019050919050565b6000611a8c602283612032565b9150611a978261223e565b604082019050919050565b6000611aaf601983612032565b9150611aba8261228d565b602082019050919050565b6000611ad2602683612032565b9150611add826122b6565b604082019050919050565b6000611af5601683612032565b9150611b0082612305565b602082019050919050565b6000611b18601c83612032565b9150611b238261232e565b602082019050919050565b6000611b3b604983612032565b9150611b4682612357565b606082019050919050565b6000611b5e602e83612032565b9150611b69826123cc565b604082019050919050565b6000611b81601383612032565b9150611b8c8261241b565b602082019050919050565b6000611ba4603883612032565b9150611baf82612444565b604082019050919050565b6000611bc7601c83612032565b9150611bd282612493565b602082019050919050565b6000611bea602683612032565b9150611bf5826124bc565b604082019050919050565b6000611c0d600083612027565b9150611c188261250b565b600082019050919050565b6000611c30603d83612032565b9150611c3b8261250e565b604082019050919050565b6000611c53601d83612032565b9150611c5e8261255d565b602082019050919050565b611c728161211d565b82525050565b6000611c8382611c00565b9150819050919050565b6000602082019050611ca260008301846119f6565b92915050565b6000606082019050611cbd60008301866119f6565b611cca60208301856119f6565b611cd76040830184611c69565b949350505050565b6000602082019050611cf46000830184611a05565b92915050565b6000602082019050611d0f6000830184611a4d565b92915050565b60006020820190508181036000830152611d2e81611a5c565b9050919050565b60006020820190508181036000830152611d4e81611a7f565b9050919050565b60006020820190508181036000830152611d6e81611aa2565b9050919050565b60006020820190508181036000830152611d8e81611ac5565b9050919050565b60006020820190508181036000830152611dae81611ae8565b9050919050565b60006020820190508181036000830152611dce81611b0b565b9050919050565b60006020820190508181036000830152611dee81611b2e565b9050919050565b60006020820190508181036000830152611e0e81611b51565b9050919050565b60006020820190508181036000830152611e2e81611b74565b9050919050565b60006020820190508181036000830152611e4e81611b97565b9050919050565b60006020820190508181036000830152611e6e81611bba565b9050919050565b60006020820190508181036000830152611e8e81611bdd565b9050919050565b60006020820190508181036000830152611eae81611c23565b9050919050565b60006020820190508181036000830152611ece81611c46565b9050919050565b6000602082019050611eea6000830184611c69565b92915050565b6000604082019050611f056000830185611c69565b611f1260208301846119f6565b9392505050565b600060a082019050611f2e6000830188611c69565b611f3b60208301876119f6565b611f4860408301866119f6565b611f5560608301856119e7565b611f626080830184611c69565b9695505050505050565b600060c082019050611f816000830189611c69565b611f8e60208301886119f6565b611f9b60408301876119f6565b611fa860608301866119f6565b611fb560808301856119f6565b611fc260a0830184611c69565b979650505050505050565b6000606082019050611fe26000830186611c69565b611fef60208301856119f6565b81810360408301526120018184611a14565b9050949350505050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600061204e8261211d565b91506120598361211d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561208e5761208d6121af565b5b828201905092915050565b60006120a48261211d565b91506120af8361211d565b9250828210156120c2576120c16121af565b5b828203905092915050565b60006120d8826120fd565b9050919050565b60006120ea826120fd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061213f82612158565b9050919050565b600061215182612127565b9050919050565b60006121638261216a565b9050919050565b6000612175826120fd565b9050919050565b60005b8381101561219a57808201518184015260208101905061217f565b838111156121a9576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f546f6b656e4875623a20546f6b656e206e6f74207472616e7366657261626c6560008201527f20746f2072657175657374656420626c6f636b636861696e0000000000000000602082015250565b7f546f6b656e4875623a20426c6f636b636861696e206e6f7420737570706f727460008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f6e6c792043726f73732d636861696e20436f6e747261637400000000000000600082015250565b7f546f6b656e4875623a20496e636f727265637420736f7572636520506f73692060008201527f4272696467650000000000000000000000000000000000000000000000000000602082015250565b7f546f6b656e4875623a206e6f6e5265656e7472616e7400000000000000000000600082015250565b7f4661696c656420746f2073656e642073797374656d2072657761726400000000600082015250565b7f546f6b656e4875623a207265636569766520616d6f756e74206d75737420686960008201527f67686572207468616e20746f74616c2072656c6179657220616e64207379737460208201527f656d207265776172640000000000000000000000000000000000000000000000604082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e6420506f736900000000000000000000000000600082015250565b7f546f6b656e4875623a204e6f20506f73692042726964676520737570706f727460008201527f656420666f7220736f7572636520626c6f636b636861696e0000000000000000602082015250565b7f4f6e6c7920476f7665726e616e63652048756220436f6e747261637400000000600082015250565b7f546f6b656e4875623a2043616c6c657220636f6e74726163742063616e206e6f60008201527f7420626520300000000000000000000000000000000000000000000000000000602082015250565b50565b7f546f6b656e4875623a205472616e736665727265642076616c75652063616e2060008201527f6e6f74206c657373207468616e20657870656374656420616d6f756e74000000602082015250565b7f4661696c656420746f2073656e642072656c6179657220726577617264000000600082015250565b61258f816120cd565b811461259a57600080fd5b50565b6125a6816120df565b81146125b157600080fd5b50565b6125bd8161211d565b81146125c857600080fd5b5056fea2646970667358221220406ec35aa25a08f5cb779903b181468c3604e793c0d89b19a39ffcf3d5fc664164736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000001002": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x60806040526004361061008a5760003560e01c8063c13f0e0d11610059578063c13f0e0d14610164578063c81b16621461017b578063da66b65e146101a6578063f0578ade146101d1578063fd6a6879146101fa576100ca565b806303860196146100cc57806314c1e1f7146100f75780631f0b1c8e146101225780638129fc1c1461014d576100ca565b366100ca577f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f8852587433346040516100c09291906108c7565b60405180910390a1005b005b3480156100d857600080fd5b506100e1610225565b6040516100ee91906108ac565b60405180910390f35b34801561010357600080fd5b5061010c61024b565b60405161011991906108ac565b60405180910390f35b34801561012e57600080fd5b50610137610271565b60405161014491906108ac565b60405180910390f35b34801561015957600080fd5b50610162610297565b005b34801561017057600080fd5b506101796102a1565b005b34801561018757600080fd5b50610190610569565b60405161019d91906108ac565b60405180910390f35b3480156101b257600080fd5b506101bb61058f565b6040516101c891906108ac565b60405180910390f35b3480156101dd57600080fd5b506101f860048036038101906101f391906107a2565b6105b5565b005b34801561020657600080fd5b5061020f61072f565b60405161021c91906108ac565b60405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61029f6102a1565b565b60008060019054906101000a900460ff161590508080156102d25750600160008054906101000a900460ff1660ff16105b806102ff57506102e130610755565b1580156102fe5750600160008054906101000a900460ff1660ff16145b5b61033e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103359061090b565b60405180910390fd5b60016000806101000a81548160ff021916908360ff160217905550801561037b576001600060016101000a81548160ff0219169083151502179055505b611001600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156105665760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161055d91906108f0565b60405180910390a15b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063c9061094b565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff168260405161066b90610897565b60006040518083038185875af1925050503d80600081146106a8576040519150601f19603f3d011682016040523d82523d6000602084013e6106ad565b606091505b50509050806106f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e89061092b565b60405180910390fd5b7fb6137b8a5148b04ecdfea869d88d8ca28403ba933c422bfe4266ac8cbe1e27b083836040516107229291906108c7565b60405180910390a1505050565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008135905061078781610a86565b92915050565b60008135905061079c81610a9d565b92915050565b600080604083850312156107b557600080fd5b60006107c385828601610778565b92505060206107d48582860161078d565b9150509250929050565b6107e781610987565b82525050565b6107f6816109d0565b82525050565b6000610809602e83610976565b9150610814826109e2565b604082019050919050565b600061082c601383610976565b915061083782610a31565b602082019050919050565b600061084f601c83610976565b915061085a82610a5a565b602082019050919050565b600061087260008361096b565b915061087d82610a83565b600082019050919050565b610891816109b9565b82525050565b60006108a282610865565b9150819050919050565b60006020820190506108c160008301846107de565b92915050565b60006040820190506108dc60008301856107de565b6108e96020830184610888565b9392505050565b600060208201905061090560008301846107ed565b92915050565b60006020820190508181036000830152610924816107fc565b9050919050565b600060208201905081810360008301526109448161081f565b9050919050565b6000602082019050818103600083015261096481610842565b9050919050565b600081905092915050565b600082825260208201905092915050565b600061099282610999565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006109db826109c3565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e6420506f736900000000000000000000000000600082015250565b7f4f6e6c7920476f7665726e616e63652048756220436f6e747261637400000000600082015250565b50565b610a8f81610987565b8114610a9a57600080fd5b50565b610aa6816109b9565b8114610ab157600080fd5b5056fea2646970667358221220d801d604bae565ca67b63f74889133df22eeeb1ef21f97d8eeeb44316ccce7ce64736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000001003": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063abd96d4311610066578063abd96d43146100fc578063c13f0e0d14610118578063c81b166214610122578063da66b65e14610140578063fd6a68791461015e57610093565b8063038601961461009857806314c1e1f7146100b65780631f0b1c8e146100d45780638129fc1c146100f2575b600080fd5b6100a061017c565b6040516100ad9190610c4a565b60405180910390f35b6100be6101a2565b6040516100cb9190610c4a565b60405180910390f35b6100dc6101c8565b6040516100e99190610c4a565b60405180910390f35b6100fa6101ee565b005b61011660048036038101906101119190610aa2565b6101f8565b005b610120610408565b005b61012a6106d0565b6040516101379190610c4a565b60405180910390f35b6101486106f6565b6040516101559190610c4a565b60405180910390f35b61016661071c565b6040516101739190610c4a565b60405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6101f6610408565b565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027f90610cc2565b60405180910390fd5b600060405180606001604052806027815260200161104c60279139905060005b8551811015610400576000808783815181106102ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16878481518110610344577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151878581518110610385577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160405161039a9190610c33565b60006040518083038185875af1925050503d80600081146103d7576040519150601f19603f3d011682016040523d82523d6000602084013e6103dc565b606091505b50915091506103ec828286610742565b505050806103f990610eed565b90506102a8565b505050505050565b60008060019054906101000a900460ff161590508080156104395750600160008054906101000a900460ff1660ff16105b806104665750610448306107a9565b1580156104655750600160008054906101000a900460ff1660ff16145b5b6104a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049c90610ca2565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156104e2576001600060016101000a81548160ff0219169083151502179055505b611001600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156106cd5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516106c49190610c65565b60405180910390a15b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60608315610752578290506107a2565b6000835111156107655782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107999190610c80565b60405180910390fd5b9392505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60006107df6107da84610d07565b610ce2565b905080838252602082019050828560208602820111156107fe57600080fd5b60005b8581101561082e578161081488826109a6565b845260208401935060208301925050600181019050610801565b5050509392505050565b600061084b61084684610d33565b610ce2565b9050808382526020820190508285602086028201111561086a57600080fd5b60005b858110156108b457813567ffffffffffffffff81111561088c57600080fd5b8086016108998982610a39565b8552602085019450602084019350505060018101905061086d565b5050509392505050565b60006108d16108cc84610d5f565b610ce2565b905080838252602082019050828560208602820111156108f057600080fd5b60005b8581101561092057816109068882610a8d565b8452602084019350602083019250506001810190506108f3565b5050509392505050565b600061093d61093884610d8b565b610ce2565b90508281526020810184848401111561095557600080fd5b610960848285610e7a565b509392505050565b600061097b61097684610dbc565b610ce2565b90508281526020810184848401111561099357600080fd5b61099e848285610e7a565b509392505050565b6000813590506109b58161101d565b92915050565b600082601f8301126109cc57600080fd5b81356109dc8482602086016107cc565b91505092915050565b600082601f8301126109f657600080fd5b8135610a06848260208601610838565b91505092915050565b600082601f830112610a2057600080fd5b8135610a308482602086016108be565b91505092915050565b600082601f830112610a4a57600080fd5b8135610a5a84826020860161092a565b91505092915050565b600082601f830112610a7457600080fd5b8135610a84848260208601610968565b91505092915050565b600081359050610a9c81611034565b92915050565b60008060008060808587031215610ab857600080fd5b600085013567ffffffffffffffff811115610ad257600080fd5b610ade878288016109bb565b945050602085013567ffffffffffffffff811115610afb57600080fd5b610b0787828801610a0f565b935050604085013567ffffffffffffffff811115610b2457600080fd5b610b30878288016109e5565b925050606085013567ffffffffffffffff811115610b4d57600080fd5b610b5987828801610a63565b91505092959194509250565b610b6e81610e1f565b82525050565b6000610b7f82610ded565b610b898185610e03565b9350610b99818560208601610e89565b80840191505092915050565b610bae81610e68565b82525050565b6000610bbf82610df8565b610bc98185610e0e565b9350610bd9818560208601610e89565b610be281610f94565b840191505092915050565b6000610bfa602e83610e0e565b9150610c0582610fa5565b604082019050919050565b6000610c1d601b83610e0e565b9150610c2882610ff4565b602082019050919050565b6000610c3f8284610b74565b915081905092915050565b6000602082019050610c5f6000830184610b65565b92915050565b6000602082019050610c7a6000830184610ba5565b92915050565b60006020820190508181036000830152610c9a8184610bb4565b905092915050565b60006020820190508181036000830152610cbb81610bed565b9050919050565b60006020820190508181036000830152610cdb81610c10565b9050919050565b6000610cec610cfd565b9050610cf88282610ebc565b919050565b6000604051905090565b600067ffffffffffffffff821115610d2257610d21610f65565b5b602082029050602081019050919050565b600067ffffffffffffffff821115610d4e57610d4d610f65565b5b602082029050602081019050919050565b600067ffffffffffffffff821115610d7a57610d79610f65565b5b602082029050602081019050919050565b600067ffffffffffffffff821115610da657610da5610f65565b5b610daf82610f94565b9050602081019050919050565b600067ffffffffffffffff821115610dd757610dd6610f65565b5b610de082610f94565b9050602081019050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610e2a82610e31565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000610e7382610e5b565b9050919050565b82818337600083830152505050565b60005b83811015610ea7578082015181840152602081019050610e8c565b83811115610eb6576000848401525b50505050565b610ec582610f94565b810181811067ffffffffffffffff82111715610ee457610ee3610f65565b5b80604052505050565b6000610ef882610e51565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f2b57610f2a610f36565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4f6e6c7920506f736974696f6e2041646d696e20416464726573730000000000600082015250565b61102681610e1f565b811461103157600080fd5b50565b61103d81610e51565b811461104857600080fd5b5056fe476f7665726e6f723a2063616c6c20726576657274656420776974686f7574206d657373616765a264697066735822122005c2a28fb7ad24f63f2bb33294783895ece9f8f8cd479df656fcebdba3ba810b64736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000001004": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x60806040526004361061012a5760003560e01c80636a87d780116100ab578063c81b16621161006f578063c81b166214610362578063d2d64a441461038d578063da66b65e146103b6578063e79a198f146103e1578063fb7cfdd7146103f8578063fd6a6879146104235761012a565b80636a87d780146102b5578063795e2ce0146102e05780638129fc1c1461030b5780638fe54eb114610322578063c13f0e0d1461034b5761012a565b8063378d0c5e116100f2578063378d0c5e146101e35780634e3d98ea146101fa5780635300f84114610223578063541d55481461026157806361dd6bea1461029e5761012a565b8063038601961461012f578063123e128a1461015a57806314c1e1f7146101835780631aa3a008146101ae5780631f0b1c8e146101b8575b600080fd5b34801561013b57600080fd5b5061014461044e565b6040516101519190611c72565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906119eb565b610474565b005b34801561018f57600080fd5b50610198610589565b6040516101a59190611c72565b60405180910390f35b6101b66105af565b005b3480156101c457600080fd5b506101cd610860565b6040516101da9190611c72565b60405180910390f35b3480156101ef57600080fd5b506101f8610886565b005b34801561020657600080fd5b50610221600480360381019061021c91906119eb565b61095f565b005b34801561022f57600080fd5b5061024a600480360381019061024591906119c2565b610a74565b604051610258929190611e9e565b60405180910390f35b34801561026d57600080fd5b50610288600480360381019061028391906119c2565b610a98565b6040516102959190611c8d565b60405180910390f35b3480156102aa57600080fd5b506102b3610aee565b005b3480156102c157600080fd5b506102ca610bc7565b6040516102d79190611e83565b60405180910390f35b3480156102ec57600080fd5b506102f5610bcd565b6040516103029190611c8d565b60405180910390f35b34801561031757600080fd5b50610320610be0565b005b34801561032e57600080fd5b50610349600480360381019061034491906119c2565b610c75565b005b34801561035757600080fd5b50610360610fe2565b005b34801561036e57600080fd5b506103776112aa565b6040516103849190611c72565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af91906119c2565b6112d0565b005b3480156103c257600080fd5b506103cb6114f4565b6040516103d89190611c72565b60405180910390f35b3480156103ed57600080fd5b506103f661151a565b005b34801561040457600080fd5b5061040d611920565b60405161041a9190611e83565b60405180910390f35b34801561042f57600080fd5b50610438611926565b6040516104459190611c72565b60405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610504576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fb90611de3565b60405180910390fd5b8060075410610548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053f90611e63565b60405180910390fd5b806006819055507fcc841c6f75dd542e6a8051729bf1efe2c4ab21a629700828e103728a40b662218160405161057e9190611e83565b60405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105b83361194c565b156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef90611e03565b60405180910390fd5b600560149054906101000a900460ff16610647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063e90611d63565b60405180910390fd5b600860009054906101000a900460ff1615610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068e90611e23565b60405180910390fd5b6001600860006101000a81548160ff02191690831515021790555060003390506106c081610a98565b15610700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f790611d03565b60405180910390fd5b6006543414610744576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073b90611ce3565b60405180910390fd5b60405180604001604052806006548152602001600754815250600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000155602082015181600101559050506001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600860006101000a81548160ff0219169083151502179055507fc3b80e866c8bfbccbded69771f510856bb44660d40a0b760d9f0781728543e4e816040516108559190611c72565b60405180910390a150565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610916576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090d90611de3565b60405180910390fd5b6000600560146101000a81548160ff0219169083151502179055507f609a9785cc4ced860563c8560b2cd9dd697292635c88e40ce70078a0eb58197f60405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e690611de3565b60405180910390fd5b6006548110610a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2a90611d23565b60405180910390fd5b806007819055507faa7d2fef7aa816ab53a03ced3ff2cd3bba5d82f08dfb6adcfc705d1997b4b94181604051610a699190611e83565b60405180910390a150565b60096020528060005260406000206000915090508060000154908060010154905082565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7590611de3565b60405180910390fd5b6001600560146101000a81548160ff0219169083151502179055507fb62606c20b9315d242f61ec7cd2b48cb8091876fb4f5bc71bb99b3773db8905d60405160405180910390a1565b60075481565b600560149054906101000a900460ff1681565b68056bc75e2d6310000060068190555067016345785d8a00006007819055506001600a60007346a985e81ebdd29cabbc592b41e4d7f5e39afcd673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c73610fe2565b565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfc90611de3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90611cc3565b60405180910390fd5b610d7e81610a98565b610dbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db490611e43565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600081600001511115610f58576000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff168360000151604051610e7d90611c5d565b60006040518083038185875af1925050503d8060008114610eba576040519150601f19603f3d011682016040523d82523d6000602084013e610ebf565b606091505b5050905080610f03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efa90611dc3565b60405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600090556001820160009055505050505b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690557f490a66cc56c789979052c7052fc0c10a6c4627d8e6165caec80db97a4c38352182604051610fd69190611c72565b60405180910390a15050565b60008060019054906101000a900460ff161590508080156110135750600160008054906101000a900460ff1660ff16105b8061104057506110223061195f565b15801561103f5750600160008054906101000a900460ff1660ff16145b5b61107f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107690611d83565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156110bc576001600060016101000a81548160ff0219169083151502179055505b611001600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156112a75760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498600160405161129e9190611ca8565b60405180910390a15b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790611de3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c790611cc3565b60405180910390fd5b6113d98161194c565b15611419576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141090611e03565b60405180910390fd5b61142281610a98565b15611462576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145990611d03565b60405180910390fd5b6001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc3b80e866c8bfbccbded69771f510856bb44660d40a0b760d9f0781728543e4e816040516114e99190611c72565b60405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560149054906101000a900460ff16611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090611d63565b60405180910390fd5b600860009054906101000a900460ff16156115b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b090611e23565b60405180910390fd5b6001600860006101000a81548160ff02191690831515021790555060003390506115e281610a98565b611621576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161890611e43565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050600082905060008173ffffffffffffffffffffffffffffffffffffffff166116bc8460200151856000015161198290919063ffffffff16565b6040516116c890611c5d565b60006040518083038185875af1925050503d8060008114611705576040519150601f19603f3d011682016040523d82523d6000602084013e61170a565b606091505b505090508061174e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174590611da3565b60405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16856020015160405161179f90611c5d565b60006040518083038185875af1925050503d80600081146117dc576040519150601f19603f3d011682016040523d82523d6000602084013e6117e1565b606091505b5050905080611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c90611d43565b60405180910390fd5b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000905560018201600090555050600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff02191690556000600860006101000a81548160ff0219169083151502179055507f490a66cc56c789979052c7052fc0c10a6c4627d8e6165caec80db97a4c383521866040516119109190611c72565b60405180910390a1505050505050565b60065481565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080823b905060008111915050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600081836119909190611ee3565b905092915050565b6000813590506119a7816122d2565b92915050565b6000813590506119bc816122e9565b92915050565b6000602082840312156119d457600080fd5b60006119e284828501611998565b91505092915050565b6000602082840312156119fd57600080fd5b6000611a0b848285016119ad565b91505092915050565b611a1d81611f17565b82525050565b611a2c81611f29565b82525050565b611a3b81611f6c565b82525050565b6000611a4e601783611ed2565b9150611a5982611fad565b602082019050919050565b6000611a71602583611ed2565b9150611a7c82611fd6565b604082019050919050565b6000611a94601683611ed2565b9150611a9f82612025565b602082019050919050565b6000611ab7602a83611ed2565b9150611ac28261204e565b604082019050919050565b6000611ada601a83611ed2565b9150611ae58261209d565b602082019050919050565b6000611afd601a83611ed2565b9150611b08826120c6565b602082019050919050565b6000611b20602e83611ed2565b9150611b2b826120ef565b604082019050919050565b6000611b43602683611ed2565b9150611b4e8261213e565b604082019050919050565b6000611b66601d83611ed2565b9150611b718261218d565b602082019050919050565b6000611b89601c83611ed2565b9150611b94826121b6565b602082019050919050565b6000611bac600083611ec7565b9150611bb7826121df565b600082019050919050565b6000611bcf602783611ed2565b9150611bda826121e2565b604082019050919050565b6000611bf2601883611ed2565b9150611bfd82612231565b602082019050919050565b6000611c15601283611ed2565b9150611c208261225a565b602082019050919050565b6000611c38602883611ed2565b9150611c4382612283565b604082019050919050565b611c5781611f55565b82525050565b6000611c6882611b9f565b9150819050919050565b6000602082019050611c876000830184611a14565b92915050565b6000602082019050611ca26000830184611a23565b92915050565b6000602082019050611cbd6000830184611a32565b92915050565b60006020820190508181036000830152611cdc81611a41565b9050919050565b60006020820190508181036000830152611cfc81611a64565b9050919050565b60006020820190508181036000830152611d1c81611a87565b9050919050565b60006020820190508181036000830152611d3c81611aaa565b9050919050565b60006020820190508181036000830152611d5c81611acd565b9050919050565b60006020820190508181036000830152611d7c81611af0565b9050919050565b60006020820190508181036000830152611d9c81611b13565b9050919050565b60006020820190508181036000830152611dbc81611b36565b9050919050565b60006020820190508181036000830152611ddc81611b59565b9050919050565b60006020820190508181036000830152611dfc81611b7c565b9050919050565b60006020820190508181036000830152611e1c81611bc2565b9050919050565b60006020820190508181036000830152611e3c81611be5565b9050919050565b60006020820190508181036000830152611e5c81611c08565b9050919050565b60006020820190508181036000830152611e7c81611c2b565b9050919050565b6000602082019050611e986000830184611c4e565b92915050565b6000604082019050611eb36000830185611c4e565b611ec06020830184611c4e565b9392505050565b600081905092915050565b600082825260208201905092915050565b6000611eee82611f55565b9150611ef983611f55565b925082821015611f0c57611f0b611f7e565b5b828203905092915050565b6000611f2282611f35565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611f7782611f5f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f496e76616c69642072656c617965722061646472657373000000000000000000600082015250565b7f4465706f7369742076616c7565206973206e6f742065786163746c792074686560008201527f2073616d65000000000000000000000000000000000000000000000000000000602082015250565b7f52656c6179657220616c72656164792065786973747300000000000000000000600082015250565b7f447565732063616e277420626520686967686572207468616e2072657175697260008201527f6564206465706f73697400000000000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e64206475657320616d6f756e74000000000000600082015250565b7f526567697374726174696f6e206973206e6f74207075626c6963000000000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e64207265717569726564206465706f7369742060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e64206465706f73697420616d6f756e74000000600082015250565b7f4f6e6c7920476f7665726e616e63652048756220436f6e747261637400000000600082015250565b50565b7f436f6e7472616374206973206e6f7420616c6c6f77656420746f20626520612060008201527f72656c6179657200000000000000000000000000000000000000000000000000602082015250565b7f52656c617965724875623a206e6f6e5265656e7472616e740000000000000000600082015250565b7f52656c61796572206e6f74206578697374730000000000000000000000000000600082015250565b7f5265717569726564204465706f7369742063616e2774206265206c657373207460008201527f68616e2064756573000000000000000000000000000000000000000000000000602082015250565b6122db81611f17565b81146122e657600080fd5b50565b6122f281611f55565b81146122fd57600080fd5b5056fea26469706673582212201358a7351547c2e8a81bd6613fa0001cd36d31921c71a5da450d0be87780e4a464736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000001005": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x6080604052600436106100dd5760003560e01c8063b060b5c91161007f578063c81b166211610059578063c81b16621461026c578063da66b65e14610297578063f9d8c8af146102c2578063fd6a6879146102de576100dd565b8063b060b5c9146101db578063b0ba129014610218578063c13f0e0d14610255576100dd565b806320f5fbb7116100bb57806320f5fbb7146101635780635d9ec2101461018c5780638129fc1c146101a8578063abd96d43146101bf576100dd565b806303860196146100e257806314c1e1f71461010d5780631f0b1c8e14610138575b600080fd5b3480156100ee57600080fd5b506100f7610309565b604051610104919061211f565b60405180910390f35b34801561011957600080fd5b5061012261032f565b60405161012f919061211f565b60405180910390f35b34801561014457600080fd5b5061014d610355565b60405161015a919061211f565b60405180910390f35b34801561016f57600080fd5b5061018a60048036038101906101859190611b78565b61037b565b005b6101a660048036038101906101a19190611c77565b61049f565b005b3480156101b457600080fd5b506101bd6107e1565b005b6101d960048036038101906101d49190611bb4565b610b52565b005b3480156101e757600080fd5b5061020260048036038101906101fd9190611bb4565b610ea2565b60405161020f91906123a2565b60405180910390f35b34801561022457600080fd5b5061023f600480360381019061023a9190611bb4565b610ee5565b60405161024c91906123a2565b60405180910390f35b34801561026157600080fd5b5061026a6111e6565b005b34801561027857600080fd5b506102816114ae565b60405161028e919061211f565b60405180910390f35b3480156102a357600080fd5b506102ac6114d4565b6040516102b9919061211f565b60405180910390f35b6102dc60048036038101906102d79190611bb4565b6114fa565b005b3480156102ea57600080fd5b506102f361176f565b604051610300919061211f565b60405180910390f35b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461040b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161040290612342565b60405180910390fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507faa9d33808a902414231ba2e4657b33f5cee83469964bc14260b5c4bb54378209828260405161049392919061213a565b60405180910390a15050565b600760006104ab611795565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610532576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052990612262565b60405180910390fd5b6000600860008381526020019081526020016000206040518060a0016040529081600082016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600182016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff1615151515815250509050600033905061062e8261179d565b1561066e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066590612302565b60405180910390fd5b600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060009054906101000a900460ff161561070c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070390612282565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060006101000a81548160ff021916908315150217905550600160086000858152602001908152602001600020600201600082825461079c9190612696565b925050819055507ff8a17c9136a3ae33364fac05eb088a3cbafee10c1889c88593e20ee2d8e4eb8881846040516107d4929190612163565b60405180910390a1505050565b60068081905550600160076000733adf64b46e3800e34bbea8d2ebabec560933c83973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600760007370cd4d9dbf88796afbbfccd08cb927ed6d2a603373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160076000737dc6a13f0ab29e299feed9f13b3872845b5716df73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007600073918bcaa269596e84090655b4cc0a51478a275f9f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007600073b12a87bd75a150d20a98d20c49a7b8066078cfd673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007600073c466328ede8793771a0734f50a9089ff05dfaa7073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007600073dd9820fff133ea0039c18ff6a846683d480407d373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016007600073fc88db361c580a9eba12ffe0b6d4ff2545f5a11173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610b506111e6565b565b60076000610b5e611795565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90612262565b60405180910390fd5b6000610bf385858585610ea2565b90506000600860008381526020019081526020016000206040518060a0016040529081600082016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600182016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff1615151515815250509050610cec8161179d565b15610d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2390612302565b60405180910390fd5b610d35816117b7565b610d74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6b906122e2565b60405180910390fd5b600060086000848152602001908152602001600020905060018160030160006101000a81548160ff021916908315150217905550610dc6610db4436117ca565b8260010161182190919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663abd96d43888888886040518563ffffffff1660e01b8152600401610e2794939291906121e6565b600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050507f4e86ad0da28cbaaaa7e93e36c43b32696e970535225b316f1b84fbf30bdc04e8610e82611795565b84604051610e91929190612163565b60405180910390a150505050505050565b60008484848480519060200120604051602001610ec2949392919061218c565b6040516020818303038152906040528051906020012060001c9050949350505050565b600060076000610ef3611795565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610f7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7190612262565b60405180910390fd5b6000610f8886868686610ea2565b90508451865114610fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc590612362565b60405180910390fd5b8351865114611012576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100990612362565b60405180910390fd5b6000865111611056576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104d906122a2565b60405180910390fd5b60006008600083815260200190815260200160002090506110b6816000016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050611850565b6110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90612382565b60405180910390fd5b6000611100436117ca565b9050611118818360000161182190919063ffffffff16565b7f67f26458a934adcc2cf5cd4649edad3b45597dd9ee9a39f88ca9584b494d45c083611142611795565b8a8a8c5167ffffffffffffffff811115611185577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156111b857816020015b60608152602001906001900390816111a35790505b508b878c6040516111d09897969594939291906123bd565b60405180910390a1829350505050949350505050565b60008060019054906101000a900460ff161590508080156112175750600160008054906101000a900460ff1660ff16105b8061124457506112263061186a565b1580156112435750600160008054906101000a900460ff1660ff16145b5b611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127a906122c2565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156112c0576001600060016101000a81548160ff0219169083151502179055505b611001600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080156114ab5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516114a29190612247565b60405180910390a15b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60076000611506611795565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661158d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158490612262565b60405180910390fd5b600061159b85858585610ea2565b90506000600860008381526020019081526020016000206040518060a0016040529081600082016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600182016040518060200160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815250508152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff16151515158152505090506116948161179d565b156116d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cb90612302565b60405180910390fd5b600060086000848152602001908152602001600020905060018160030160016101000a81548160ff021916908315150217905550611726611714436117ca565b8260010161182190919063ffffffff16565b7feb3c1becb36f6acda56406702d22cbd8df91088c0697e3ce94ae393b5d449a6561174f611795565b8460405161175e929190612163565b60405180910390a150505050505050565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60008160600151806117b0575081608001515b9050919050565b6000600654826040015110159050919050565b600067ffffffffffffffff8016821115611819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181090612322565b60405180910390fd5b819050919050565b808260000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050565b600080826000015167ffffffffffffffff16149050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60006118a061189b84612483565b61245e565b905080838252602082019050828560208602820111156118bf57600080fd5b60005b858110156118ef57816118d58882611a67565b8452602084019350602083019250506001810190506118c2565b5050509392505050565b600061190c611907846124af565b61245e565b9050808382526020820190508285602086028201111561192b57600080fd5b60005b8581101561197557813567ffffffffffffffff81111561194d57600080fd5b80860161195a8982611b0f565b8552602085019450602084019350505060018101905061192e565b5050509392505050565b600061199261198d846124db565b61245e565b905080838252602082019050828560208602820111156119b157600080fd5b60005b858110156119e157816119c78882611b63565b8452602084019350602083019250506001810190506119b4565b5050509392505050565b60006119fe6119f984612507565b61245e565b905082815260208101848484011115611a1657600080fd5b611a21848285612783565b509392505050565b6000611a3c611a3784612538565b61245e565b905082815260208101848484011115611a5457600080fd5b611a5f848285612783565b509392505050565b600081359050611a7681612b09565b92915050565b600082601f830112611a8d57600080fd5b8135611a9d84826020860161188d565b91505092915050565b600082601f830112611ab757600080fd5b8135611ac78482602086016118f9565b91505092915050565b600082601f830112611ae157600080fd5b8135611af184826020860161197f565b91505092915050565b600081359050611b0981612b20565b92915050565b600082601f830112611b2057600080fd5b8135611b308482602086016119eb565b91505092915050565b600082601f830112611b4a57600080fd5b8135611b5a848260208601611a29565b91505092915050565b600081359050611b7281612b37565b92915050565b60008060408385031215611b8b57600080fd5b6000611b9985828601611a67565b9250506020611baa85828601611afa565b9150509250929050565b60008060008060808587031215611bca57600080fd5b600085013567ffffffffffffffff811115611be457600080fd5b611bf087828801611a7c565b945050602085013567ffffffffffffffff811115611c0d57600080fd5b611c1987828801611ad0565b935050604085013567ffffffffffffffff811115611c3657600080fd5b611c4287828801611aa6565b925050606085013567ffffffffffffffff811115611c5f57600080fd5b611c6b87828801611b39565b91505092959194509250565b600060208284031215611c8957600080fd5b6000611c9784828501611b63565b91505092915050565b6000611cac8383611cf8565b60208301905092915050565b6000611cc48383611eda565b905092915050565b6000611cd88383611f22565b905092915050565b6000611cec83836120f2565b60208301905092915050565b611d01816126ec565b82525050565b611d10816126ec565b82525050565b6000611d21826125a9565b611d2b818561261f565b9350611d3683612569565b8060005b83811015611d67578151611d4e8882611ca0565b9750611d59836125eb565b925050600181019050611d3a565b5085935050505092915050565b6000611d7f826125b4565b611d898185612630565b935083602082028501611d9b85612579565b8060005b85811015611dd75784840389528151611db88582611cb8565b9450611dc3836125f8565b925060208a01995050600181019050611d9f565b50829750879550505050505092915050565b6000611df4826125bf565b611dfe8185612641565b935083602082028501611e1085612589565b8060005b85811015611e4c5784840389528151611e2d8582611ccc565b9450611e3883612605565b925060208a01995050600181019050611e14565b50829750879550505050505092915050565b6000611e69826125ca565b611e738185612652565b9350611e7e83612599565b8060005b83811015611eaf578151611e968882611ce0565b9750611ea183612612565b925050600181019050611e82565b5085935050505092915050565b611ec5816126fe565b82525050565b611ed48161270a565b82525050565b6000611ee5826125d5565b611eef8185612663565b9350611eff818560208601612792565b611f0881612854565b840191505092915050565b611f1c8161275f565b82525050565b6000611f2d826125e0565b611f378185612674565b9350611f47818560208601612792565b611f5081612854565b840191505092915050565b6000611f66826125e0565b611f708185612685565b9350611f80818560208601612792565b611f8981612854565b840191505092915050565b6000611fa1601983612685565b9150611fac82612865565b602082019050919050565b6000611fc4603583612685565b9150611fcf8261288e565b604082019050919050565b6000611fe7601d83612685565b9150611ff2826128dd565b602082019050919050565b600061200a602e83612685565b915061201582612906565b604082019050919050565b600061202d602183612685565b915061203882612955565b604082019050919050565b6000612050603783612685565b915061205b826129a4565b604082019050919050565b6000612073602683612685565b915061207e826129f3565b604082019050919050565b6000612096601c83612685565b91506120a182612a42565b602082019050919050565b60006120b9602983612685565b91506120c482612a6b565b604082019050919050565b60006120dc602983612685565b91506120e782612aba565b604082019050919050565b6120fb81612734565b82525050565b61210a81612734565b82525050565b61211981612771565b82525050565b60006020820190506121346000830184611d07565b92915050565b600060408201905061214f6000830185611d07565b61215c6020830184611ebc565b9392505050565b60006040820190506121786000830185611d07565b6121856020830184612101565b9392505050565b600060808201905081810360008301526121a68187611d16565b905081810360208301526121ba8186611e5e565b905081810360408301526121ce8185611d74565b90506121dd6060830184611ecb565b95945050505050565b600060808201905081810360008301526122008187611d16565b905081810360208301526122148186611e5e565b905081810360408301526122288185611d74565b9050818103606083015261223c8184611f5b565b905095945050505050565b600060208201905061225c6000830184611f13565b92915050565b6000602082019050818103600083015261227b81611f94565b9050919050565b6000602082019050818103600083015261229b81611fb7565b9050919050565b600060208201905081810360008301526122bb81611fda565b9050919050565b600060208201905081810360008301526122db81611ffd565b9050919050565b600060208201905081810360008301526122fb81612020565b9050919050565b6000602082019050818103600083015261231b81612043565b9050919050565b6000602082019050818103600083015261233b81612066565b9050919050565b6000602082019050818103600083015261235b81612089565b9050919050565b6000602082019050818103600083015261237b816120ac565b9050919050565b6000602082019050818103600083015261239b816120cf565b9050919050565b60006020820190506123b76000830184612101565b92915050565b6000610100820190506123d3600083018b612101565b6123e0602083018a611d07565b81810360408301526123f28189611d16565b905081810360608301526124068188611e5e565b9050818103608083015261241a8187611de9565b905081810360a083015261242e8186611d74565b905061243d60c0830185612110565b81810360e083015261244f8184611f5b565b90509998505050505050505050565b6000612468612479565b905061247482826127c5565b919050565b6000604051905090565b600067ffffffffffffffff82111561249e5761249d612825565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156124ca576124c9612825565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156124f6576124f5612825565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561252257612521612825565b5b61252b82612854565b9050602081019050919050565b600067ffffffffffffffff82111561255357612552612825565b5b61255c82612854565b9050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126a182612734565b91506126ac83612734565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126e1576126e06127f6565b5b828201905092915050565b60006126f782612714565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b600061276a82612752565b9050919050565b600061277c8261273e565b9050919050565b82818337600083830152505050565b60005b838110156127b0578082015181840152602081019050612795565b838111156127bf576000848401525b50505050565b6127ce82612854565b810181811067ffffffffffffffff821117156127ed576127ec612825565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f506f736974696f6e41646d696e3a206f6e6c795369676e657200000000000000600082015250565b7f506f736974696f6e41646d696e3a207369676e657220616c726561647920736960008201527f676e65642074686973207472616e73616374696f6e0000000000000000000000602082015250565b7f506f736974696f6e41646d696e3a20656d7074792070726f706f73616c000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f506f736974696f6e41646d696e3a206e6f7420726561636865642071756f727560008201527f6d00000000000000000000000000000000000000000000000000000000000000602082015250565b7f506f736974696f6e41646d696e3a207472616e73616374696f6e20616c72656160008201527f6479206578656375746564206f722063616e63656c6564000000000000000000602082015250565b7f53616665436173743a2076616c756520646f65736e27742066697420696e203660008201527f3420626974730000000000000000000000000000000000000000000000000000602082015250565b7f4f6e6c7920476f7665726e616e63652048756220436f6e747261637400000000600082015250565b7f506f736974696f6e41646d696e3a20696e76616c6964207472616e736163746960008201527f6f6e206c656e6774680000000000000000000000000000000000000000000000602082015250565b7f506f736974696f6e41646d696e3a207472616e73616374696f6e20616c72656160008201527f6479206578697374730000000000000000000000000000000000000000000000602082015250565b612b12816126ec565b8114612b1d57600080fd5b50565b612b29816126fe565b8114612b3457600080fd5b50565b612b4081612734565b8114612b4b57600080fd5b5056fea2646970667358221220bf4d837bfedd8b835165f8c6b51703ea32cb215e1425920e339805d93abe4d6664736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000001006": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x608060405234801561001057600080fd5b50600436106100415760003560e01c80634c1ce902146100465780638129fc1c14610062578063f7bc32d01461006c575b600080fd5b610060600480360381019061005b9190610400565b61008a565b005b61006a61017c565b005b610074610305565b6040516100819190610529565b60405180910390f35b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663541d5548326040518263ffffffff1660e01b81526004016100e5919061050e565b60206040518083038186803b1580156100fd57600080fd5b505afa158015610111573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061013591906103d7565b610174576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161016b9061055f565b60405180910390fd5b505050505050565b60008060019054906101000a900460ff161590508080156101ad5750600160008054906101000a900460ff1660ff16105b806101da57506101bc3061032b565b1580156101d95750600160008054906101000a900460ff1660ff16145b5b610219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102109061057f565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610256576001600060016101000a81548160ff0219169083151502179055505b611004600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004600181905550605560028190555080156103025760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516102f99190610544565b60405180910390a15b50565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60008151905061035d816106bd565b92915050565b600081359050610372816106d4565b92915050565b60008083601f84011261038a57600080fd5b8235905067ffffffffffffffff8111156103a357600080fd5b6020830191508360018202830111156103bb57600080fd5b9250929050565b6000813590506103d1816106eb565b92915050565b6000602082840312156103e957600080fd5b60006103f78482850161034e565b91505092915050565b6000806000806000806080878903121561041957600080fd5b600061042789828a016103c2565b965050602061043889828a01610363565b955050604087013567ffffffffffffffff81111561045557600080fd5b61046189828a01610378565b9450945050606087013567ffffffffffffffff81111561048057600080fd5b61048c89828a01610378565b92509250509295509295509295565b6104a4816105b0565b82525050565b6104b38161060f565b82525050565b6104c281610633565b82525050565b60006104d560148361059f565b91506104e082610645565b602082019050919050565b60006104f8602e8361059f565b91506105038261066e565b604082019050919050565b6000602082019050610523600083018461049b565b92915050565b600060208201905061053e60008301846104aa565b92915050565b600060208201905061055960008301846104b9565b92915050565b60006020820190508181036000830152610578816104c8565b9050919050565b60006020820190508181036000830152610598816104eb565b9050919050565b600082825260208201905092915050565b60006105bb826105d8565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061061a82610621565b9050919050565b600061062c826105d8565b9050919050565b600061063e82610602565b9050919050565b7f5369676e65722069736e27742072656c61796572000000000000000000000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6106c6816105c2565b81146106d157600080fd5b50565b6106dd816105ce565b81146106e857600080fd5b50565b6106f4816105f8565b81146106ff57600080fd5b5056fea264697066735822122010f085d376bd6cb9198895b4b7407e37278f6d4ac443c71a1eac0f8918cb169264736f6c63430008040033"),
	},
	"0x0000000000000000000000000000000000002000": {

		Balance: new(big.Int),
		Code:    common.FromHex("0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638129fc1c116100ad578063c81b166211610071578063c81b166214610298578063da3a2af4146102b6578063da66b65e146102d2578063f2fde38b146102f0578063fd6a68791461030c57610121565b80638129fc1c1461022e5780638da5cb5b1461023857806392b2c33514610256578063b283209614610272578063c13f0e0d1461028e57610121565b806319836dc7116100f457806319836dc7146101b05780631f0b1c8e146101cc57806340884052146101ea578063439160df14610206578063715018a61461022457610121565b806303860196146101265780630a3ef1f2146101445780631101b8f01461017457806314c1e1f714610192575b600080fd5b61012e61032a565b60405161013b9190611e72565b60405180910390f35b61015e600480360381019061015991906116cd565b610350565b60405161016b91906120cf565b60405180910390f35b61017c610368565b60405161018991906120cf565b60405180910390f35b61019a61036e565b6040516101a79190611e72565b60405180910390f35b6101ca60048036038101906101c5919061182a565b610394565b005b6101d461047a565b6040516101e19190611e72565b60405180910390f35b61020460048036038101906101ff91906118d2565b6104a0565b005b61020e610792565b60405161021b91906120cf565b60405180910390f35b61022c610798565b005b6102366107ac565b005b6102406108ad565b60405161024d9190611e72565b60405180910390f35b610270600480360381019061026b9190611866565b6108d6565b005b61028c6004803603810190610287919061182a565b610973565b005b610296610b0d565b005b6102a0610dda565b6040516102ad9190611e72565b60405180910390f35b6102d060048036038101906102cb91906117d8565b610e00565b005b6102da610e41565b6040516102e79190611e72565b60405180910390f35b61030a600480360381019061030591906116a4565b610e67565b005b610314610eeb565b6040516103219190611e72565b60405180910390f35b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b600a5481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041b9061202f565b60405180910390fd5b806008600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104b1868660095487878787610f11565b6000806000806000606089898101906104ca91906116f6565b809650819750829850839950849a50859b505050505050506000600b60008881526020019081526020016000205414610538576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052f906120af565b60405180910390fd5b42851061057a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105719061208f565b60405180910390fd5b42600a54866105899190612214565b116105c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c090611fcf565b60405180910390fd5b84600b600088815260200190815260200160002081905550600c548314610625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061c9061206f565b60405180910390fd5b6000610632828e87611102565b9050600060608473ffffffffffffffffffffffffffffffffffffffff168360405161065d9190611d0d565b6000604051808303816000865af19150503d806000811461069a576040519150601f19603f3d011682016040523d82523d6000602084013e61069f565b606091505b508092508193505050816106b282611150565b906106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea9190611f2d565b60405180910390fd5b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663092193ab336040518263ffffffff1660e01b815260040161074f9190611e8d565b600060405180830381600087803b15801561076957600080fd5b505af115801561077d573d6000803e3d6000fd5b50505050505050505050505050505050505050565b600c5481565b6107a0611207565b6107aa6000611285565b565b62015180600a81905550620dbba0600c819055507f59f736dc5e15c4b12526487502645403b0a4316d82eba7e9ecdc2a050c10ad27600981905550730b35e3bb33ab2f5f6b62840a288852573081289f600860006038815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611006600760006038815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108ab610b0d565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600d60008154809291906108e9906123b9565b9190505550600042600c5486868686600d546040516020016109119796959493929190611e04565b6040516020818303038152906040528051906020012090507f59f736dc5e15c4b12526487502645403b0a4316d82eba7e9ecdc2a050c10ad27814233888888886040516109649796959493929190611ea8565b60405180910390a15050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fa9061202f565b60405180910390fd5b6000821415610a47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3e90611f8f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ab7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aae9061204f565b60405180910390fd5b806007600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60008060159054906101000a900460ff16159050808015610b4057506001600060149054906101000a900460ff1660ff16105b80610b6f5750610b4f30611349565b158015610b6e57506001600060149054906101000a900460ff1660ff16145b5b610bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba590611faf565b60405180910390fd5b6001600060146101000a81548160ff021916908360ff1602179055508015610bec576001600060156101000a81548160ff0219169083151502179055505b611001600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611002600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611003600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611004600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611005600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508015610dd75760008060156101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610dce9190611f12565b60405180910390a15b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600a819055507fa1435306f24583ece3c0b009cea41e6769328a54410e2cae565f41b13920513581604051610e3691906120cf565b60405180910390a150565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e6f611207565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610edf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed690611f4f565b60405180910390fd5b610ee881611285565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006007600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610fb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb090611f6f565b60405180910390fd5b6008600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161461105a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110519061200f565b60405180910390fd5b60008888888888604051602001611075959493929190611db8565b60405160208183030381529060405290508173ffffffffffffffffffffffffffffffffffffffff16634c1ce9028a898488886040518663ffffffff1660e01b81526004016110c79594939291906120ea565b60006040518083038186803b1580156110df57600080fd5b505afa1580156110f3573d6000803e3d6000fd5b50505050505050505050505050565b6060838383604051602001611118929190611d8c565b604051602081830303815290604052604051602001611138929190611d24565b60405160208183030381529060405290509392505050565b606060248251101561118c57611166825161136c565b6040516020016111769190611d48565b6040516020818303038152906040529050611202565b60006044835110905060048301925080156111ea576000838060200190518101906111b79190611801565b90506111c28161136c565b6040516020016111d29190611d6a565b60405160208183030381529060405292505050611202565b828060200190518101906111fe9190611797565b9150505b919050565b61120f611519565b73ffffffffffffffffffffffffffffffffffffffff1661122d6108ad565b73ffffffffffffffffffffffffffffffffffffffff1614611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127a90611fef565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606060008214156113b4576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050611514565b600082905060005b600082146113e65780806113cf906123b9565b915050600a826113df919061226a565b91506113bc565b60008167ffffffffffffffff811115611428577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f19166020018201604052801561145a5781602001600182028036833780820191505090505b5090505b6000851461150d57600182611473919061229b565b9150600a85611482919061243a565b603061148e9190612214565b60f81b8183815181106114ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85611506919061226a565b945061145e565b8093505050505b919050565b600033905090565b600061153461152f84612164565b61213f565b90508281526020810184848401111561154c57600080fd5b611557848285612346565b509392505050565b600061157261156d84612195565b61213f565b90508281526020810184848401111561158a57600080fd5b611595848285612355565b509392505050565b6000813590506115ac81612838565b92915050565b6000813590506115c18161284f565b92915050565b6000813590506115d681612866565b92915050565b60008083601f8401126115ee57600080fd5b8235905067ffffffffffffffff81111561160757600080fd5b60208301915083600182028301111561161f57600080fd5b9250929050565b600082601f83011261163757600080fd5b8135611647848260208601611521565b91505092915050565b600082601f83011261166157600080fd5b815161167184826020860161155f565b91505092915050565b6000813590506116898161287d565b92915050565b60008151905061169e8161287d565b92915050565b6000602082840312156116b657600080fd5b60006116c48482850161159d565b91505092915050565b6000602082840312156116df57600080fd5b60006116ed848285016115c7565b91505092915050565b60008060008060008060c0878903121561170f57600080fd5b600061171d89828a016115c7565b965050602061172e89828a0161167a565b955050604061173f89828a016115b2565b945050606061175089828a0161167a565b935050608061176189828a016115b2565b92505060a087013567ffffffffffffffff81111561177e57600080fd5b61178a89828a01611626565b9150509295509295509295565b6000602082840312156117a957600080fd5b600082015167ffffffffffffffff8111156117c357600080fd5b6117cf84828501611650565b91505092915050565b6000602082840312156117ea57600080fd5b60006117f88482850161167a565b91505092915050565b60006020828403121561181357600080fd5b60006118218482850161168f565b91505092915050565b6000806040838503121561183d57600080fd5b600061184b8582860161167a565b925050602061185c8582860161159d565b9150509250929050565b6000806000806060858703121561187c57600080fd5b600061188a8782880161167a565b945050602061189b8782880161159d565b935050604085013567ffffffffffffffff8111156118b857600080fd5b6118c4878288016115dc565b925092505092959194509250565b600080600080600080608087890312156118eb57600080fd5b60006118f989828a0161167a565b965050602061190a89828a0161159d565b955050604087013567ffffffffffffffff81111561192757600080fd5b61193389828a016115dc565b9450945050606087013567ffffffffffffffff81111561195257600080fd5b61195e89828a016115dc565b92509250509295509295509295565b611976816122e1565b82525050565b611985816122cf565b82525050565b61199c611997826122cf565b612402565b82525050565b6119ab816122f3565b82525050565b6119c26119bd826122f3565b612414565b82525050565b60006119d483856121dc565b93506119e1838584612346565b6119ea836124f8565b840190509392505050565b6000611a0183856121ed565b9350611a0e838584612346565b82840190509392505050565b6000611a25826121c6565b611a2f81856121dc565b9350611a3f818560208601612355565b611a48816124f8565b840191505092915050565b6000611a5e826121c6565b611a6881856121ed565b9350611a78818560208601612355565b80840191505092915050565b611a8d81612334565b82525050565b6000611a9e826121d1565b611aa881856121f8565b9350611ab8818560208601612355565b611ac1816124f8565b840191505092915050565b6000611ad7826121d1565b611ae18185612209565b9350611af1818560208601612355565b80840191505092915050565b6000611b0a6026836121f8565b9150611b1582612516565b604082019050919050565b6000611b2d6025836121f8565b9150611b3882612565565b604082019050919050565b6000611b506015836121f8565b9150611b5b826125b4565b602082019050919050565b6000611b73602e836121f8565b9150611b7e826125dd565b604082019050919050565b6000611b96602883612209565b9150611ba18261262c565b602882019050919050565b6000611bb96010836121f8565b9150611bc48261267b565b602082019050919050565b6000611bdc6020836121f8565b9150611be7826126a4565b602082019050919050565b6000611bff6025836121f8565b9150611c0a826126cd565b604082019050919050565b6000611c22601c836121f8565b9150611c2d8261271c565b602082019050919050565b6000611c456018836121f8565b9150611c5082612745565b602082019050919050565b6000611c68600783612209565b9150611c738261276e565b600782019050919050565b6000611c8b6023836121f8565b9150611c9682612797565b604082019050919050565b6000611cae6020836121f8565b9150611cb9826127e6565b602082019050919050565b6000611cd1601a836121f8565b9150611cdc8261280f565b602082019050919050565b611cf08161231d565b82525050565b611d07611d028261231d565b612430565b82525050565b6000611d198284611a53565b915081905092915050565b6000611d308285611a53565b9150611d3c8284611a53565b91508190509392505050565b6000611d5382611b89565b9150611d5f8284611acc565b915081905092915050565b6000611d7582611c5b565b9150611d818284611acc565b915081905092915050565b6000611d988285611cf6565b602082019150611da8828461198b565b6014820191508190509392505050565b6000611dc48288611cf6565b602082019150611dd4828761198b565b601482019150611de482866119b1565b602082019150611df58284866119f5565b91508190509695505050505050565b6000611e10828a611cf6565b602082019150611e208289611cf6565b602082019150611e308288611cf6565b602082019150611e40828761198b565b601482019150611e518285876119f5565b9150611e5d8284611cf6565b60208201915081905098975050505050505050565b6000602082019050611e87600083018461197c565b92915050565b6000602082019050611ea2600083018461196d565b92915050565b600060c082019050611ebd600083018a6119a2565b611eca6020830189611ce7565b611ed7604083018861197c565b611ee46060830187611ce7565b611ef1608083018661197c565b81810360a0830152611f048184866119c8565b905098975050505050505050565b6000602082019050611f276000830184611a84565b92915050565b60006020820190508181036000830152611f478184611a93565b905092915050565b60006020820190508181036000830152611f6881611afd565b9050919050565b60006020820190508181036000830152611f8881611b20565b9050919050565b60006020820190508181036000830152611fa881611b43565b9050919050565b60006020820190508181036000830152611fc881611b66565b9050919050565b60006020820190508181036000830152611fe881611bac565b9050919050565b6000602082019050818103600083015261200881611bcf565b9050919050565b6000602082019050818103600083015261202881611bf2565b9050919050565b6000602082019050818103600083015261204881611c15565b9050919050565b6000602082019050818103600083015261206881611c38565b9050919050565b6000602082019050818103600083015261208881611c7e565b9050919050565b600060208201905081810360008301526120a881611ca1565b9050919050565b600060208201905081810360008301526120c881611cc4565b9050919050565b60006020820190506120e46000830184611ce7565b92915050565b60006080820190506120ff6000830188611ce7565b61210c60208301876119a2565b818103604083015261211e8186611a1a565b905081810360608301526121338184866119c8565b90509695505050505050565b600061214961215a565b90506121558282612388565b919050565b6000604051905090565b600067ffffffffffffffff82111561217f5761217e6124c9565b5b612188826124f8565b9050602081019050919050565b600067ffffffffffffffff8211156121b0576121af6124c9565b5b6121b9826124f8565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b600061221f8261231d565b915061222a8361231d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561225f5761225e61246b565b5b828201905092915050565b60006122758261231d565b91506122808361231d565b9250826122905761228f61249a565b5b828204905092915050565b60006122a68261231d565b91506122b18361231d565b9250828210156122c4576122c361246b565b5b828203905092915050565b60006122da826122fd565b9050919050565b60006122ec826122fd565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061233f82612327565b9050919050565b82818337600083830152505050565b60005b83811015612373578082015181840152602081019050612358565b83811115612382576000848401525b50505050565b612391826124f8565b810181811067ffffffffffffffff821117156123b0576123af6124c9565b5b80604052505050565b60006123c48261231d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156123f7576123f661246b565b5b600182019050919050565b600061240d8261241e565b9050919050565b6000819050919050565b600061242982612509565b9050919050565b6000819050919050565b60006124458261231d565b91506124508361231d565b9250826124605761245f61249a565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4e6f207265676973746572656420766572696669657220666f7220626c6f636b60008201527f636861696e000000000000000000000000000000000000000000000000000000602082015250565b7f496e76616c696420626c6f636b636861696e2069640000000000000000000000600082015250565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b7f52657665727420666f7220756e6b6e6f776e206572726f722e204572726f722060008201527f6c656e6774683a20000000000000000000000000000000000000000000000000602082015250565b7f4576656e7420697320746f6f206f6c6400000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f44617461206e6f7420656d697474656420627920617070726f76656420636f6e60008201527f7472616374000000000000000000000000000000000000000000000000000000602082015250565b7f4f6e6c7920476f7665726e616e63652048756220436f6e747261637400000000600082015250565b7f496e76616c696420766572696669657220616464726573730000000000000000600082015250565b7f50616e69633a2000000000000000000000000000000000000000000000000000600082015250565b7f496e636f72726563742064657374696e6174696f6e20626c6f636b636861696e60008201527f2069640000000000000000000000000000000000000000000000000000000000602082015250565b7f4576656e742074696d657374616d7020697320696e2074686520667574757265600082015250565b7f5472616e73616374696f6e20616c726561647920657869737473000000000000600082015250565b612841816122cf565b811461284c57600080fd5b50565b612858816122e1565b811461286357600080fd5b50565b61286f816122f3565b811461287a57600080fd5b50565b6128868161231d565b811461289157600080fd5b5056fea264697066735822122001b860343935ef9bd27f5a073eb4f322cca1b13db3d445a654c87996ba7b931964736f6c63430008040033"),
	},
}
View Source
var GenesisAllocTestnet = map[string]GenesisAccount{
	"0xf9778193a0085bE6FF60D4362887E8D9921e19cB": {
		Balance: toStorableBalance(GenesisTestFoundationBalance),
	},
}

Functions

func ApplyIncomingReceipt

func ApplyIncomingReceipt(
	config *params.ChainConfig, db *state.DB,
	header *block.Header, cxp *types.CXReceiptsProof,
) error

ApplyIncomingReceipt will add amount into ToAddress in the receipt

func ApplyStakingMessage

func ApplyStakingMessage(evm *vm.EVM, msg Message, gp *GasPool, bc ChainContext) (uint64, error)

ApplyStakingMessage computes the new state for staking message

func ApplyStakingTransaction

func ApplyStakingTransaction(
	config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.DB,
	header *block.Header, tx *staking.StakingTransaction, usedGas *uint64, cfg vm.Config) (receipt *types.Receipt, gas uint64, err error)

ApplyStakingTransaction attempts to apply a staking transaction to the given state database and uses the input parameters for its environment. It returns the receipt for the staking transaction, gas used and an error if the transaction failed, indicating the block was invalid. staking transaction will use the code field in the account to store the staking information

func ApplyTransaction

func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.DB, header *block.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, *types.CXReceipt, []staking.StakeMsg, uint64, error)

ApplyTransaction attempts to apply a transaction to the given state database and uses the input parameters for its environment. It returns the receipt for the transaction, gas used and an error if the transaction failed, indicating the block was invalid.

func CalcGasLimit

func CalcGasLimit(parent *types.Block, gasFloor, gasCeil uint64) uint64

CalcGasLimit computes the gas limit of the next block after parent. It aims to keep the baseline gas above the provided floor, and increase it towards the ceil if the blocks are full. If the ceil is exceeded, it will always decrease the gas allowance.

func CalculateMigrationGasFn

func CalculateMigrationGasFn(chain ChainContext) vm.CalculateMigrationGasFunc

calculate the gas for migration; no checks done here similar to other functions the checks are handled by staking_verifier.go, ex, if you try to delegate to an address who is not a validator - you will be charged all gas passed in two steps - 22k initially when gas is calculated - remainder when the tx inevitably is a no-op i have followed the same logic here, this only produces an error if can't read from db

func CanTransfer

func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool

CanTransfer checks whether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.

func CollectRewardsFn

func CollectRewardsFn(ref *block.Header, chain ChainContext) vm.CollectRewardsFunc

func CreateValidatorFn

func CreateValidatorFn(ref *block.Header, chain ChainContext) vm.CreateValidatorFunc

HandleStakeMsgFn returns a function which accepts (1) the chain state database (2) the processed staking parameters the function can then be called through the EVM context

func DelegateFn

func DelegateFn(ref *block.Header, chain ChainContext) vm.DelegateFunc

func EditValidatorFn

func EditValidatorFn(ref *block.Header, chain ChainContext) vm.EditValidatorFunc

func EncodeGenesisConfig

func EncodeGenesisConfig(fileName string) string

EncodeGenesisConfig converts json file into binary format for genesis block

func GetHashFn

func GetHashFn(ref *block.Header, chain ChainContext) func(n uint64) common.Hash

GetHashFn returns a GetHashFunc which retrieves header hashes by number

func GetInitialFunds

func GetInitialFunds(shardID uint32) *big.Int

GetInitialFunds for a given shard

func GetVRFFn

func GetVRFFn(ref *block.Header, chain ChainContext) func(n uint64) common.Hash

GetVRFFn returns a GetVRFFn which retrieves header vrf by number

func IsEpochBlock

func IsEpochBlock(block *types.Block) bool

IsEpochBlock returns whether this block is the first block of an epoch. by checking if the previous block is the last block of the previous epoch

func IsValidator

func IsValidator(db vm.StateDB, addr common.Address) bool

IsValidator determines whether it is a validator address or not

func NewEVMContext

func NewEVMContext(msg Message, header *block.Header, chain ChainContext, author *common.Address) vm.Context

NewEVMContext creates a new context for use in the EVM.

func ResolveGenesisAlloc added in v0.0.21

func ResolveGenesisAlloc(netType nodeconfig.NetworkType) map[string]GenesisAccount

func SetReceiptsData

func SetReceiptsData(config *params.ChainConfig, block *types.Block, receipts types.Receipts) error

SetReceiptsData computes all the non-consensus fields of the receipts

func StakingToMessage

func StakingToMessage(
	tx *staking.StakingTransaction, blockNum *big.Int,
) (types.Message, error)

StakingToMessage returns the staking transaction as a core.Message. requires a signer to derive the sender. put it here to avoid cyclic import

func StringToBigInt

func StringToBigInt(s string, base int) *big.Int

StringToBigInt converts a string to BigInt

func Transfer

func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int, txType types.TransactionType)

Transfer subtracts amount from sender and adds amount to recipient using the given Db

func UndelegateFn

func UndelegateFn(ref *block.Header, chain ChainContext) vm.UndelegateFunc

func VerifyAndCollectRewardsFromDelegation

func VerifyAndCollectRewardsFromDelegation(
	stateDB vm.StateDB, delegations []staking.DelegationIndex,
) ([]*staking.ValidatorWrapper, *big.Int, error)

VerifyAndCollectRewardsFromDelegation verifies and collects rewards from the given delegation slice using the stateDB. It returns all of the edited validatorWrappers and the sum total of the rewards.

Note that this function never updates the stateDB, it only reads from stateDB.

func VerifyAndCreateValidatorFromMsg

func VerifyAndCreateValidatorFromMsg(
	stateDB vm.StateDB, chainContext ChainContext, epoch *big.Int, blockNum *big.Int, msg *staking.CreateValidator,
) (*staking.ValidatorWrapper, error)

VerifyAndCreateValidatorFromMsg verifies the create validator message using the stateDB, epoch, & blocknumber and returns the validatorWrapper created in the process.

Note that this function never updates the stateDB, it only reads from stateDB.

func VerifyAndDelegateFromMsg

func VerifyAndDelegateFromMsg(
	stateDB vm.StateDB, epoch *big.Int, msg *staking.Delegate, delegations []staking.DelegationIndex, chainConfig *params.ChainConfig,
) ([]*staking.ValidatorWrapper, *big.Int, map[common.Address]*big.Int, error)

VerifyAndDelegateFromMsg verifies the delegate message using the stateDB and returns the balance to be deducted by the delegator as well as the validatorWrapper with the delegation applied to it.

Note that this function never updates the stateDB, it only reads from stateDB.

func VerifyAndEditValidatorFromMsg

func VerifyAndEditValidatorFromMsg(
	stateDB vm.StateDB, chainContext ChainContext,
	epoch, blockNum *big.Int, msg *staking.EditValidator,
) (*staking.ValidatorWrapper, error)

VerifyAndEditValidatorFromMsg verifies the edit validator message using the stateDB, chainContext and returns the edited validatorWrapper.

Note that this function never updates the stateDB, it only reads from stateDB.

func VerifyAndMigrateFromMsg

func VerifyAndMigrateFromMsg(
	stateDB vm.StateDB,
	msg *staking.MigrationMsg,
	fromDelegations []staking.DelegationIndex,
) ([]*staking.ValidatorWrapper,
	[]interface{},
	error)

VerifyAndMigrateFromMsg verifies and transfers all delegations of msg.From to msg.To. Returns all modified validator wrappers and delegate msgs for metadata Note that this function never updates the stateDB, it only reads from stateDB.

func VerifyAndUndelegateFromMsg

func VerifyAndUndelegateFromMsg(
	stateDB vm.StateDB, epoch *big.Int, msg *staking.Undelegate,
) (*staking.ValidatorWrapper, error)

VerifyAndUndelegateFromMsg verifies the undelegate validator message using the stateDB & chainContext and returns the edited validatorWrapper with the undelegation applied to it.

Note that this function never updates the stateDB, it only reads from stateDB.

Types

type AllowedTxData added in v0.0.21

type AllowedTxData struct {
	To   common.Address
	Data []byte
}

type BadBlock

type BadBlock struct {
	Block  *types.Block
	Reason error
}

BadBlock ..

func (BadBlock) MarshalJSON

func (b BadBlock) MarshalJSON() ([]byte, error)

MarshalJSON ..

type BlockChain

type BlockChain interface {
	// ValidateNewBlock validates new block.
	ValidateNewBlock(block *types.Block) error
	// SetHead rewinds the local chain to a new head. In the case of headers, everything
	// above the new head will be deleted and the new one set. In the case of blocks
	// though, the head may be further rewound if block bodies are missing (non-archive
	// nodes after a fast sync).
	SetHead(head uint64) error
	// ShardID returns the shard Id of the blockchain.
	ShardID() uint32
	// CurrentBlock retrieves the current head block of the canonical chain. The
	// block is retrieved from the blockchain's internal cache.
	CurrentBlock() *types.Block
	// Validator returns the current validator.
	Validator() Validator
	// Processor returns the current processor.
	Processor() Processor
	// State returns a new mutable state based on the current HEAD block.
	State() (*state.DB, error)
	// StateAt returns a new mutable state based on a particular point in time.
	StateAt(root common.Hash) (*state.DB, error)
	// HasBlock checks if a block is fully present in the database or not.
	HasBlock(hash common.Hash, number uint64) bool
	// HasState checks if state trie is fully present in the database or not.
	HasState(hash common.Hash) bool
	// HasBlockAndState checks if a block and associated state trie is fully present
	// in the database or not, caching it if present.
	HasBlockAndState(hash common.Hash, number uint64) bool
	// GetBlock retrieves a block from the database by hash and number,
	// caching it if found.
	GetBlock(hash common.Hash, number uint64) *types.Block
	// GetBlockByHash retrieves a block from the database by hash, caching it if found.
	GetBlockByHash(hash common.Hash) *types.Block
	// GetBlockByNumber retrieves a block from the database by number, caching it
	// (associated with its hash) if found.
	GetBlockByNumber(number uint64) *types.Block
	// GetReceiptsByHash retrieves the receipts for all transactions in a given block.
	GetReceiptsByHash(hash common.Hash) types.Receipts
	// Stop stops the blockchain service. If any imports are currently in progress
	// it will abort them using the procInterrupt.
	Stop()
	// Rollback is designed to remove a chain of links from the database that aren't
	// certain enough to be valid.
	Rollback(chain []common.Hash) error
	// WriteBlockWithoutState writes only the block and its metadata to the database,
	// but does not write any state. This is used to construct competing side forks
	// up to the point where they exceed the canonical total difficulty.
	WriteBlockWithoutState(block *types.Block, td *big.Int) (err error)
	// WriteBlockWithState writes the block and all associated state to the database.
	WriteBlockWithState(
		block *types.Block, receipts []*types.Receipt,
		cxReceipts []*types.CXReceipt,
		stakeMsgs []types2.StakeMsg,
		paid reward.Reader,
		state *state.DB,
	) (status WriteStatus, err error)
	// GetMaxGarbageCollectedBlockNumber ..
	GetMaxGarbageCollectedBlockNumber() int64
	// InsertChain attempts to insert the given batch of blocks in to the canonical
	// chain or, otherwise, create a fork. If an error is returned it will return
	// the index number of the failing block as well an error describing what went
	// wrong.
	//
	// After insertion is done, all accumulated events will be fired.
	InsertChain(chain types.Blocks, verifyHeaders bool) (int, error)
	// BadBlocks returns a list of the last 'bad blocks' that
	// the client has seen on the network.
	BadBlocks() []BadBlock
	// CurrentHeader retrieves the current head header of the canonical chain. The
	// header is retrieved from the HeaderChain's internal cache.
	CurrentHeader() *block.Header
	// GetHeader retrieves a block header from the database by hash and number,
	// caching it if found.
	GetHeader(hash common.Hash, number uint64) *block.Header
	// GetHeaderByHash retrieves a block header from the database by hash, caching it if
	// found.
	GetHeaderByHash(hash common.Hash) *block.Header
	// GetCanonicalHash returns the canonical hash for a given block number.
	GetCanonicalHash(number uint64) common.Hash
	// GetHeaderByNumber retrieves a block header from the database by number,
	// caching it (associated with its hash) if found.
	GetHeaderByNumber(number uint64) *block.Header
	// Config retrieves the blockchain's chain configuration.
	Config() *params.ChainConfig
	// Engine retrieves the blockchain's consensus engine.
	Engine() engine.Engine
	// SubscribeRemovedLogsEvent registers a subscription of RemovedLogsEvent.
	SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription
	// SubscribeTraceEvent registers a subscription of ChainEvent.
	SubscribeTraceEvent(ch chan<- TraceEvent) event.Subscription
	// SubscribeChainEvent registers a subscription of ChainEvent.
	SubscribeChainEvent(ch chan<- ChainEvent) event.Subscription
	// SubscribeChainHeadEvent registers a subscription of ChainHeadEvent.
	SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription
	// SubscribeChainSideEvent registers a subscription of ChainSideEvent.
	SubscribeChainSideEvent(ch chan<- ChainSideEvent) event.Subscription
	// SubscribeLogsEvent registers a subscription of []*types.Log.
	SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
	// ReadShardState retrieves sharding state given the epoch number.
	ReadShardState(epoch *big.Int) (*shard.State, error)
	// WriteShardStateBytes saves the given sharding state under the given epoch number.
	WriteShardStateBytes(db rawdb.DatabaseWriter,
		epoch *big.Int, shardState []byte,
	) (*shard.State, error)
	// WriteHeadBlock writes head block.
	WriteHeadBlock(block *types.Block) error
	// ReadCommitSig retrieves the commit signature on a block.
	ReadCommitSig(blockNum uint64) ([]byte, error)
	// WriteCommitSig saves the commits signatures signed on a block.
	WriteCommitSig(blockNum uint64, lastCommits []byte) error
	// GetVdfByNumber retrieves the rand seed given the block number, return 0 if not exist.
	GetVdfByNumber(number uint64) []byte
	// GetVrfByNumber retrieves the randomness preimage given the block number, return 0 if not exist
	GetVrfByNumber(number uint64) []byte
	// ChainDb returns the database.
	ChainDb() ethdb.Database
	// GetEpochBlockNumber returns the first block number of the given epoch.
	GetEpochBlockNumber(epoch *big.Int) (*big.Int, error)
	// StoreEpochBlockNumber stores the given epoch-first block number.
	StoreEpochBlockNumber(
		epoch *big.Int, blockNum *big.Int,
	) error
	// ReadEpochVrfBlockNums retrieves block numbers with valid VRF for the specified epoch.
	ReadEpochVrfBlockNums(epoch *big.Int) ([]uint64, error)
	// WriteEpochVrfBlockNums saves block numbers with valid VRF for the specified epoch.
	WriteEpochVrfBlockNums(epoch *big.Int, vrfNumbers []uint64) error
	// ReadEpochVdfBlockNum retrieves block number with valid VDF for the specified epoch.
	ReadEpochVdfBlockNum(epoch *big.Int) (*big.Int, error)
	// WriteEpochVdfBlockNum saves block number with valid VDF for the specified epoch.
	WriteEpochVdfBlockNum(epoch *big.Int, blockNum *big.Int) error
	// WriteCrossLinks saves the hashes of crosslinks by shardID and blockNum combination key.
	WriteCrossLinks(batch rawdb.DatabaseWriter, cls []types.CrossLink) error
	// DeleteCrossLinks removes the hashes of crosslinks by shardID and blockNum combination key.
	DeleteCrossLinks(cls []types.CrossLink) error
	// ReadCrossLink retrieves crosslink given shardID and blockNum.
	ReadCrossLink(shardID uint32, blockNum uint64) (*types.CrossLink, error)
	// LastContinuousCrossLink saves the last crosslink of a shard
	// This function will update the latest crosslink in the sense that
	// any previous block's crosslink is received up to this point
	// there is no missing hole between genesis to this crosslink of given shardID.
	LastContinuousCrossLink(batch rawdb.DatabaseWriter, shardID uint32) error
	// ReadShardLastCrossLink retrieves the last crosslink of a shard.
	ReadShardLastCrossLink(shardID uint32) (*types.CrossLink, error)
	// DeleteFromPendingSlashingCandidates ..
	DeleteFromPendingSlashingCandidates(
		processed slash.Records,
	) error
	// ReadPendingSlashingCandidates retrieves pending slashing candidates.
	ReadPendingSlashingCandidates() slash.Records
	// ReadPendingCrossLinks retrieves pending crosslinks.
	ReadPendingCrossLinks() ([]types.CrossLink, error)
	// CachePendingCrossLinks caches the pending crosslinks in memory.
	CachePendingCrossLinks(crossLinks []types.CrossLink) error
	// SavePendingCrossLinks saves the pending crosslinks in db.
	SavePendingCrossLinks() error
	// AddPendingSlashingCandidates appends pending slashing candidates.
	AddPendingSlashingCandidates(
		candidates slash.Records,
	) error
	// AddPendingCrossLinks appends pending crosslinks.
	AddPendingCrossLinks(pendingCLs []types.CrossLink) (int, error)
	// DeleteFromPendingCrossLinks delete pending crosslinks that already committed (i.e. passed in the params).
	DeleteFromPendingCrossLinks(crossLinks []types.CrossLink) (int, error)
	// IsSameLeaderAsPreviousBlock retrieves a block from the database by number, caching it.
	IsSameLeaderAsPreviousBlock(block *types.Block) bool
	// GetVMConfig returns the blockchain VM config.
	GetVMConfig() *vm.Config
	// ReadCXReceipts retrieves the cross shard transaction receipts of a given shard.
	ReadCXReceipts(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error)
	// CXMerkleProof calculates the cross shard transaction merkle proof of a given destination shard.
	CXMerkleProof(toShardID uint32, block *types.Block) (*types.CXMerkleProof, error)
	// WriteCXReceiptsProofSpent mark the CXReceiptsProof list with given unspent status
	WriteCXReceiptsProofSpent(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error
	// IsSpent checks whether a CXReceiptsProof is spent.
	IsSpent(cxp *types.CXReceiptsProof) bool
	// ReadTxLookupEntry returns where the given transaction resides in the chain,
	// as a (block hash, block number, index in transaction list) triple.
	// returns 0, 0 if not found.
	ReadTxLookupEntry(txID common.Hash) (common.Hash, uint64, uint64)
	// ReadValidatorInformationAtRoot reads staking
	// information of given validatorWrapper at a specific state root.
	ReadValidatorInformationAtRoot(
		addr common.Address, root common.Hash,
	) (*types2.ValidatorWrapper, error)
	// ReadValidatorInformationAtState reads staking
	// information of given validatorWrapper at a specific state root.
	ReadValidatorInformationAtState(
		addr common.Address, state *state.DB,
	) (*types2.ValidatorWrapper, error)
	// ReadValidatorInformation reads staking information of given validator address.
	ReadValidatorInformation(
		addr common.Address,
	) (*types2.ValidatorWrapper, error)
	// ReadValidatorSnapshotAtEpoch reads the snapshot
	// staking validator information of given validator address.
	ReadValidatorSnapshotAtEpoch(
		epoch *big.Int,
		addr common.Address,
	) (*types2.ValidatorSnapshot, error)
	// ReadValidatorSnapshot reads the snapshot staking information of given validator address.
	ReadValidatorSnapshot(
		addr common.Address,
	) (*types2.ValidatorSnapshot, error)
	// WriteValidatorSnapshot writes the snapshot of provided validator.
	WriteValidatorSnapshot(
		batch rawdb.DatabaseWriter, snapshot *types2.ValidatorSnapshot,
	) error
	// ReadValidatorStats reads the stats of a validator.
	ReadValidatorStats(
		addr common.Address,
	) (*types2.ValidatorStats, error)
	// UpdateValidatorVotingPower writes the voting power for the committees.
	UpdateValidatorVotingPower(
		batch rawdb.DatabaseWriter,
		block *types.Block,
		newEpochSuperCommittee, currentEpochSuperCommittee *shard.State,
		state *state.DB,
	) (map[common.Address]*types2.ValidatorStats, error)
	// ComputeAndUpdateAPR ...
	ComputeAndUpdateAPR(
		block *types.Block, now *big.Int,
		wrapper *types2.ValidatorWrapper, stats *types2.ValidatorStats,
	) error
	// UpdateValidatorSnapshots updates the content snapshot of all validators
	// Note: this should only be called within the blockchain insert process.
	UpdateValidatorSnapshots(
		batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, newValidators []common.Address,
	) error
	// ReadValidatorList reads the addresses of current all validators.
	ReadValidatorList() ([]common.Address, error)
	// WriteValidatorList writes the list of validator addresses to database
	// Note: this should only be called within the blockchain insert process.
	WriteValidatorList(
		db rawdb.DatabaseWriter, addrs []common.Address,
	) error
	// ReadDelegationsByDelegator reads the addresses of validators delegated by a delegator.
	ReadDelegationsByDelegator(
		delegator common.Address,
	) (m types2.DelegationIndexes, err error)
	// ReadDelegationsByDelegatorAt reads the addresses of validators delegated by a delegator at a given block.
	ReadDelegationsByDelegatorAt(
		delegator common.Address, blockNum *big.Int,
	) (m types2.DelegationIndexes, err error)
	// UpdateStakingMetaData updates the metadata of validators and delegations,
	// including the full validator list and delegation indexes.
	// Note: this should only be called within the blockchain insert process.
	UpdateStakingMetaData(
		batch rawdb.DatabaseWriter, block *types.Block,
		stakeMsgs []types2.StakeMsg,
		state *state.DB, epoch, newEpoch *big.Int,
	) (newValidators []common.Address, err error)
	// ReadBlockRewardAccumulator must only be called on beaconchain
	// Note that block rewards are only for staking era.
	ReadBlockRewardAccumulator(number uint64) (*big.Int, error)
	// WriteBlockRewardAccumulator directly writes the BlockRewardAccumulator value
	// Note: this should only be called once during staking launch.
	WriteBlockRewardAccumulator(
		batch rawdb.DatabaseWriter, reward *big.Int, number uint64,
	) error
	// UpdateBlockRewardAccumulator ..
	// Note: this should only be called within the blockchain insert process.
	UpdateBlockRewardAccumulator(
		batch rawdb.DatabaseWriter, diff *big.Int, number uint64,
	) error
	// ValidatorCandidates returns the up to date validator candidates for next epoch.
	ValidatorCandidates() []common.Address
	// DelegatorsInformation returns up to date information of delegators of a given validator address.
	DelegatorsInformation(addr common.Address) []*types2.Delegation
	// GetECDSAFromCoinbase retrieve corresponding ecdsa address from Coinbase Address.
	GetECDSAFromCoinbase(header *block.Header) (common.Address, error)
	// SuperCommitteeForNextEpoch ...
	// isVerify=true means validators use it to verify
	// isVerify=false means leader is to propose.
	SuperCommitteeForNextEpoch(
		beacon engine.ChainReader,
		header *block.Header,
		isVerify bool,
	) (*shard.State, error)
	// EnablePruneBeaconChainFeature enabled prune BeaconChain feature.
	EnablePruneBeaconChainFeature()
	// IsEnablePruneBeaconChainFeature returns is enable prune BeaconChain feature.
	IsEnablePruneBeaconChainFeature() bool
	// CommitOffChainData write off chain data of a block onto db writer.
	CommitOffChainData(
		batch rawdb.DatabaseWriter,
		block *types.Block,
		receipts []*types.Receipt,
		cxReceipts []*types.CXReceipt,
		stakeMsgs []types2.StakeMsg,
		payout reward.Reader,
		state *state.DB,
	) (status WriteStatus, err error)

	// return true if is tikv writer master
	IsTikvWriterMaster() bool
	// RedisPreempt used for tikv mode, get the redis preempt instance
	RedisPreempt() *redis_helper.RedisPreempt
	// SyncFromTiKVWriter used for tikv mode, all reader or follower writer used to sync block from master writer
	SyncFromTiKVWriter(newBlkNum uint64, logs []*types.Log) error
	// InitTiKV used for tikv mode, init the tikv mode
	InitTiKV(conf *harmonyconfig.TiKVConfig)
}

BlockChain represents the canonical chain given a database with a genesis block. The Blockchain manages chain imports, reverts, chain reorganisations.

Importing blocks in to the blockchain happens according to the set of rules defined by the two stage validator. Processing of blocks is done using the Processor which processes the included transaction. The validation of the state is done in the second part of the validator. Failing results in aborting of the import.

The BlockChain also helps in returning blocks from **any** chain included in the database as well as blocks that represents the canonical chain. It's important to note that GetBlock can return any block and does not need to be included in the canonical one where as GetBlockByNumber always represents the canonical chain.

type BlockChainImpl added in v0.0.20

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

func NewBlockChain

func NewBlockChain(
	db ethdb.Database, stateCache state.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig,
	engine consensus_engine.Engine, vmConfig vm.Config,
	shouldPreserve func(block *types.Block) bool,
) (*BlockChainImpl, error)

NewBlockChain returns a fully initialised block chain using information available in the database. It initialises the default Ethereum validator and Processor.

func NewBlockChainWithOptions added in v0.0.34

func NewBlockChainWithOptions(
	db ethdb.Database, stateCache state.Database, cacheConfig *CacheConfig, chainConfig *params.ChainConfig,
	engine consensus_engine.Engine, vmConfig vm.Config,
	shouldPreserve func(block *types.Block) bool, options Options,
) (*BlockChainImpl, error)

NewBlockChainWithOptions same as NewBlockChain but can accept additional behaviour options.

func (bc *BlockChainImpl) AddPendingCrossLinks(pendingCLs []types.CrossLink) (int, error)

func (*BlockChainImpl) AddPendingSlashingCandidates added in v0.0.20

func (bc *BlockChainImpl) AddPendingSlashingCandidates(
	candidates slash.Records,
) error

func (*BlockChainImpl) BadBlocks added in v0.0.20

func (bc *BlockChainImpl) BadBlocks() []BadBlock

func (*BlockChainImpl) CXMerkleProof added in v0.0.20

func (bc *BlockChainImpl) CXMerkleProof(toShardID uint32, block *types.Block) (*types.CXMerkleProof, error)
func (bc *BlockChainImpl) CachePendingCrossLinks(crossLinks []types.CrossLink) error

func (*BlockChainImpl) ChainDb added in v0.0.20

func (bc *BlockChainImpl) ChainDb() ethdb.Database

func (*BlockChainImpl) CommitOffChainData added in v0.0.20

func (bc *BlockChainImpl) CommitOffChainData(
	batch rawdb.DatabaseWriter,
	block *types.Block,
	receipts []*types.Receipt,
	cxReceipts []*types.CXReceipt,
	stakeMsgs []staking.StakeMsg,
	payout reward.Reader,
	state *state.DB,
) (status WriteStatus, err error)

func (*BlockChainImpl) ComputeAndUpdateAPR added in v0.0.20

func (bc *BlockChainImpl) ComputeAndUpdateAPR(
	block *types.Block, now *big.Int,
	wrapper *staking.ValidatorWrapper, stats *staking.ValidatorStats,
) error

func (*BlockChainImpl) Config added in v0.0.20

func (bc *BlockChainImpl) Config() *params.ChainConfig

func (*BlockChainImpl) CurrentBlock added in v0.0.20

func (bc *BlockChainImpl) CurrentBlock() *types.Block

func (*BlockChainImpl) CurrentFastBlock added in v0.0.20

func (bc *BlockChainImpl) CurrentFastBlock() *types.Block

CurrentFastBlock retrieves the current fast-sync head block of the canonical chain. The block is retrieved from the blockchain's internal cache.

func (*BlockChainImpl) CurrentHeader added in v0.0.20

func (bc *BlockChainImpl) CurrentHeader() *block.Header

func (*BlockChainImpl) DelegatorsInformation added in v0.0.20

func (bc *BlockChainImpl) DelegatorsInformation(addr common.Address) []*staking.Delegation
func (bc *BlockChainImpl) DeleteCrossLinks(cls []types.CrossLink) error
func (bc *BlockChainImpl) DeleteFromPendingCrossLinks(crossLinks []types.CrossLink) (int, error)

func (*BlockChainImpl) DeleteFromPendingSlashingCandidates added in v0.0.20

func (bc *BlockChainImpl) DeleteFromPendingSlashingCandidates(
	processed slash.Records,
) error

func (*BlockChainImpl) EnablePruneBeaconChainFeature added in v0.0.20

func (bc *BlockChainImpl) EnablePruneBeaconChainFeature()

func (*BlockChainImpl) Engine added in v0.0.20

func (bc *BlockChainImpl) Engine() consensus_engine.Engine

func (*BlockChainImpl) Export added in v0.0.20

func (bc *BlockChainImpl) Export(w io.Writer) error

Export writes the active chain to the given writer.

func (*BlockChainImpl) ExportN added in v0.0.20

func (bc *BlockChainImpl) ExportN(w io.Writer, first uint64, last uint64) error

ExportN writes a subset of the active chain to the given writer.

func (*BlockChainImpl) Genesis added in v0.0.20

func (bc *BlockChainImpl) Genesis() *types.Block

Genesis retrieves the chain's genesis block.

func (*BlockChainImpl) GetAncestor added in v0.0.20

func (bc *BlockChainImpl) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64)

GetAncestor retrieves the Nth ancestor of a given block. It assumes that either the given block or a close ancestor of it is canonical. maxNonCanonical points to a downwards counter limiting the number of blocks to be individually checked before we reach the canonical chain.

Note: ancestor == 0 returns the same block, 1 returns its parent and so on.

func (*BlockChainImpl) GetBlock added in v0.0.20

func (bc *BlockChainImpl) GetBlock(hash common.Hash, number uint64) *types.Block

func (*BlockChainImpl) GetBlockByHash added in v0.0.20

func (bc *BlockChainImpl) GetBlockByHash(hash common.Hash) *types.Block

func (*BlockChainImpl) GetBlockByNumber added in v0.0.20

func (bc *BlockChainImpl) GetBlockByNumber(number uint64) *types.Block

func (*BlockChainImpl) GetBlockHashesFromHash added in v0.0.20

func (bc *BlockChainImpl) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash

GetBlockHashesFromHash retrieves a number of block hashes starting at a given hash, fetching towards the genesis block.

func (*BlockChainImpl) GetBlocksFromHash added in v0.0.20

func (bc *BlockChainImpl) GetBlocksFromHash(hash common.Hash, n int) (blocks []*types.Block)

GetBlocksFromHash returns the block corresponding to hash and up to n-1 ancestors. [deprecated by eth/62]

func (*BlockChainImpl) GetBody added in v0.0.20

func (bc *BlockChainImpl) GetBody(hash common.Hash) *types.Body

GetBody retrieves a block body (transactions and uncles) from the database by hash, caching it if found.

func (*BlockChainImpl) GetBodyRLP added in v0.0.20

func (bc *BlockChainImpl) GetBodyRLP(hash common.Hash) rlp.RawValue

GetBodyRLP retrieves a block body in RLP encoding from the database by hash, caching it if found.

func (*BlockChainImpl) GetCanonicalHash added in v0.0.20

func (bc *BlockChainImpl) GetCanonicalHash(number uint64) common.Hash

func (*BlockChainImpl) GetECDSAFromCoinbase added in v0.0.20

func (bc *BlockChainImpl) GetECDSAFromCoinbase(header *block.Header) (common.Address, error)

TODO: optimize this func by adding cache etc.

func (*BlockChainImpl) GetEpochBlockNumber added in v0.0.20

func (bc *BlockChainImpl) GetEpochBlockNumber(epoch *big.Int) (*big.Int, error)

func (*BlockChainImpl) GetHeader added in v0.0.20

func (bc *BlockChainImpl) GetHeader(hash common.Hash, number uint64) *block.Header

func (*BlockChainImpl) GetHeaderByHash added in v0.0.20

func (bc *BlockChainImpl) GetHeaderByHash(hash common.Hash) *block.Header

func (*BlockChainImpl) GetHeaderByNumber added in v0.0.20

func (bc *BlockChainImpl) GetHeaderByNumber(number uint64) *block.Header

func (*BlockChainImpl) GetMaxGarbageCollectedBlockNumber added in v0.0.20

func (bc *BlockChainImpl) GetMaxGarbageCollectedBlockNumber() int64

func (*BlockChainImpl) GetReceiptsByHash added in v0.0.20

func (bc *BlockChainImpl) GetReceiptsByHash(hash common.Hash) types.Receipts

func (*BlockChainImpl) GetTd added in v0.0.20

func (bc *BlockChainImpl) GetTd(hash common.Hash, number uint64) *big.Int

GetTd retrieves a block's total difficulty in the canonical chain from the database by hash and number, caching it if found.

func (*BlockChainImpl) GetTdByHash added in v0.0.20

func (bc *BlockChainImpl) GetTdByHash(hash common.Hash) *big.Int

GetTdByHash retrieves a block's total difficulty in the canonical chain from the database by hash, caching it if found.

func (*BlockChainImpl) GetUnclesInChain added in v0.0.20

func (bc *BlockChainImpl) GetUnclesInChain(b *types.Block, length int) []*block.Header

func (*BlockChainImpl) GetVMConfig added in v0.0.20

func (bc *BlockChainImpl) GetVMConfig() *vm.Config

func (*BlockChainImpl) GetVdfByNumber added in v0.0.20

func (bc *BlockChainImpl) GetVdfByNumber(number uint64) []byte

func (*BlockChainImpl) GetVrfByNumber added in v0.0.20

func (bc *BlockChainImpl) GetVrfByNumber(number uint64) []byte

func (*BlockChainImpl) HasBlock added in v0.0.20

func (bc *BlockChainImpl) HasBlock(hash common.Hash, number uint64) bool

func (*BlockChainImpl) HasBlockAndState added in v0.0.20

func (bc *BlockChainImpl) HasBlockAndState(hash common.Hash, number uint64) bool

func (*BlockChainImpl) HasHeader added in v0.0.20

func (bc *BlockChainImpl) HasHeader(hash common.Hash, number uint64) bool

HasHeader checks if a block header is present in the database or not, caching it if present.

func (*BlockChainImpl) HasState added in v0.0.20

func (bc *BlockChainImpl) HasState(hash common.Hash) bool

func (*BlockChainImpl) InitTiKV added in v0.1.8

func (bc *BlockChainImpl) InitTiKV(conf *harmonyconfig.TiKVConfig)

InitTiKV used for tikv mode, init the tikv mode

func (*BlockChainImpl) InsertChain added in v0.0.20

func (bc *BlockChainImpl) InsertChain(chain types.Blocks, verifyHeaders bool) (int, error)

func (*BlockChainImpl) InsertHeaderChain added in v0.0.20

func (bc *BlockChainImpl) InsertHeaderChain(chain []*block.Header, checkFreq int) (int, error)

InsertHeaderChain attempts to insert the given header chain in to the local chain, possibly creating a reorg. If an error is returned, it will return the index number of the failing header as well an error describing what went wrong.

The verify parameter can be used to fine tune whether nonce verification should be done or not. The reason behind the optional check is because some of the header retrieval mechanisms already need to verify nonces, as well as because nonces can be verified sparsely, not needing to check each.

func (*BlockChainImpl) InsertReceiptChain added in v0.0.20

func (bc *BlockChainImpl) InsertReceiptChain(blockChain types.Blocks, receiptChain []types.Receipts) (int, error)

InsertReceiptChain attempts to complete an already existing header chain with transaction and receipt data. Deprecated: no usages of this function found. TODO: should be removed

func (*BlockChainImpl) IsEnablePruneBeaconChainFeature added in v0.0.20

func (bc *BlockChainImpl) IsEnablePruneBeaconChainFeature() bool

func (*BlockChainImpl) IsSameLeaderAsPreviousBlock added in v0.0.20

func (bc *BlockChainImpl) IsSameLeaderAsPreviousBlock(block *types.Block) bool

func (*BlockChainImpl) IsSpent added in v0.0.20

func (bc *BlockChainImpl) IsSpent(cxp *types.CXReceiptsProof) bool

func (*BlockChainImpl) IsTikvWriterMaster added in v0.1.8

func (bc *BlockChainImpl) IsTikvWriterMaster() bool
func (bc *BlockChainImpl) LastContinuousCrossLink(batch rawdb.DatabaseWriter, shardID uint32) error

func (*BlockChainImpl) PostChainEvents added in v0.0.20

func (bc *BlockChainImpl) PostChainEvents(events []interface{}, logs []*types.Log)

PostChainEvents iterates over the events generated by a chain insertion and posts them into the event feed. TODO: Should not expose PostChainEvents. The chain events should be posted in WriteBlock.

func (*BlockChainImpl) Processor added in v0.0.20

func (bc *BlockChainImpl) Processor() Processor

func (*BlockChainImpl) ReadBlockRewardAccumulator added in v0.0.20

func (bc *BlockChainImpl) ReadBlockRewardAccumulator(number uint64) (*big.Int, error)

func (*BlockChainImpl) ReadCXReceipts added in v0.0.20

func (bc *BlockChainImpl) ReadCXReceipts(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error)

func (*BlockChainImpl) ReadCommitSig added in v0.0.20

func (bc *BlockChainImpl) ReadCommitSig(blockNum uint64) ([]byte, error)
func (bc *BlockChainImpl) ReadCrossLink(shardID uint32, blockNum uint64) (*types.CrossLink, error)

func (*BlockChainImpl) ReadDelegationsByDelegator added in v0.0.20

func (bc *BlockChainImpl) ReadDelegationsByDelegator(
	delegator common.Address,
) (m staking.DelegationIndexes, err error)

func (*BlockChainImpl) ReadDelegationsByDelegatorAt added in v0.0.20

func (bc *BlockChainImpl) ReadDelegationsByDelegatorAt(
	delegator common.Address, blockNum *big.Int,
) (m staking.DelegationIndexes, err error)

func (*BlockChainImpl) ReadEpochVdfBlockNum added in v0.0.20

func (bc *BlockChainImpl) ReadEpochVdfBlockNum(epoch *big.Int) (*big.Int, error)

func (*BlockChainImpl) ReadEpochVrfBlockNums added in v0.0.20

func (bc *BlockChainImpl) ReadEpochVrfBlockNums(epoch *big.Int) ([]uint64, error)
func (bc *BlockChainImpl) ReadPendingCrossLinks() ([]types.CrossLink, error)

func (*BlockChainImpl) ReadPendingSlashingCandidates added in v0.0.20

func (bc *BlockChainImpl) ReadPendingSlashingCandidates() slash.Records
func (bc *BlockChainImpl) ReadShardLastCrossLink(shardID uint32) (*types.CrossLink, error)

func (*BlockChainImpl) ReadShardState added in v0.0.20

func (bc *BlockChainImpl) ReadShardState(epoch *big.Int) (*shard.State, error)

func (*BlockChainImpl) ReadTxLookupEntry added in v0.0.20

func (bc *BlockChainImpl) ReadTxLookupEntry(txID common.Hash) (common.Hash, uint64, uint64)

func (*BlockChainImpl) ReadValidatorInformation added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorInformation(
	addr common.Address,
) (*staking.ValidatorWrapper, error)

func (*BlockChainImpl) ReadValidatorInformationAtRoot added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorInformationAtRoot(
	addr common.Address, root common.Hash,
) (*staking.ValidatorWrapper, error)

func (*BlockChainImpl) ReadValidatorInformationAtState added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorInformationAtState(
	addr common.Address, state *state.DB,
) (*staking.ValidatorWrapper, error)

func (*BlockChainImpl) ReadValidatorList added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorList() ([]common.Address, error)

func (*BlockChainImpl) ReadValidatorSnapshot added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorSnapshot(
	addr common.Address,
) (*staking.ValidatorSnapshot, error)

func (*BlockChainImpl) ReadValidatorSnapshotAtEpoch added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorSnapshotAtEpoch(
	epoch *big.Int,
	addr common.Address,
) (*staking.ValidatorSnapshot, error)

func (*BlockChainImpl) ReadValidatorStats added in v0.0.20

func (bc *BlockChainImpl) ReadValidatorStats(
	addr common.Address,
) (*staking.ValidatorStats, error)

func (*BlockChainImpl) RedisPreempt added in v0.1.8

func (bc *BlockChainImpl) RedisPreempt() *redis_helper.RedisPreempt

RedisPreempt used for tikv mode, get the redis preempt instance

func (*BlockChainImpl) Reset added in v0.0.20

func (bc *BlockChainImpl) Reset() error

func (*BlockChainImpl) ResetWithGenesisBlock added in v0.0.20

func (bc *BlockChainImpl) ResetWithGenesisBlock(genesis *types.Block) error

func (*BlockChainImpl) Rollback added in v0.0.20

func (bc *BlockChainImpl) Rollback(chain []common.Hash) error
func (bc *BlockChainImpl) SavePendingCrossLinks() error

func (*BlockChainImpl) SetHead added in v0.0.20

func (bc *BlockChainImpl) SetHead(head uint64) error

func (*BlockChainImpl) SetProcessor added in v0.0.20

func (bc *BlockChainImpl) SetProcessor(processor Processor)

func (*BlockChainImpl) SetValidator added in v0.0.20

func (bc *BlockChainImpl) SetValidator(validator Validator)

func (*BlockChainImpl) ShardID added in v0.0.20

func (bc *BlockChainImpl) ShardID() uint32

func (*BlockChainImpl) State added in v0.0.20

func (bc *BlockChainImpl) State() (*state.DB, error)

func (*BlockChainImpl) StateAt added in v0.0.20

func (bc *BlockChainImpl) StateAt(root common.Hash) (*state.DB, error)

func (*BlockChainImpl) Stop added in v0.0.20

func (bc *BlockChainImpl) Stop()

func (*BlockChainImpl) StoreEpochBlockNumber added in v0.0.20

func (bc *BlockChainImpl) StoreEpochBlockNumber(
	epoch *big.Int, blockNum *big.Int,
) error

func (*BlockChainImpl) SubscribeChainEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeChainEvent(ch chan<- ChainEvent) event.Subscription

func (*BlockChainImpl) SubscribeChainHeadEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription

func (*BlockChainImpl) SubscribeChainSideEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeChainSideEvent(ch chan<- ChainSideEvent) event.Subscription

func (*BlockChainImpl) SubscribeLogsEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription

func (*BlockChainImpl) SubscribeRemovedLogsEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription

func (*BlockChainImpl) SubscribeTraceEvent added in v0.0.20

func (bc *BlockChainImpl) SubscribeTraceEvent(ch chan<- TraceEvent) event.Subscription

func (*BlockChainImpl) SuperCommitteeForNextEpoch added in v0.0.20

func (bc *BlockChainImpl) SuperCommitteeForNextEpoch(
	beacon consensus_engine.ChainReader,
	header *block.Header,
	isVerify bool,
) (*shard.State, error)

func (*BlockChainImpl) SyncFromTiKVWriter added in v0.1.8

func (bc *BlockChainImpl) SyncFromTiKVWriter(newBlkNum uint64, logs []*types.Log) error

SyncFromTiKVWriter used for tikv mode, all reader or follower writer used to sync block from master writer

func (*BlockChainImpl) TrieNode added in v0.0.20

func (bc *BlockChainImpl) TrieNode(hash common.Hash) ([]byte, error)

TrieNode retrieves a blob of data associated with a trie node (or code hash) either from ephemeral in-memory cache, or from persistent storage.

func (*BlockChainImpl) UpdateBlockRewardAccumulator added in v0.0.20

func (bc *BlockChainImpl) UpdateBlockRewardAccumulator(
	batch rawdb.DatabaseWriter, diff *big.Int, number uint64,
) error

func (*BlockChainImpl) UpdateStakingMetaData added in v0.0.20

func (bc *BlockChainImpl) UpdateStakingMetaData(
	batch rawdb.DatabaseWriter, block *types.Block,
	stakeMsgs []staking.StakeMsg,
	state *state.DB, epoch, newEpoch *big.Int,
) (newValidators []common.Address, err error)

func (*BlockChainImpl) UpdateValidatorSnapshots added in v0.0.20

func (bc *BlockChainImpl) UpdateValidatorSnapshots(
	batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, newValidators []common.Address,
) error

func (*BlockChainImpl) UpdateValidatorVotingPower added in v0.0.20

func (bc *BlockChainImpl) UpdateValidatorVotingPower(
	batch rawdb.DatabaseWriter,
	block *types.Block,
	newEpochSuperCommittee, currentEpochSuperCommittee *shard.State,
	state *state.DB,
) (map[common.Address]*staking.ValidatorStats, error)

func (*BlockChainImpl) ValidateNewBlock added in v0.0.20

func (bc *BlockChainImpl) ValidateNewBlock(block *types.Block) error

func (*BlockChainImpl) Validator added in v0.0.20

func (bc *BlockChainImpl) Validator() Validator

func (*BlockChainImpl) ValidatorCandidates added in v0.0.20

func (bc *BlockChainImpl) ValidatorCandidates() []common.Address

func (*BlockChainImpl) WriteBlockRewardAccumulator added in v0.0.20

func (bc *BlockChainImpl) WriteBlockRewardAccumulator(
	batch rawdb.DatabaseWriter, reward *big.Int, number uint64,
) error

func (*BlockChainImpl) WriteBlockWithState added in v0.0.20

func (bc *BlockChainImpl) WriteBlockWithState(
	block *types.Block, receipts []*types.Receipt,
	cxReceipts []*types.CXReceipt,
	stakeMsgs []staking.StakeMsg,
	paid reward.Reader,
	state *state.DB,
) (status WriteStatus, err error)

func (*BlockChainImpl) WriteBlockWithoutState added in v0.0.20

func (bc *BlockChainImpl) WriteBlockWithoutState(block *types.Block, td *big.Int) (err error)

func (*BlockChainImpl) WriteCXReceiptsProofSpent added in v0.0.20

func (bc *BlockChainImpl) WriteCXReceiptsProofSpent(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error

func (*BlockChainImpl) WriteCommitSig added in v0.0.20

func (bc *BlockChainImpl) WriteCommitSig(blockNum uint64, lastCommits []byte) error
func (bc *BlockChainImpl) WriteCrossLinks(batch rawdb.DatabaseWriter, cls []types.CrossLink) error

func (*BlockChainImpl) WriteEpochVdfBlockNum added in v0.0.20

func (bc *BlockChainImpl) WriteEpochVdfBlockNum(epoch *big.Int, blockNum *big.Int) error

func (*BlockChainImpl) WriteEpochVrfBlockNums added in v0.0.20

func (bc *BlockChainImpl) WriteEpochVrfBlockNums(epoch *big.Int, vrfNumbers []uint64) error

func (*BlockChainImpl) WriteHeadBlock added in v0.0.34

func (bc *BlockChainImpl) WriteHeadBlock(block *types.Block) error

func (*BlockChainImpl) WriteShardStateBytes added in v0.0.20

func (bc *BlockChainImpl) WriteShardStateBytes(db rawdb.DatabaseWriter,
	epoch *big.Int, shardState []byte,
) (*shard.State, error)

func (*BlockChainImpl) WriteValidatorList added in v0.0.20

func (bc *BlockChainImpl) WriteValidatorList(
	db rawdb.DatabaseWriter, addrs []common.Address,
) error

func (*BlockChainImpl) WriteValidatorSnapshot added in v0.0.20

func (bc *BlockChainImpl) WriteValidatorSnapshot(
	batch rawdb.DatabaseWriter, snapshot *staking.ValidatorSnapshot,
) error

type BlockValidator

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

BlockValidator is responsible for validating block headers, uncles and processed state.

BlockValidator implements validator.

func NewBlockValidator

func NewBlockValidator(config *params.ChainConfig, blockchain BlockChain, engine consensus_engine.Engine) *BlockValidator

NewBlockValidator returns a new block validator which is safe for re-use

func (*BlockValidator) ValidateBody

func (v *BlockValidator) ValidateBody(block *types.Block) error

ValidateBody verifies the block header's transaction root. The headers are assumed to be already validated at this point.

func (*BlockValidator) ValidateCXReceiptsProof

func (v *BlockValidator) ValidateCXReceiptsProof(cxp *types.CXReceiptsProof) error

ValidateCXReceiptsProof checks whether the given CXReceiptsProof is consistency with itself

func (*BlockValidator) ValidateHeader

func (v *BlockValidator) ValidateHeader(block *types.Block, seal bool) error

ValidateHeader checks whether a header conforms to the consensus rules of a given engine. Verifying the seal may be done optionally here, or explicitly via the VerifySeal method.

func (*BlockValidator) ValidateHeaders

func (v *BlockValidator) ValidateHeaders(chain []*types.Block) (chan<- struct{}, <-chan error)

ValidateHeaders verifies a batch of blocks' headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications

func (*BlockValidator) ValidateState

func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.DB, receipts types.Receipts, cxReceipts types.CXReceipts, usedGas uint64) error

ValidateState validates the various changes that happen after a state transition, such as amount of used gas, the receipt roots and the state root itself. ValidateState returns a database batch if the validation was a success otherwise nil and an error is returned.

type CacheConfig

type CacheConfig struct {
	Disabled      bool          // Whether to disable trie write caching (archive node)
	TrieNodeLimit int           // Memory limit (MB) at which to flush the current in-memory trie to disk
	TrieTimeLimit time.Duration // Time limit after which to flush the current in-memory trie to disk
}

CacheConfig contains the configuration values for the trie caching/pruning that's resident in a blockchain.

type Chain added in v0.0.28

type Chain interface {
	GetCanonicalHash(number uint64) common.Hash
	GetHeader(hash common.Hash, number uint64) *block.Header
	ChainDb() ethdb.Database
}

type ChainContext

type ChainContext interface {
	// Engine retrieves the chain's consensus engine.
	Engine() consensus_engine.Engine

	// GetHeader returns the hash corresponding to their hash.
	GetHeader(common.Hash, uint64) *block.Header

	// ReadDelegationsByDelegator returns the validators list of a delegator
	ReadDelegationsByDelegator(common.Address) (stakingTypes.DelegationIndexes, error)

	// ReadDelegationsByDelegatorAt reads the addresses of validators delegated by a delegator at a given block
	ReadDelegationsByDelegatorAt(delegator common.Address, blockNum *big.Int) (m stakingTypes.DelegationIndexes, err error)

	// ReadValidatorSnapshot returns the snapshot of validator at the beginning of current epoch.
	ReadValidatorSnapshot(common.Address) (*stakingTypes.ValidatorSnapshot, error)

	// ReadValidatorList returns the list of all validators
	ReadValidatorList() ([]common.Address, error)

	// Config returns chain config
	Config() *params.ChainConfig

	ShardID() uint32 // this is implemented by blockchain.go already
}

ChainContext supports retrieving headers and consensus parameters from the current blockchain to be used during transaction processing.

type ChainEvent

type ChainEvent struct {
	Block *types.Block
	Hash  common.Hash
	Logs  []*types.Log
}

ChainEvent is the struct of chain event.

type ChainHeadEvent

type ChainHeadEvent struct{ Block *types.Block }

ChainHeadEvent is the struct of chain head event.

type ChainIndexer

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

ChainIndexer does a post-processing job for equally sized sections of the canonical chain (like BlooomBits and CHT structures). A ChainIndexer is connected to the blockchain through the event system by starting a ChainHeadEventLoop in a goroutine.

Further child ChainIndexers can be added which use the output of the parent section indexer. These child indexers receive new head notifications only after an entire section has been finished or in case of rollbacks that might affect already finished sections.

func NewChainIndexer

func NewChainIndexer(chainDb Chain, indexDb ethdb.Database, backend ChainIndexerBackend, section, confirm uint64, throttling time.Duration, kind string) *ChainIndexer

NewChainIndexer creates a new chain indexer to do background processing on chain segments of a given size after certain number of confirmations passed. The throttling parameter might be used to prevent database thrashing.

func (*ChainIndexer) AddCheckpoint

func (c *ChainIndexer) AddCheckpoint(section uint64, shead common.Hash)

AddCheckpoint adds a checkpoint. Sections are never processed and the chain is not expected to be available before this point. The indexer assumes that the backend has sufficient information available to process subsequent sections.

Note: knownSections == 0 and storedSections == checkpointSections until syncing reaches the checkpoint

func (*ChainIndexer) AddChildIndexer

func (c *ChainIndexer) AddChildIndexer(indexer *ChainIndexer)

AddChildIndexer adds a child ChainIndexer that can use the output of this one

func (*ChainIndexer) Close

func (c *ChainIndexer) Close() error

Close tears down all goroutines belonging to the indexer and returns any error that might have occurred internally.

func (*ChainIndexer) SectionHead

func (c *ChainIndexer) SectionHead(section uint64) common.Hash

SectionHead retrieves the last block hash of a processed section from the index database.

func (*ChainIndexer) Sections

func (c *ChainIndexer) Sections() (uint64, uint64, common.Hash)

Sections returns the number of processed sections maintained by the indexer and also the information about the last header indexed for potential canonical verifications.

func (*ChainIndexer) Start

func (c *ChainIndexer) Start(chain ChainIndexerChain)

Start creates a goroutine to feed chain head events into the indexer for cascading background processing. Children do not need to be started, they are notified about new events by their parents.

type ChainIndexerBackend

type ChainIndexerBackend interface {
	// Reset initiates the processing of a new chain segment, potentially terminating
	// any partially completed operations (in case of a reorg).
	Reset(ctx context.Context, section uint64, prevHead common.Hash) error

	// Process crunches through the next header in the chain segment. The caller
	// will ensure a sequential order of headers.
	Process(ctx context.Context, header *block.Header) error

	// Commit finalizes the section metadata and stores it into the database.
	Commit() error
}

ChainIndexerBackend defines the methods needed to process chain segments in the background and write the segment results into the database. These can be used to create filter blooms or CHTs.

type ChainIndexerChain

type ChainIndexerChain interface {
	// CurrentHeader retrieves the latest locally known header.
	CurrentHeader() *block.Header

	// SubscribeChainHeadEvent subscribes to new head header notifications.
	SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription
}

ChainIndexerChain interface is used for connecting the indexer to a blockchain

type ChainSideEvent

type ChainSideEvent struct {
	Block *types.Block
}

ChainSideEvent is chain side event.

type CxEntry

type CxEntry struct {
	BlockHash common.Hash
	ToShardID uint32
}

CxEntry represents the egress receipt's blockHash and ToShardID

type CxPool

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

CxPool is to hold a pool of block outgoing receipts to be resend in next round broadcast When a user/client doesn't find the destination shard get the money from cross shard tx it can send RPC call along with txID to allow the any validator to add the corresponding block's receipts to be resent

func NewCxPool

func NewCxPool(limit int) *CxPool

NewCxPool creates a new CxPool

func (*CxPool) Add

func (cxPool *CxPool) Add(entry CxEntry) bool

Add add element into the pool if not exceed limit

func (*CxPool) Clear

func (cxPool *CxPool) Clear()

Clear empty the pool

func (*CxPool) Pool

func (cxPool *CxPool) Pool() mapset.Set

Pool returns the pool of blockHashes of missing receipts

func (*CxPool) Size

func (cxPool *CxPool) Size() int

Size return size of the pool

type DeleteCallback

type DeleteCallback func(rawdb.DatabaseDeleter, common.Hash, uint64) error

DeleteCallback is a callback function that is called by SetHead before each header is deleted.

type EpochChain added in v0.0.34

type EpochChain struct {
	Stub
	// contains filtered or unexported fields
}

func NewEpochChain added in v0.0.34

func NewEpochChain(db ethdb.Database, chainConfig *params.ChainConfig,
	engine consensus_engine.Engine, vmConfig vm.Config) (*EpochChain, error)

func (*EpochChain) Config added in v0.0.34

func (bc *EpochChain) Config() *params.ChainConfig

func (*EpochChain) CurrentBlock added in v0.0.34

func (bc *EpochChain) CurrentBlock() *types.Block

func (*EpochChain) CurrentHeader added in v0.0.34

func (bc *EpochChain) CurrentHeader() *block.Header

func (*EpochChain) Engine added in v0.0.34

func (bc *EpochChain) Engine() engine.Engine

func (*EpochChain) GetBlockNumber added in v0.0.34

func (bc *EpochChain) GetBlockNumber(hash common.Hash) *uint64

GetBlockNumber retrieves the block number belonging to the given hash from the cache or database

func (*EpochChain) GetCanonicalHash added in v0.0.34

func (bc *EpochChain) GetCanonicalHash(number uint64) common.Hash

func (*EpochChain) GetHeader added in v0.0.34

func (bc *EpochChain) GetHeader(hash common.Hash, number uint64) *block.Header

GetHeader retrieves a block header from the database by hash and number, caching it if found.

func (*EpochChain) GetHeaderByHash added in v0.0.34

func (bc *EpochChain) GetHeaderByHash(hash common.Hash) *block.Header

func (*EpochChain) GetHeaderByNumber added in v0.0.34

func (bc *EpochChain) GetHeaderByNumber(number uint64) *block.Header

func (*EpochChain) GetVMConfig added in v0.0.34

func (bc *EpochChain) GetVMConfig() *vm.Config

func (*EpochChain) InsertChain added in v0.0.34

func (bc *EpochChain) InsertChain(blocks types.Blocks, _ bool) (int, error)

func (*EpochChain) IsSameLeaderAsPreviousBlock added in v0.0.34

func (bc *EpochChain) IsSameLeaderAsPreviousBlock(block *types.Block) bool

func (*EpochChain) ReadShardState added in v0.0.34

func (bc *EpochChain) ReadShardState(epoch *big.Int) (*shard.State, error)

func (*EpochChain) ShardID added in v0.0.34

func (bc *EpochChain) ShardID() uint32

func (*EpochChain) Stop added in v0.0.34

func (bc *EpochChain) Stop()

func (*EpochChain) WriteHeadBlock added in v0.0.34

func (bc *EpochChain) WriteHeadBlock(block *types.Block) error

WriteHeadBlock writes a new head block.

type ExecutionResult

type ExecutionResult struct {
	ReturnData []byte
	UsedGas    uint64
	VMErr      error
}

ExecutionResult is the return value from a transaction committed to the DB

func ApplyMessage

func ApplyMessage(evm *vm.EVM, msg Message, gp *GasPool) (ExecutionResult, error)

ApplyMessage computes the new state by applying the given message against the old state within the environment.

ApplyMessage returns the bytes returned by any EVM execution (if it took place), the gas used (which includes gas refunds) and an error if it failed. An error always indicates a core error meaning that the message would always fail for that particular state and would never be accepted within a block.

func (*ExecutionResult) Failed

func (result *ExecutionResult) Failed() bool

Failed returns the indicator whether the execution is successful or not

func (*ExecutionResult) Return

func (result *ExecutionResult) Return() []byte

Return is a helper function to help caller distinguish between revert reason and function return. Return returns the data after execution if no error occurs.

func (*ExecutionResult) Revert

func (result *ExecutionResult) Revert() []byte

Revert returns the concrete revert reason if the execution is aborted by `REVERT` opcode. Note the reason can be nil if no data supplied with revert opcode.

func (*ExecutionResult) Unwrap

func (result *ExecutionResult) Unwrap() error

Unwrap returns the internal evm error which allows us for further analysis outside.

type GasPool

type GasPool uint64

GasPool tracks the amount of gas available during execution of the transactions in a block. The zero value is a pool with zero gas available.

func (*GasPool) AddGas

func (gp *GasPool) AddGas(amount uint64) *GasPool

AddGas makes gas available for execution.

func (*GasPool) Gas

func (gp *GasPool) Gas() uint64

Gas returns the amount of gas remaining in the pool.

func (*GasPool) String

func (gp *GasPool) String() string

func (*GasPool) SubGas

func (gp *GasPool) SubGas(amount uint64) error

SubGas deducts the given amount from the pool if enough gas is available and returns an error otherwise.

type Genesis

type Genesis struct {
	Config         *params.ChainConfig  `json:"config"`
	Factory        blockfactory.Factory `json:"-"`
	Nonce          uint64               `json:"nonce"`
	ShardID        uint32               `json:"shardID"`
	Timestamp      uint64               `json:"timestamp"`
	ExtraData      []byte               `json:"extraData"`
	GasLimit       uint64               `json:"gasLimit"       gencodec:"required"`
	Mixhash        common.Hash          `json:"mixHash"`
	Coinbase       common.Address       `json:"coinbase"`
	Alloc          GenesisAlloc         `json:"alloc"          gencodec:"required"`
	ShardStateHash common.Hash          `json:"shardStateHash" gencodec:"required"`
	ShardState     shard.State          `json:"shardState"     gencodec:"required"`

	// These fields are used for consensus tests. Please don't use them
	// in actual genesis blocks.
	Number     uint64      `json:"number"`
	GasUsed    uint64      `json:"gasUsed"`
	ParentHash common.Hash `json:"parentHash"`
}

Genesis specifies the header fields, state of a genesis block. It also defines hard fork switch-over blocks through the chain configuration.

func GetGenesisSpec

func GetGenesisSpec(shardID uint32) *Genesis

GetGenesisSpec for a given shard

func NewGenesisSpec

func NewGenesisSpec(netType nodeconfig.NetworkType, shardID uint32) *Genesis

NewGenesisSpec creates a new genesis spec for the given network type and shard ID. Note that the shard state is NOT initialized.

func (*Genesis) Commit

func (g *Genesis) Commit(db ethdb.Database) (*types.Block, error)

Commit writes the block and state of a genesis specification to the database. The block is committed as the canonical head block.

func (Genesis) MarshalJSON

func (g Genesis) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Genesis) MustCommit

func (g *Genesis) MustCommit(db ethdb.Database) *types.Block

MustCommit writes the genesis block and state to db, panicking on error. The block is committed as the canonical head block.

func (*Genesis) ToBlock

func (g *Genesis) ToBlock(db ethdb.Database) *types.Block

ToBlock creates the genesis block and writes state of a genesis specification to the given database (or discards it if nil).

func (*Genesis) UnmarshalJSON

func (g *Genesis) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type GenesisAccount

type GenesisAccount struct {
	Code       []byte                      `json:"code,omitempty"`
	Storage    map[common.Hash]common.Hash `json:"storage,omitempty"`
	Balance    *big.Int                    `json:"balance" gencodec:"required"`
	Nonce      uint64                      `json:"nonce,omitempty"`
	PrivateKey []byte                      `json:"secretKey,omitempty"` // for tests
}

GenesisAccount is an account in the state of the genesis block.

func (GenesisAccount) MarshalJSON

func (g GenesisAccount) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*GenesisAccount) UnmarshalJSON

func (g *GenesisAccount) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type GenesisAlloc

type GenesisAlloc map[common.Address]GenesisAccount

GenesisAlloc specifies the initial state that is part of the genesis block.

func (*GenesisAlloc) UnmarshalJSON

func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error

UnmarshalJSON is to deserialize the data into GenesisAlloc.

type GenesisInitializer added in v0.0.34

type GenesisInitializer struct {
	NetworkType nodeconfig.NetworkType
}

GenesisInitializer is a shardchain.DBInitializer adapter.

func (*GenesisInitializer) InitChainDB added in v0.0.34

func (gi *GenesisInitializer) InitChainDB(db ethdb.Database, shardID uint32) error

InitChainDB sets up a new genesis block in the database for the given shard.

type GenesisItem

type GenesisItem struct {
	Addr    *big.Int
	Balance *big.Int
}

GenesisItem represents one genesis block transaction

type GenesisMismatchError

type GenesisMismatchError struct {
	Stored, New common.Hash
}

GenesisMismatchError is raised when trying to overwrite an existing genesis block with an incompatible one.

func (*GenesisMismatchError) Error

func (e *GenesisMismatchError) Error() string

type HeaderChain

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

HeaderChain implements the basic block header chain logic that is shared by core.BlockChain and light.LightChain. It is not usable in itself, only as a part of either structure. It is not thread safe either, the encapsulating chain structures should do the necessary mutex locking/unlocking.

func NewHeaderChain

func NewHeaderChain(chainDb ethdb.Database, config *params.ChainConfig, engine consensus_engine.Engine, procInterrupt func() bool) (*HeaderChain, error)

NewHeaderChain creates a new HeaderChain structure.

getValidator should return the parent's validator
procInterrupt points to the parent's interrupt semaphore
wg points to the parent's shutdown wait group

func (*HeaderChain) Config

func (hc *HeaderChain) Config() *params.ChainConfig

Config retrieves the header chain's chain configuration.

func (*HeaderChain) CurrentHeader

func (hc *HeaderChain) CurrentHeader() *block.Header

CurrentHeader retrieves the current head header of the canonical chain. The header is retrieved from the HeaderChain's internal cache.

func (*HeaderChain) Engine

func (hc *HeaderChain) Engine() consensus_engine.Engine

Engine retrieves the header chain's consensus engine.

func (*HeaderChain) GetAncestor

func (hc *HeaderChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64)

GetAncestor retrieves the Nth ancestor of a given block. It assumes that either the given block or a close ancestor of it is canonical. maxNonCanonical points to a downwards counter limiting the number of blocks to be individually checked before we reach the canonical chain.

Note: ancestor == 0 returns the same block, 1 returns its parent and so on.

func (*HeaderChain) GetBlock

func (hc *HeaderChain) GetBlock(hash common.Hash, number uint64) *types.Block

GetBlock implements consensus.ChainReader, and returns nil for every input as a header chain does not have blocks available for retrieval.

func (*HeaderChain) GetBlockHashesFromHash

func (hc *HeaderChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash

GetBlockHashesFromHash retrieves a number of block hashes starting at a given hash, fetching towards the genesis block.

func (*HeaderChain) GetBlockNumber

func (hc *HeaderChain) GetBlockNumber(hash common.Hash) *uint64

GetBlockNumber retrieves the block number belonging to the given hash from the cache or database

func (*HeaderChain) GetCanonicalHash

func (hc *HeaderChain) GetCanonicalHash(number uint64) common.Hash

func (*HeaderChain) GetHeader

func (hc *HeaderChain) GetHeader(hash common.Hash, number uint64) *block.Header

GetHeader retrieves a block header from the database by hash and number, caching it if found.

func (*HeaderChain) GetHeaderByHash

func (hc *HeaderChain) GetHeaderByHash(hash common.Hash) *block.Header

GetHeaderByHash retrieves a block header from the database by hash, caching it if found.

func (*HeaderChain) GetHeaderByNumber

func (hc *HeaderChain) GetHeaderByNumber(number uint64) *block.Header

GetHeaderByNumber retrieves a block header from the database by number, caching it (associated with its hash) if found.

func (*HeaderChain) GetTd

func (hc *HeaderChain) GetTd(hash common.Hash, number uint64) *big.Int

GetTd retrieves a block's total difficulty in the canonical chain from the database by hash and number, caching it if found.

func (*HeaderChain) GetTdByHash

func (hc *HeaderChain) GetTdByHash(hash common.Hash) *big.Int

GetTdByHash retrieves a block's total difficulty in the canonical chain from the database by hash, caching it if found.

func (*HeaderChain) HasHeader

func (hc *HeaderChain) HasHeader(hash common.Hash, number uint64) bool

HasHeader checks if a block header is present in the database or not.

func (*HeaderChain) InsertHeaderChain

func (hc *HeaderChain) InsertHeaderChain(chain []*block.Header, writeHeader WhCallback, start time.Time) (int, error)

InsertHeaderChain attempts to insert the given header chain in to the local chain, possibly creating a reorg. If an error is returned, it will return the index number of the failing header as well an error describing what went wrong.

The verify parameter can be used to fine tune whether nonce verification should be done or not. The reason behind the optional check is because some of the header retrieval mechanisms already need to verfy nonces, as well as because nonces can be verified sparsely, not needing to check each.

func (*HeaderChain) SetCurrentHeader

func (hc *HeaderChain) SetCurrentHeader(head *block.Header) error

SetCurrentHeader sets the current head header of the canonical chain.

func (*HeaderChain) SetGenesis

func (hc *HeaderChain) SetGenesis(head *block.Header)

SetGenesis sets a new genesis block header for the chain

func (*HeaderChain) SetHead

func (hc *HeaderChain) SetHead(head uint64, delFn DeleteCallback) error

SetHead rewinds the local chain to a new head. Everything above the new head will be deleted and the new one set.

func (*HeaderChain) ValidateHeaderChain

func (hc *HeaderChain) ValidateHeaderChain(chain []*block.Header, checkFreq int) (int, error)

ValidateHeaderChain validates header chain.

func (*HeaderChain) WriteHeader

func (hc *HeaderChain) WriteHeader(header *block.Header) (status WriteStatus, err error)

WriteHeader writes a header into the local chain, given that its parent is already known. If the total difficulty of the newly inserted header becomes greater than the current known TD, the canonical chain is re-routed.

Note: This method is not concurrent-safe with inserting blocks simultaneously into the chain, as side effects caused by reorganisations cannot be emulated without the real blocks. Hence, writing headers directly should only be done in two scenarios: pure-header mode of operation (light clients), or properly separated header/block phases (non-archive clients).

func (*HeaderChain) WriteTd

func (hc *HeaderChain) WriteTd(hash common.Hash, number uint64, td *big.Int) error

WriteTd stores a block's total difficulty into the database, also caching it along the way.

type Message

type Message interface {
	From() common.Address
	//FromFrontier() (common.Address, error)
	To() *common.Address

	GasPrice() *big.Int
	Gas() uint64
	Value() *big.Int

	Nonce() uint64
	CheckNonce() bool
	Data() []byte
	Type() types.TransactionType
	BlockNum() *big.Int
}

Message represents a message sent to a contract.

type NewMinedBlockEvent

type NewMinedBlockEvent struct{ Block *types.Block }

NewMinedBlockEvent is posted when a block has been imported.

type NewTxsEvent

type NewTxsEvent struct{ Txs []types.PoolTransaction }

NewTxsEvent is posted when a batch of transactions enter the transaction pool.

type Options added in v0.0.34

type Options struct {
	// Subset of blockchain suitable for storing last epoch blocks i.e. blocks with shard state.
	EpochChain bool
}

Options contains configuration values to change blockchain behaviour.

type PendingLogsEvent

type PendingLogsEvent struct {
	Logs []*types.Log
}

PendingLogsEvent is posted pre mining and notifies of pending logs.

type Processor

type Processor interface {
	Process(block *types.Block, statedb *state.DB, cfg vm.Config, readCache bool) (
		types.Receipts, types.CXReceipts, []stakingTypes.StakeMsg,
		[]*types.Log, uint64, reward.Reader, *state.DB, error,
	)
	CacheProcessorResult(cacheKey interface{}, result *ProcessorResult)
}

Processor is an interface for processing blocks using a given initial state.

Process takes the block to be processed and the statedb upon which the initial state is based. It should return the receipts generated, amount of gas used in the process and return an error if any of the internal rules failed. Process will cache the result of successfully processed blocks. readCache decides whether the method will try reading from result cache.

type ProcessorResult

type ProcessorResult struct {
	Receipts   types.Receipts
	CxReceipts types.CXReceipts
	StakeMsgs  []staking.StakeMsg
	Logs       []*types.Log
	UsedGas    uint64
	Reward     reward.Reader
	State      *state.DB
}

this structure is cached, and each individual element is returned

type RemovedLogsEvent

type RemovedLogsEvent struct{ Logs []*types.Log }

RemovedLogsEvent is posted when a reorg happens

type SideEffect added in v0.0.34

type SideEffect func()

type StateProcessor

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

StateProcessor is a basic Processor, which takes care of transitioning state from one point to another.

StateProcessor implements Processor.

func NewStateProcessor

func NewStateProcessor(
	config *params.ChainConfig, bc BlockChain, engine consensus_engine.Engine,
) *StateProcessor

NewStateProcessor initialises a new StateProcessor.

func (*StateProcessor) CacheProcessorResult

func (p *StateProcessor) CacheProcessorResult(cacheKey interface{}, result *ProcessorResult)

CacheProcessorResult caches the process result on the cache key.

func (*StateProcessor) Process

func (p *StateProcessor) Process(
	block *types.Block, statedb *state.DB, cfg vm.Config, readCache bool,
) (
	types.Receipts, types.CXReceipts, []staking.StakeMsg,
	[]*types.Log, uint64, reward.Reader, *state.DB, error,
)

Process processes the state changes according to the Ethereum rules by running the transaction messages using the statedb and applying any rewards to both the processor (coinbase) and any included uncles.

Process returns the receipts and logs accumulated during the process and returns the amount of gas that was used in the process. If any of the transactions failed to execute due to insufficient gas it will return an error.

type StateTransition

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

StateTransition is the State Transitioning Model which is described as follows:

A state transition is a change made when a transaction is applied to the current world state The state transitioning model does all the necessary work to work out a valid new state root.

1) Nonce handling 2) Pre pay gas 3) Create a new state object if the recipient is \0*32 4) Value transfer == If contract creation ==

4a) Attempt to run transaction data
4b) If valid, use result as code for the new state object

== end == 5) Run Script section 6) Derive new state root

func NewStateTransition

func NewStateTransition(evm *vm.EVM, msg Message, gp *GasPool, bc ChainContext) *StateTransition

NewStateTransition initialises and returns a new state transition object.

func (*StateTransition) StakingTransitionDb

func (st *StateTransition) StakingTransitionDb() (usedGas uint64, err error)

StakingTransitionDb will transition the state by applying the staking message and returning the result including the used gas. It returns an error if failed. It is used for staking transaction only

func (*StateTransition) TransitionDb

func (st *StateTransition) TransitionDb() (ExecutionResult, error)

TransitionDb will transition the state by applying the current message and returning the result including the used gas. It returns an error if failed. An error indicates a consensus issue.

type Stub added in v0.0.34

type Stub struct {
	Name string
}
func (a Stub) AddPendingCrossLinks(pendingCLs []types.CrossLink) (int, error)

func (Stub) AddPendingSlashingCandidates added in v0.0.34

func (a Stub) AddPendingSlashingCandidates(candidates slash.Records) error

func (Stub) BadBlocks added in v0.0.34

func (a Stub) BadBlocks() []BadBlock

func (Stub) CXMerkleProof added in v0.0.34

func (a Stub) CXMerkleProof(toShardID uint32, block *types.Block) (*types.CXMerkleProof, error)
func (a Stub) CachePendingCrossLinks(crossLinks []types.CrossLink) error

func (Stub) ChainDb added in v0.0.34

func (a Stub) ChainDb() ethdb.Database

func (Stub) CommitOffChainData added in v0.0.34

func (a Stub) CommitOffChainData(batch rawdb.DatabaseWriter, block *types.Block, receipts []*types.Receipt, cxReceipts []*types.CXReceipt, stakeMsgs []staking.StakeMsg, payout reward.Reader, state *state.DB) (status WriteStatus, err error)

func (Stub) ComputeAndUpdateAPR added in v0.0.34

func (a Stub) ComputeAndUpdateAPR(block *types.Block, now *big.Int, wrapper *staking.ValidatorWrapper, stats *staking.ValidatorStats) error

func (Stub) Config added in v0.0.34

func (a Stub) Config() *params.ChainConfig

func (Stub) CurrentBlock added in v0.0.34

func (a Stub) CurrentBlock() *types.Block

func (Stub) CurrentHeader added in v0.0.34

func (a Stub) CurrentHeader() *block.Header

func (Stub) DelegatorsInformation added in v0.0.34

func (a Stub) DelegatorsInformation(addr common.Address) []*staking.Delegation
func (a Stub) DeleteCrossLinks(cls []types.CrossLink) error
func (a Stub) DeleteFromPendingCrossLinks(crossLinks []types.CrossLink) (int, error)

func (Stub) DeleteFromPendingSlashingCandidates added in v0.0.34

func (a Stub) DeleteFromPendingSlashingCandidates(processed slash.Records) error

func (Stub) EnablePruneBeaconChainFeature added in v0.0.34

func (a Stub) EnablePruneBeaconChainFeature()

func (Stub) Engine added in v0.0.34

func (a Stub) Engine() engine.Engine

func (Stub) GetBlock added in v0.0.34

func (a Stub) GetBlock(hash common.Hash, number uint64) *types.Block

func (Stub) GetBlockByHash added in v0.0.34

func (a Stub) GetBlockByHash(hash common.Hash) *types.Block

func (Stub) GetBlockByNumber added in v0.0.34

func (a Stub) GetBlockByNumber(number uint64) *types.Block

func (Stub) GetCanonicalHash added in v0.0.34

func (a Stub) GetCanonicalHash(number uint64) common.Hash

func (Stub) GetECDSAFromCoinbase added in v0.0.34

func (a Stub) GetECDSAFromCoinbase(header *block.Header) (common.Address, error)

func (Stub) GetEpochBlockNumber added in v0.0.34

func (a Stub) GetEpochBlockNumber(epoch *big.Int) (*big.Int, error)

func (Stub) GetHeader added in v0.0.34

func (a Stub) GetHeader(hash common.Hash, number uint64) *block.Header

func (Stub) GetHeaderByHash added in v0.0.34

func (a Stub) GetHeaderByHash(hash common.Hash) *block.Header

func (Stub) GetHeaderByNumber added in v0.0.34

func (a Stub) GetHeaderByNumber(number uint64) *block.Header

func (Stub) GetMaxGarbageCollectedBlockNumber added in v0.0.34

func (a Stub) GetMaxGarbageCollectedBlockNumber() int64

func (Stub) GetReceiptsByHash added in v0.0.34

func (a Stub) GetReceiptsByHash(hash common.Hash) types.Receipts

func (Stub) GetVMConfig added in v0.0.34

func (a Stub) GetVMConfig() *vm.Config

func (Stub) GetVdfByNumber added in v0.0.34

func (a Stub) GetVdfByNumber(number uint64) []byte

func (Stub) GetVrfByNumber added in v0.0.34

func (a Stub) GetVrfByNumber(number uint64) []byte

func (Stub) HasBlock added in v0.0.34

func (a Stub) HasBlock(hash common.Hash, number uint64) bool

func (Stub) HasBlockAndState added in v0.0.34

func (a Stub) HasBlockAndState(hash common.Hash, number uint64) bool

func (Stub) HasState added in v0.0.34

func (a Stub) HasState(hash common.Hash) bool

func (Stub) InitTiKV added in v0.1.8

func (a Stub) InitTiKV(conf *harmonyconfig.TiKVConfig)

func (Stub) InsertChain added in v0.0.34

func (a Stub) InsertChain(chain types.Blocks, verifyHeaders bool) (int, error)

func (Stub) IsEnablePruneBeaconChainFeature added in v0.0.34

func (a Stub) IsEnablePruneBeaconChainFeature() bool

func (Stub) IsSameLeaderAsPreviousBlock added in v0.0.34

func (a Stub) IsSameLeaderAsPreviousBlock(block *types.Block) bool

func (Stub) IsSpent added in v0.0.34

func (a Stub) IsSpent(cxp *types.CXReceiptsProof) bool

func (Stub) IsTikvWriterMaster added in v0.1.8

func (a Stub) IsTikvWriterMaster() bool
func (a Stub) LastContinuousCrossLink(batch rawdb.DatabaseWriter, shardID uint32) error

func (Stub) Processor added in v0.0.34

func (a Stub) Processor() Processor

func (Stub) ReadBlockRewardAccumulator added in v0.0.34

func (a Stub) ReadBlockRewardAccumulator(number uint64) (*big.Int, error)

func (Stub) ReadCXReceipts added in v0.0.34

func (a Stub) ReadCXReceipts(shardID uint32, blockNum uint64, blockHash common.Hash) (types.CXReceipts, error)

func (Stub) ReadCommitSig added in v0.0.34

func (a Stub) ReadCommitSig(blockNum uint64) ([]byte, error)
func (a Stub) ReadCrossLink(shardID uint32, blockNum uint64) (*types.CrossLink, error)

func (Stub) ReadDelegationsByDelegator added in v0.0.34

func (a Stub) ReadDelegationsByDelegator(delegator common.Address) (m staking.DelegationIndexes, err error)

func (Stub) ReadDelegationsByDelegatorAt added in v0.0.34

func (a Stub) ReadDelegationsByDelegatorAt(delegator common.Address, blockNum *big.Int) (m staking.DelegationIndexes, err error)

func (Stub) ReadEpochVdfBlockNum added in v0.0.34

func (a Stub) ReadEpochVdfBlockNum(epoch *big.Int) (*big.Int, error)

func (Stub) ReadEpochVrfBlockNums added in v0.0.34

func (a Stub) ReadEpochVrfBlockNums(epoch *big.Int) ([]uint64, error)
func (a Stub) ReadPendingCrossLinks() ([]types.CrossLink, error)

func (Stub) ReadPendingSlashingCandidates added in v0.0.34

func (a Stub) ReadPendingSlashingCandidates() slash.Records
func (a Stub) ReadShardLastCrossLink(shardID uint32) (*types.CrossLink, error)

func (Stub) ReadShardState added in v0.0.34

func (a Stub) ReadShardState(epoch *big.Int) (*shard.State, error)

func (Stub) ReadTxLookupEntry added in v0.0.34

func (a Stub) ReadTxLookupEntry(txID common.Hash) (common.Hash, uint64, uint64)

func (Stub) ReadValidatorInformation added in v0.0.34

func (a Stub) ReadValidatorInformation(addr common.Address) (*staking.ValidatorWrapper, error)

func (Stub) ReadValidatorInformationAtRoot added in v0.0.34

func (a Stub) ReadValidatorInformationAtRoot(addr common.Address, root common.Hash) (*staking.ValidatorWrapper, error)

func (Stub) ReadValidatorInformationAtState added in v0.0.34

func (a Stub) ReadValidatorInformationAtState(addr common.Address, state *state.DB) (*staking.ValidatorWrapper, error)

func (Stub) ReadValidatorList added in v0.0.34

func (a Stub) ReadValidatorList() ([]common.Address, error)

func (Stub) ReadValidatorSnapshot added in v0.0.34

func (a Stub) ReadValidatorSnapshot(addr common.Address) (*staking.ValidatorSnapshot, error)

func (Stub) ReadValidatorSnapshotAtEpoch added in v0.0.34

func (a Stub) ReadValidatorSnapshotAtEpoch(epoch *big.Int, addr common.Address) (*staking.ValidatorSnapshot, error)

func (Stub) ReadValidatorStats added in v0.0.34

func (a Stub) ReadValidatorStats(addr common.Address) (*staking.ValidatorStats, error)

func (Stub) RedisPreempt added in v0.1.8

func (a Stub) RedisPreempt() *redis_helper.RedisPreempt

func (Stub) Rollback added in v0.0.34

func (a Stub) Rollback(chain []common.Hash) error
func (a Stub) SavePendingCrossLinks() error

func (Stub) SetHead added in v0.0.34

func (a Stub) SetHead(head uint64) error

func (Stub) ShardID added in v0.0.34

func (a Stub) ShardID() uint32

func (Stub) State added in v0.0.34

func (a Stub) State() (*state.DB, error)

func (Stub) StateAt added in v0.0.34

func (a Stub) StateAt(common.Hash) (*state.DB, error)

func (Stub) Stop added in v0.0.34

func (a Stub) Stop()

func (Stub) StoreEpochBlockNumber added in v0.0.34

func (a Stub) StoreEpochBlockNumber(epoch *big.Int, blockNum *big.Int) error

func (Stub) SubscribeChainEvent added in v0.0.34

func (a Stub) SubscribeChainEvent(ch chan<- ChainEvent) event.Subscription

func (Stub) SubscribeChainHeadEvent added in v0.0.34

func (a Stub) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription

func (Stub) SubscribeChainSideEvent added in v0.0.34

func (a Stub) SubscribeChainSideEvent(ch chan<- ChainSideEvent) event.Subscription

func (Stub) SubscribeLogsEvent added in v0.0.34

func (a Stub) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription

func (Stub) SubscribeRemovedLogsEvent added in v0.0.34

func (a Stub) SubscribeRemovedLogsEvent(ch chan<- RemovedLogsEvent) event.Subscription

func (Stub) SubscribeTraceEvent added in v0.0.34

func (a Stub) SubscribeTraceEvent(ch chan<- TraceEvent) event.Subscription

func (Stub) SuperCommitteeForNextEpoch added in v0.0.34

func (a Stub) SuperCommitteeForNextEpoch(beacon engine.ChainReader, header *block.Header, isVerify bool) (*shard.State, error)

func (Stub) SyncFromTiKVWriter added in v0.1.8

func (a Stub) SyncFromTiKVWriter(newBlkNum uint64, logs []*types.Log) error

func (Stub) UpdateBlockRewardAccumulator added in v0.0.34

func (a Stub) UpdateBlockRewardAccumulator(batch rawdb.DatabaseWriter, diff *big.Int, number uint64) error

func (Stub) UpdateStakingMetaData added in v0.0.34

func (a Stub) UpdateStakingMetaData(batch rawdb.DatabaseWriter, block *types.Block, stakeMsgs []staking.StakeMsg, state *state.DB, epoch, newEpoch *big.Int) (newValidators []common.Address, err error)

func (Stub) UpdateValidatorSnapshots added in v0.0.34

func (a Stub) UpdateValidatorSnapshots(batch rawdb.DatabaseWriter, epoch *big.Int, state *state.DB, newValidators []common.Address) error

func (Stub) UpdateValidatorVotingPower added in v0.0.34

func (a Stub) UpdateValidatorVotingPower(batch rawdb.DatabaseWriter, block *types.Block, newEpochSuperCommittee, currentEpochSuperCommittee *shard.State, state *state.DB) (map[common.Address]*staking.ValidatorStats, error)

func (Stub) ValidateNewBlock added in v0.0.34

func (a Stub) ValidateNewBlock(block *types.Block) error

func (Stub) Validator added in v0.0.34

func (a Stub) Validator() Validator

func (Stub) ValidatorCandidates added in v0.0.34

func (a Stub) ValidatorCandidates() []common.Address

func (Stub) WriteBlockRewardAccumulator added in v0.0.34

func (a Stub) WriteBlockRewardAccumulator(batch rawdb.DatabaseWriter, reward *big.Int, number uint64) error

func (Stub) WriteBlockWithState added in v0.0.34

func (a Stub) WriteBlockWithState(block *types.Block, receipts []*types.Receipt, cxReceipts []*types.CXReceipt, stakeMsgs []staking.StakeMsg, paid reward.Reader, state *state.DB) (status WriteStatus, err error)

func (Stub) WriteBlockWithoutState added in v0.0.34

func (a Stub) WriteBlockWithoutState(block *types.Block, td *big.Int) (err error)

func (Stub) WriteCXReceiptsProofSpent added in v0.0.34

func (a Stub) WriteCXReceiptsProofSpent(db rawdb.DatabaseWriter, cxps []*types.CXReceiptsProof) error

func (Stub) WriteCommitSig added in v0.0.34

func (a Stub) WriteCommitSig(blockNum uint64, lastCommits []byte) error
func (a Stub) WriteCrossLinks(batch rawdb.DatabaseWriter, cls []types.CrossLink) error

func (Stub) WriteEpochVdfBlockNum added in v0.0.34

func (a Stub) WriteEpochVdfBlockNum(epoch *big.Int, blockNum *big.Int) error

func (Stub) WriteEpochVrfBlockNums added in v0.0.34

func (a Stub) WriteEpochVrfBlockNums(epoch *big.Int, vrfNumbers []uint64) error

func (Stub) WriteHeadBlock added in v0.0.34

func (a Stub) WriteHeadBlock(block *types.Block) error

func (Stub) WriteShardStateBytes added in v0.0.34

func (a Stub) WriteShardStateBytes(db rawdb.DatabaseWriter, epoch *big.Int, shardState []byte) (*shard.State, error)

func (Stub) WriteValidatorList added in v0.0.34

func (a Stub) WriteValidatorList(db rawdb.DatabaseWriter, addrs []common.Address) error

func (Stub) WriteValidatorSnapshot added in v0.0.34

func (a Stub) WriteValidatorSnapshot(batch rawdb.DatabaseWriter, snapshot *staking.ValidatorSnapshot) error

type TraceEvent

type TraceEvent struct {
	Tracer *tracers.ParityBlockTracer
}

type TxPool

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

TxPool contains all currently known transactions. Transactions enter the pool when they are received from the network or submitted locally. They exit the pool when they are included in the blockchain.

The pool separates processable transactions (which can be applied to the current state) and future transactions. Transactions move between those two states over time as they are received and processed.

func NewTxPool

func NewTxPool(config TxPoolConfig, chainconfig *params.ChainConfig,
	chain blockChain, txErrorSink *types.TransactionErrorSink,
) *TxPool

NewTxPool creates a new transaction pool to gather, sort and filter inbound transactions from the network.

func (*TxPool) AddLocal

func (pool *TxPool) AddLocal(tx types.PoolTransaction) error

AddLocal enqueues a single transaction into the pool if it is valid, marking the sender as a local one in the mean time, ensuring it goes around the local pricing constraints.

func (*TxPool) AddLocals

func (pool *TxPool) AddLocals(txs types.PoolTransactions) []error

AddLocals enqueues a batch of transactions into the pool if they are valid, marking the senders as a local ones in the mean time, ensuring they go around the local pricing constraints.

func (*TxPool) AddRemote

func (pool *TxPool) AddRemote(tx types.PoolTransaction) error

AddRemote enqueues a single transaction into the pool if it is valid. If the sender is not among the locally tracked ones, full pricing constraints will apply.

func (*TxPool) AddRemotes

func (pool *TxPool) AddRemotes(txs types.PoolTransactions) []error

AddRemotes enqueues a batch of transactions into the pool if they are valid. If the senders are not among the locally tracked ones, full pricing constraints will apply.

func (*TxPool) Content

Content retrieves the data content of the transaction pool, returning all the pending as well as queued transactions, grouped by account and sorted by nonce.

func (*TxPool) GasPrice

func (pool *TxPool) GasPrice() *big.Int

GasPrice returns the current gas price enforced by the transaction pool.

func (*TxPool) Get

func (pool *TxPool) Get(hash common.Hash) types.PoolTransaction

Get returns a transaction if it is contained in the pool and nil otherwise.

func (*TxPool) GetTxPoolSize

func (pool *TxPool) GetTxPoolSize() uint64

GetTxPoolSize returns tx pool size.

func (*TxPool) Locals

func (pool *TxPool) Locals() []common.Address

Locals retrieves the accounts currently considered local by the pool.

func (*TxPool) Pending

func (pool *TxPool) Pending() (map[common.Address]types.PoolTransactions, error)

Pending retrieves all currently executable transactions, grouped by origin account and sorted by nonce. The returned transaction set is a copy and can be freely modified by calling code.

func (*TxPool) Queued

func (pool *TxPool) Queued() (map[common.Address]types.PoolTransactions, error)

Queued retrieves all currently non-executable transactions, grouped by origin account and sorted by nonce. The returned transaction set is a copy and can be freely modified by calling code.

func (*TxPool) SetGasPrice

func (pool *TxPool) SetGasPrice(price *big.Int)

SetGasPrice updates the minimum price required by the transaction pool for a new transaction, and drops all transactions below this threshold.

func (*TxPool) State

func (pool *TxPool) State() *state.ManagedState

State returns the virtual managed state of the transaction pool.

func (*TxPool) Stats

func (pool *TxPool) Stats() (int, int)

Stats retrieves the current pool stats, namely the number of pending and the number of queued (non-executable) transactions.

func (*TxPool) Status

func (pool *TxPool) Status(hashes []common.Hash) []TxStatus

Status returns the status (unknown/pending/queued) of a batch of transactions identified by their hashes.

func (*TxPool) Stop

func (pool *TxPool) Stop()

Stop terminates the transaction pool.

func (*TxPool) SubscribeNewTxsEvent

func (pool *TxPool) SubscribeNewTxsEvent(ch chan<- NewTxsEvent) event.Subscription

SubscribeNewTxsEvent registers a subscription of NewTxsEvent and starts sending event to the given channel.

type TxPoolConfig

type TxPoolConfig struct {
	Locals    []common.Address // Addresses that should be treated by default as local
	NoLocals  bool             // Whether local transaction handling should be disabled
	Journal   string           // Journal of local transactions to survive node restarts
	Rejournal time.Duration    // Time interval to regenerate the local transaction journal

	PriceLimit uint64 // Minimum gas price to enforce for acceptance into the pool
	PriceBump  uint64 // Minimum price bump to replace an already existing transaction (nonce)

	AccountSlots uint64 // Number of executable transaction slots guaranteed per account
	GlobalSlots  uint64 // Maximum number of executable transaction slots for all accounts
	AccountQueue uint64 // Maximum number of non-executable transaction slots permitted per account
	GlobalQueue  uint64 // Maximum number of non-executable transaction slots for all accounts

	Lifetime time.Duration // Maximum amount of time non-executable transaction are queued

	AddEvent func(tx types.PoolTransaction, local bool) // Fire add event

	Blacklist  map[common.Address]struct{}      // Set of accounts that cannot be a part of any transaction
	AllowedTxs map[common.Address]AllowedTxData // Set of allowed transactions can break the blocklist
}

TxPoolConfig are the configuration parameters of the transaction pool.

type TxStatus

type TxStatus uint

TxStatus is the current status of a transaction as seen by the pool.

const (
	TxStatusUnknown TxStatus = iota
	TxStatusQueued
	TxStatusPending
	TxStatusIncluded
)

Constants for TxStatus.

type Validator

type Validator interface {
	// ValidateBody validates the given block's content.
	ValidateBody(block *types.Block) error

	// ValidateState validates the given statedb and optionally the receipts and
	// gas used.
	ValidateState(block *types.Block, state *state.DB, receipts types.Receipts, cxs types.CXReceipts, usedGas uint64) error

	// ValidateHeader checks whether a header conforms to the consensus rules of a
	// given engine. Verifying the seal may be done optionally here, or explicitly
	// via the VerifySeal method.
	ValidateHeader(block *types.Block, seal bool) error

	// ValidateHeaders verifies a batch of blocks' headers concurrently. The method returns a quit channel
	// to abort the operations and a results channel to retrieve the async verifications
	ValidateHeaders(chain []*types.Block) (chan<- struct{}, <-chan error)

	// ValidateCXReceiptsProof checks whether the given CXReceiptsProof is consistency with itself
	ValidateCXReceiptsProof(cxp *types.CXReceiptsProof) error
}

Validator is an interface which defines the standard for block validation. It is only responsible for validating block contents, as the header validation is done by the specific consensus engines.

type WhCallback

type WhCallback func(*block.Header) error

WhCallback is a callback function for inserting individual headers. A callback is used for two reasons: first, in a LightChain, status should be processed and light chain events sent, while in a BlockChain this is not necessary since chain events are sent after inserting blocks. Second, the header writes should be protected by the parent chain mutex individually.

type WriteStatus

type WriteStatus byte

WriteStatus status of write

const (
	NonStatTy WriteStatus = iota
	CanonStatTy
	SideStatTy
)

Constants for WriteStatus

Directories

Path Synopsis
Package rawdb contains a collection of low level database accessors.
Package rawdb contains a collection of low level database accessors.
Package state provides a caching layer atop the Ethereum state trie.
Package state provides a caching layer atop the Ethereum state trie.
Package types contains data types related to Ethereum consensus.
Package types contains data types related to Ethereum consensus.
vm
Package vm implements the Ethereum Virtual Machine.
Package vm implements the Ethereum Virtual Machine.
runtime
Package runtime provides a basic execution model for executing EVM code.
Package runtime provides a basic execution model for executing EVM code.

Jump to

Keyboard shortcuts

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