remotedbserver

package
v0.0.0-...-ff78b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MaxTxTTL = 60 * time.Second

MaxTxTTL - kv interface provide high-consistancy guaranties: Serializable Isolations Level https://en.wikipedia.org/wiki/Isolation_(database_systems) But it comes with cost: DB will start grow if run too long read transactions (hours) We decided limit TTL of transaction to `MaxTxTTL`

It means you sill have `Serializable` if tx living < `MaxTxTTL` You start have Read Committed Level if tx living > `MaxTxTTL`

It's done by `renew` method: after `renew` call reader will see all changes committed after last `renew` call.

Erigon has much Historical data - which is immutable: reading of historical data for hours still gives you consistant data.

View Source
const PageSizeLimit = 4 * 4096

Variables

View Source
var KvServiceAPIVersion = &types.VersionReply{Major: 6, Minor: 2, Patch: 0}

KvServiceAPIVersion - use it to track changes in API 1.1.0 - added pending transactions, add methods eth_getRawTransactionByHash, eth_retRawTransactionByBlockHashAndIndex, eth_retRawTransactionByBlockNumberAndIndex| Yes | | 1.2.0 - Added separated services for mining and txpool methods 2.0.0 - Rename all buckets 3.0.0 - ?? 4.0.0 - Server send tx.ViewID() after open tx 5.0 - BlockTransaction table now has canonical ids (txs of non-canonical blocks moving to NonCanonicalTransaction table) 5.1.0 - Added blockGasLimit to the StateChangeBatch 6.0.0 - Blocks now have system-txs - in the begin/end of block 6.1.0 - Add methods Range, IndexRange, HistoryGet, HistoryRange 6.2.0 - Add HistoryFiles to reply of Snapshots() method

Functions

This section is empty.

Types

type KvServer

type KvServer struct {
	remote.UnimplementedKVServer // must be embedded to have forward compatible implementations.
	// contains filtered or unexported fields
}

func NewKvServer

func NewKvServer(ctx context.Context, db kv.RoDB, snapshots Snapsthots, historySnapshots Snapsthots, logger log.Logger) *KvServer

func (*KvServer) DomainGet

func (s *KvServer) DomainGet(ctx context.Context, req *remote.DomainGetReq) (reply *remote.DomainGetReply, err error)

Temporal methods

func (*KvServer) HistoryGet

func (s *KvServer) HistoryGet(ctx context.Context, req *remote.HistoryGetReq) (reply *remote.HistoryGetReply, err error)

func (*KvServer) IndexRange

func (s *KvServer) IndexRange(ctx context.Context, req *remote.IndexRangeReq) (*remote.IndexRangeReply, error)

func (*KvServer) Range

func (s *KvServer) Range(ctx context.Context, req *remote.RangeReq) (*remote.Pairs, error)

func (*KvServer) SendStateChanges

func (s *KvServer) SendStateChanges(ctx context.Context, sc *remote.StateChangeBatch)

func (*KvServer) Snapshots

func (*KvServer) StateChanges

func (s *KvServer) StateChanges(req *remote.StateChangeRequest, server remote.KV_StateChangesServer) error

func (*KvServer) Tx

func (s *KvServer) Tx(stream remote.KV_TxServer) error

func (*KvServer) Version

Version returns the service-side interface version number

type Snapsthots

type Snapsthots interface {
	Files() []string
}

type StateChangePubSub

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

func (*StateChangePubSub) Len

func (s *StateChangePubSub) Len() int

func (*StateChangePubSub) Pub

func (s *StateChangePubSub) Pub(reply *remote.StateChangeBatch)

func (*StateChangePubSub) Sub

func (s *StateChangePubSub) Sub() (ch chan *remote.StateChangeBatch, remove func())

Jump to

Keyboard shortcuts

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