Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateTransactions(SortedAndSelectedFundsTx []protocol.Transaction, block *protocol.Block) error
- func CheckAndChangeParameters(parameters *Parameters, configTxSlice *[]*protocol.ConfigTx) (change bool)
- func GetLatestProofs(n int, block *protocol.Block) (prevProofs [][crypto.COMM_PROOF_LENGTH]byte)
- func Init(validatorWallet *ecdsa.PublicKey, multisigWallet, rootWallet *ecdsa.PublicKey, ...)
- func InvertBlockArray(array []*protocol.Block) []*protocol.Block
- func IsInSameChain(b1, b2 *protocol.Block) bool
- func IsSigned(hash [32]byte, signature [64]byte, address [64]byte) bool
- func OrderedBy(less ...lessFunc) *multiSorter
- type ByHash
- type ByTxCount
- type Parameters
- type SlashingProof
Constants ¶
View Source
const ( //How many blocks can we verify dynamically (e.g. proper time check) until we are too far behind //that this dynamic check is not possible anymore?! DELAYED_BLOCKS = 10 TXFETCH_TIMEOUT = 2 //Sec BLOCKFETCH_TIMEOUT = 40 //Sec //Some prominent programming languages (e.g., Java) have not unsigned integer types //Neglecting MSB simplifies compatibility MAX_MONEY = 9223372036854775807 //(2^63)-1 //Default Block params BLOCKHASH_SIZE = 32 //Byte FEE_MINIMUM = 1 //Coins BLOCK_SIZE = 5000 //Byte DIFF_INTERVAL = 25 //Blocks BLOCK_INTERVAL = 15 //Sec BLOCK_REWARD = 0 //Coins STAKING_MINIMUM = 1000 //Coins WAITING_MINIMUM = 0 //Blocks ACCEPTED_TIME_DIFF = 60 //Sec SLASHING_WINDOW_SIZE = 100 //Blocks SLASH_REWARD = 2 //Coins NUM_INCL_PREV_PROOFS = 5 //Number of previous proofs included in the PoS condition NO_EMPTYING_LENGTH = 100 //Number of blocks after the newest block which are not moved to the empty block bucket FIXED_SPACE = 650 BLOOM_FILTER_SIZE = 8 )
Variables ¶
View Source
var SameChainMutex = sync.Mutex{}
Functions ¶
func AggregateTransactions ¶
func AggregateTransactions(SortedAndSelectedFundsTx []protocol.Transaction, block *protocol.Block) error
func CheckAndChangeParameters ¶
func CheckAndChangeParameters(parameters *Parameters, configTxSlice *[]*protocol.ConfigTx) (change bool)
Separate function to reuse mechanism in client implementation
func GetLatestProofs ¶
func Init ¶
func Init( validatorWallet *ecdsa.PublicKey, multisigWallet, rootWallet *ecdsa.PublicKey, validatorCommitment, rootCommitment *rsa.PrivateKey, rootChamHashParams *crypto.ChameleonHashParameters, )
Miner entry point
func IsInSameChain ¶
Check if two blocks are part of the same chain or if they appear in two competing chains
Types ¶
type Parameters ¶
type Parameters struct { BlockHash [BLOCKHASH_SIZE]byte FeeMinimum uint64 //Paid minimum fee for sending a tx. BlockSize uint64 //Block size in bytes. DiffInterval uint64 BlockInterval uint64 BlockReward uint64 //Reward for delivering the correct PoS. StakingMinimum uint64 //Minimum amount a validator must own for staking. WaitingMinimum uint64 //Number of blocks that must a new validator must wait before it can start validating. AcceptedTimeDiff uint64 //Number of seconds that a block can be received in the future. SlashingWindowSize uint64 //Number of blocks that a validator cannot vote on two competing chains. SlashReward uint64 //Reward for providing the correct slashing proof. FixedSpace int BloomFilterSize int // contains filtered or unexported fields }
An instance of this datastructure is created whenever system parameters change. The blockhash is additionally recorded to know which blocks the parameter change belongs to. This is necessary, because the system records ALL config txs (even those who have no corresponding code to execute [e.g., when they're running an older version of the code]).
func NewDefaultParameters ¶
func NewDefaultParameters() Parameters
func (Parameters) String ¶
func (param Parameters) String() string
Source Files ¶
- block.go
- block_accounttx.go
- block_aggregatetx.go
- block_configtx.go
- block_fundstx.go
- block_staketx.go
- block_updatetx.go
- block_validation.go
- blockchain.go
- blockchainparam.go
- blockpreparation.go
- blockrollback.go
- configs.go
- fetch_transactions.go
- longestchain.go
- p2p_interface.go
- proofofstake.go
- slashing.go
- state.go
- staterollback.go
- tx_verification.go
- utils.go
Click to show internal directories.
Click to hide internal directories.