Documentation ¶
Index ¶
- Constants
- Variables
- type KvServer
- func (s *KvServer) DomainGet(ctx context.Context, req *remote.DomainGetReq) (reply *remote.DomainGetReply, err error)
- func (s *KvServer) HistoryGet(ctx context.Context, req *remote.HistoryGetReq) (reply *remote.HistoryGetReply, err error)
- func (s *KvServer) IndexRange(ctx context.Context, req *remote.IndexRangeReq) (*remote.IndexRangeReply, error)
- func (s *KvServer) Range(ctx context.Context, req *remote.RangeReq) (*remote.Pairs, error)
- func (s *KvServer) SendStateChanges(ctx context.Context, sc *remote.StateChangeBatch)
- func (s *KvServer) Snapshots(ctx context.Context, _ *remote.SnapshotsRequest) (*remote.SnapshotsReply, error)
- func (s *KvServer) StateChanges(req *remote.StateChangeRequest, server remote.KV_StateChangesServer) error
- func (s *KvServer) Tx(stream remote.KV_TxServer) error
- func (s *KvServer) Version(context.Context, *emptypb.Empty) (*types.VersionReply, error)
- type Snapsthots
- type StateChangePubSub
Constants ¶
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.
const PageSizeLimit = 4 * 4096
Variables ¶
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) SendStateChanges ¶
func (s *KvServer) SendStateChanges(ctx context.Context, sc *remote.StateChangeBatch)
func (*KvServer) Snapshots ¶
func (s *KvServer) Snapshots(ctx context.Context, _ *remote.SnapshotsRequest) (*remote.SnapshotsReply, error)
func (*KvServer) StateChanges ¶
func (s *KvServer) StateChanges(req *remote.StateChangeRequest, server remote.KV_StateChangesServer) error
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())