quorum

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

  • Copyright (C) 2021 The poly network Authors
  • This file is part of The poly network library. *
  • The poly network is free software: you can redistribute it and/or modify
  • it under the terms of the GNU Lesser General Public License as published by
  • the Free Software Foundation, either version 3 of the License, or
  • (at your option) any later version. *
  • The poly network is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU Lesser General Public License for more details.
  • You should have received a copy of the GNU Lesser General Public License
  • along with The poly network . If not, see <http://www.gnu.org/licenses/>.

Copyright 2017 The go-ethereum Authors This file is part of the go-ethereum library.

The go-ethereum library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The go-ethereum library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

  • Copyright (C) 2021 The poly network Authors

  • This file is part of The poly network library. *

  • The poly network is free software: you can redistribute it and/or modify

  • it under the terms of the GNU Lesser General Public License as published by

  • the Free Software Foundation, either version 3 of the License, or

  • (at your option) any later version. *

  • The poly network is distributed in the hope that it will be useful,

  • but WITHOUT ANY WARRANTY; without even the implied warranty of

  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  • GNU Lesser General Public License for more details.

  • You should have received a copy of the GNU Lesser General Public License

  • along with The poly network . If not, see <http://www.gnu.org/licenses/>.

  • Copyright (C) 2021 The poly network Authors

  • This file is part of The poly network library. *

  • The poly network is free software: you can redistribute it and/or modify

  • it under the terms of the GNU Lesser General Public License as published by

  • the Free Software Foundation, either version 3 of the License, or

  • (at your option) any later version. *

  • The poly network is distributed in the hope that it will be useful,

  • but WITHOUT ANY WARRANTY; without even the implied warranty of

  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  • GNU Lesser General Public License for more details.

  • You should have received a copy of the GNU Lesser General Public License

  • along with The poly network . If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	IstanbulExtraVanity = 32 // Fixed number of extra-data bytes reserved for validator vanity
	IstanbulDigest      = ecom.HexToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365")
)

Functions

func CopyHeader

func CopyHeader(h *types.Header) *types.Header

copy from quorum

func GetCurrentValHeight

func GetCurrentValHeight(ns *native.NativeService, chainID uint64) (uint64, error)

func GetQuorumHeaderHash

func GetQuorumHeaderHash(h *types.Header) common.Hash

copy from quorum

func GetSignatureAddress

func GetSignatureAddress(data []byte, sig []byte) (common.Address, error)

copy from quorum

func GetSigners

func GetSigners(hash ecom.Hash, sealArr [][]byte) ([]ecom.Address, error)

func IstanbulFilteredHeader

func IstanbulFilteredHeader(h *types.Header, keepSeal bool) *types.Header

copy from quorum

func PrepareCommittedSeal

func PrepareCommittedSeal(hash common.Hash) []byte

copy from quorum

Types

type IstanbulExtra

type IstanbulExtra struct {
	Validators    []common.Address
	Seal          []byte
	CommittedSeal [][]byte
}

func ExtractIstanbulExtra

func ExtractIstanbulExtra(h *types.Header) (*IstanbulExtra, error)

copy from quorum

func VerifyQuorumHeader

func VerifyQuorumHeader(vs QuorumValSet, hdr *types.Header, isEpoch bool) (*IstanbulExtra, error)

func (*IstanbulExtra) DecodeRLP

func (ist *IstanbulExtra) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the istanbul fields from a RLP stream.

func (*IstanbulExtra) EncodeRLP

func (ist *IstanbulExtra) EncodeRLP(w io.Writer) error

EncodeRLP serializes ist into the Ethereum RLP format.

type QuorumHandler

type QuorumHandler struct{}

func NewQuorumHandler

func NewQuorumHandler() *QuorumHandler

func (*QuorumHandler) SyncBlockHeader

func (h *QuorumHandler) SyncBlockHeader(ns *native.NativeService) error

func (*QuorumHandler) SyncCrossChainMsg

func (h *QuorumHandler) SyncCrossChainMsg(ns *native.NativeService) error

func (*QuorumHandler) SyncGenesisHeader

func (h *QuorumHandler) SyncGenesisHeader(ns *native.NativeService) error

type QuorumValSet

type QuorumValSet []common.Address

func GetValSet

func GetValSet(ns *native.NativeService, chainID uint64) (QuorumValSet, error)

func (*QuorumValSet) Deserialize

func (vs *QuorumValSet) Deserialize(source *pcom.ZeroCopySource) error

func (QuorumValSet) Exist

func (vs QuorumValSet) Exist(address common.Address) bool

func (QuorumValSet) F

func (vs QuorumValSet) F() int

func (QuorumValSet) GetByAddress

func (vs QuorumValSet) GetByAddress(addr common.Address) (int, common.Address)

func (QuorumValSet) IfChanged

func (vs QuorumValSet) IfChanged(another QuorumValSet) bool

func (QuorumValSet) JustOneChanged

func (vs QuorumValSet) JustOneChanged(another QuorumValSet) error

func (QuorumValSet) Serialize

func (vs QuorumValSet) Serialize(sink *pcom.ZeroCopySink)

func (QuorumValSet) String

func (vs QuorumValSet) String() (res string)

func (QuorumValSet) VerifyCommittedSeals

func (vs QuorumValSet) VerifyCommittedSeals(extra *IstanbulExtra, hash common.Hash) error

func (QuorumValSet) VerifySigner

func (vs QuorumValSet) VerifySigner(hdr *types.Header, seal []byte) error

Jump to

Keyboard shortcuts

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