Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( RtyAttNum = uint(5) RtyAtt = retry.Attempts(RtyAttNum) RtyDel = retry.Delay(time.Millisecond * 400) RtyErr = retry.LastErrorOnly(true) )
retries configuration for fetching light header
Functions ¶
This section is empty.
Types ¶
type TrustedHeaderFetcher ¶
type TrustedHeaderFetcher struct {
// contains filtered or unexported fields
}
TrustedHeaderFetcher able to get trusted headers for a given height Trusted headers are needed in Neutron along with proofs to verify that transactions are: - included in the block (inclusion proof) - successfully executed (delivery proof)
func NewTrustedHeaderFetcher ¶
func NewTrustedHeaderFetcher(neutronChain *relayer.Chain, targetChain *relayer.Chain, logger *zap.Logger) *TrustedHeaderFetcher
NewTrustedHeaderFetcher constructs a new TrustedHeaderFetcher
func (*TrustedHeaderFetcher) FetchTrustedHeaderForHeight ¶
func (thf *TrustedHeaderFetcher) FetchTrustedHeaderForHeight(ctx context.Context, height uint64) (header ibcexported.Header, err error)
FetchTrustedHeaderForHeight returns the best suitable TrustedHeader for given height Arguments: `height` - remote chain block height X = transaction with such block height
func (*TrustedHeaderFetcher) FetchTrustedHeadersForHeights ¶
func (thf *TrustedHeaderFetcher) FetchTrustedHeadersForHeights(ctx context.Context, height uint64) (header *codectypes.Any, nextHeader *codectypes.Any, err error)
FetchTrustedHeadersForHeights returns two Headers for height and height+1 packed into *codectypes.Any value We need two blocks in Neutron to verify both delivery of tx and inclusion in block: - We need to know block X (`header`) to verify inclusion of transaction for block X (inclusion proof) - We need to know block X+1 (`nextHeader`) to verify response of transaction for block X since LastResultsHash is root hash of all results from the txs from the previous block (delivery proof)
Arguments: `height` - remote chain block height X = transaction with such block height