Documentation ¶
Overview ¶
Package mps is a generated GoMock package.
Index ¶
- Variables
- func UpgradeDB(db ethdb.Database, chain chainReader) error
- type DefaultPrivateStateRepository
- func (dpsr *DefaultPrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
- func (dpsr *DefaultPrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
- func (dpsr *DefaultPrivateStateRepository) Copy() PrivateStateRepository
- func (dpsr *DefaultPrivateStateRepository) DefaultState() (*state.StateDB, error)
- func (dpsr *DefaultPrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
- func (dpsr *DefaultPrivateStateRepository) IsMPS() bool
- func (dpsr *DefaultPrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
- func (dpsr *DefaultPrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
- func (dpsr *DefaultPrivateStateRepository) Reset() error
- func (dpsr *DefaultPrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
- type MockPrivateStateManager
- func (m *MockPrivateStateManager) CheckAt(blockHash common.Hash) error
- func (m *MockPrivateStateManager) EXPECT() *MockPrivateStateManagerMockRecorder
- func (m *MockPrivateStateManager) NotIncludeAny(psm *PrivateStateMetadata, managedParties ...string) bool
- func (m *MockPrivateStateManager) PSIs() []types.PrivateStateIdentifier
- func (m *MockPrivateStateManager) ResolveForManagedParty(managedParty string) (*PrivateStateMetadata, error)
- func (m *MockPrivateStateManager) ResolveForUserContext(ctx context.Context) (*PrivateStateMetadata, error)
- func (m *MockPrivateStateManager) StateRepository(blockHash common.Hash) (PrivateStateRepository, error)
- func (m *MockPrivateStateManager) TrieDB() *trie.Database
- type MockPrivateStateManagerMockRecorder
- func (mr *MockPrivateStateManagerMockRecorder) CheckAt(blockHash interface{}) *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) NotIncludeAny(psm interface{}, managedParties ...interface{}) *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) PSIs() *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) ResolveForManagedParty(managedParty interface{}) *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) ResolveForUserContext(ctx interface{}) *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) StateRepository(blockHash interface{}) *gomock.Call
- func (mr *MockPrivateStateManagerMockRecorder) TrieDB() *gomock.Call
- type MockPrivateStateMetadataResolver
- func (m *MockPrivateStateMetadataResolver) EXPECT() *MockPrivateStateMetadataResolverMockRecorder
- func (m *MockPrivateStateMetadataResolver) NotIncludeAny(psm *PrivateStateMetadata, managedParties ...string) bool
- func (m *MockPrivateStateMetadataResolver) PSIs() []types.PrivateStateIdentifier
- func (m *MockPrivateStateMetadataResolver) ResolveForManagedParty(managedParty string) (*PrivateStateMetadata, error)
- func (m *MockPrivateStateMetadataResolver) ResolveForUserContext(ctx context.Context) (*PrivateStateMetadata, error)
- type MockPrivateStateMetadataResolverMockRecorder
- func (mr *MockPrivateStateMetadataResolverMockRecorder) NotIncludeAny(psm interface{}, managedParties ...interface{}) *gomock.Call
- func (mr *MockPrivateStateMetadataResolverMockRecorder) PSIs() *gomock.Call
- func (mr *MockPrivateStateMetadataResolverMockRecorder) ResolveForManagedParty(managedParty interface{}) *gomock.Call
- func (mr *MockPrivateStateMetadataResolverMockRecorder) ResolveForUserContext(ctx interface{}) *gomock.Call
- type MockPrivateStateRepository
- func (m *MockPrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
- func (m *MockPrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
- func (m *MockPrivateStateRepository) Copy() PrivateStateRepository
- func (m *MockPrivateStateRepository) DefaultState() (*state.StateDB, error)
- func (m *MockPrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
- func (m *MockPrivateStateRepository) EXPECT() *MockPrivateStateRepositoryMockRecorder
- func (m *MockPrivateStateRepository) IsMPS() bool
- func (m *MockPrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
- func (m *MockPrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
- func (m *MockPrivateStateRepository) Reset() error
- func (m *MockPrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
- type MockPrivateStateRepositoryMockRecorder
- func (mr *MockPrivateStateRepositoryMockRecorder) Commit(isEIP158, block interface{}) *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) CommitAndWrite(isEIP158, block interface{}) *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) Copy() *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) DefaultState() *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) DefaultStateMetadata() *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) IsMPS() *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) MergeReceipts(pub, priv interface{}) *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) PrivateStateRoot(psi interface{}) *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) Reset() *gomock.Call
- func (mr *MockPrivateStateRepositoryMockRecorder) StatePSI(psi interface{}) *gomock.Call
- type MultiplePrivateStateRepository
- func (mpsr *MultiplePrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
- func (mpsr *MultiplePrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
- func (mpsr *MultiplePrivateStateRepository) Copy() PrivateStateRepository
- func (mpsr *MultiplePrivateStateRepository) DefaultState() (*state.StateDB, error)
- func (mpsr *MultiplePrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
- func (mpsr *MultiplePrivateStateRepository) IsMPS() bool
- func (mpsr *MultiplePrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
- func (mpsr *MultiplePrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
- func (mpsr *MultiplePrivateStateRepository) Reset() error
- func (mpsr *MultiplePrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
- type PrivateStateManager
- type PrivateStateMetadata
- type PrivateStateMetadataResolver
- type PrivateStateRepository
- type PrivateStateType
- type StateRootProviderFunc
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultPrivateStateMetadata is the metadata for the single private state being used // when MPS is disabled DefaultPrivateStateMetadata = NewPrivateStateMetadata( types.DefaultPrivateStateIdentifier, "private", "legacy private state", Resident, nil, ) // EmptyPrivateStateMetadata is the metadata for the empty private state being used // when MPS is enabled EmptyPrivateStateMetadata = NewPrivateStateMetadata( types.EmptyPrivateStateIdentifier, "empty", "empty state metadata", Resident, nil, ) )
Functions ¶
func UpgradeDB ¶
UpgradeDB performs the following database operations to enable MPS support 1. Construct and persist Empty Private State with empty accounts 2. Construct and persist trie of root hashes of existing private states 3. Update new mapping: block header root -> trie of private states root 4. Once upgrade is complete update the ChainConfig.isMPS to true
Types ¶
type DefaultPrivateStateRepository ¶
type DefaultPrivateStateRepository struct {
// contains filtered or unexported fields
}
DefaultPrivateStateRepository acts as the single private state in the original Quorum design.
func NewDefaultPrivateStateRepository ¶
func NewDefaultPrivateStateRepository(db ethdb.Database, cache state.Database, privateCacheProvider privatecache.Provider, previousBlockHash common.Hash) (*DefaultPrivateStateRepository, error)
func (*DefaultPrivateStateRepository) Commit ¶
func (dpsr *DefaultPrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
Commit commits the private state only
func (*DefaultPrivateStateRepository) CommitAndWrite ¶
func (dpsr *DefaultPrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
CommitAndWrite commits the private state and writes to disk
func (*DefaultPrivateStateRepository) Copy ¶
func (dpsr *DefaultPrivateStateRepository) Copy() PrivateStateRepository
func (*DefaultPrivateStateRepository) DefaultState ¶
func (dpsr *DefaultPrivateStateRepository) DefaultState() (*state.StateDB, error)
func (*DefaultPrivateStateRepository) DefaultStateMetadata ¶
func (dpsr *DefaultPrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
func (*DefaultPrivateStateRepository) IsMPS ¶
func (dpsr *DefaultPrivateStateRepository) IsMPS() bool
func (*DefaultPrivateStateRepository) MergeReceipts ¶
func (dpsr *DefaultPrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
Given a slice of public receipts and an overlapping (smaller) slice of private receipts, return a new slice where the default for each location is the public receipt but we take the private receipt in each place we have one.
func (*DefaultPrivateStateRepository) PrivateStateRoot ¶
func (dpsr *DefaultPrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
func (*DefaultPrivateStateRepository) Reset ¶
func (dpsr *DefaultPrivateStateRepository) Reset() error
func (*DefaultPrivateStateRepository) StatePSI ¶
func (dpsr *DefaultPrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
type MockPrivateStateManager ¶
type MockPrivateStateManager struct {
// contains filtered or unexported fields
}
MockPrivateStateManager is a mock of PrivateStateManager interface.
func NewMockPrivateStateManager ¶
func NewMockPrivateStateManager(ctrl *gomock.Controller) *MockPrivateStateManager
NewMockPrivateStateManager creates a new mock instance.
func (*MockPrivateStateManager) CheckAt ¶
func (m *MockPrivateStateManager) CheckAt(blockHash common.Hash) error
CheckAt mocks base method.
func (*MockPrivateStateManager) EXPECT ¶
func (m *MockPrivateStateManager) EXPECT() *MockPrivateStateManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPrivateStateManager) NotIncludeAny ¶
func (m *MockPrivateStateManager) NotIncludeAny(psm *PrivateStateMetadata, managedParties ...string) bool
NotIncludeAny mocks base method.
func (*MockPrivateStateManager) PSIs ¶
func (m *MockPrivateStateManager) PSIs() []types.PrivateStateIdentifier
PSIs mocks base method.
func (*MockPrivateStateManager) ResolveForManagedParty ¶
func (m *MockPrivateStateManager) ResolveForManagedParty(managedParty string) (*PrivateStateMetadata, error)
ResolveForManagedParty mocks base method.
func (*MockPrivateStateManager) ResolveForUserContext ¶
func (m *MockPrivateStateManager) ResolveForUserContext(ctx context.Context) (*PrivateStateMetadata, error)
ResolveForUserContext mocks base method.
func (*MockPrivateStateManager) StateRepository ¶
func (m *MockPrivateStateManager) StateRepository(blockHash common.Hash) (PrivateStateRepository, error)
StateRepository mocks base method.
func (*MockPrivateStateManager) TrieDB ¶
func (m *MockPrivateStateManager) TrieDB() *trie.Database
TrieDB mocks base method.
type MockPrivateStateManagerMockRecorder ¶
type MockPrivateStateManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockPrivateStateManagerMockRecorder is the mock recorder for MockPrivateStateManager.
func (*MockPrivateStateManagerMockRecorder) CheckAt ¶
func (mr *MockPrivateStateManagerMockRecorder) CheckAt(blockHash interface{}) *gomock.Call
CheckAt indicates an expected call of CheckAt.
func (*MockPrivateStateManagerMockRecorder) NotIncludeAny ¶
func (mr *MockPrivateStateManagerMockRecorder) NotIncludeAny(psm interface{}, managedParties ...interface{}) *gomock.Call
NotIncludeAny indicates an expected call of NotIncludeAny.
func (*MockPrivateStateManagerMockRecorder) PSIs ¶
func (mr *MockPrivateStateManagerMockRecorder) PSIs() *gomock.Call
PSIs indicates an expected call of PSIs.
func (*MockPrivateStateManagerMockRecorder) ResolveForManagedParty ¶
func (mr *MockPrivateStateManagerMockRecorder) ResolveForManagedParty(managedParty interface{}) *gomock.Call
ResolveForManagedParty indicates an expected call of ResolveForManagedParty.
func (*MockPrivateStateManagerMockRecorder) ResolveForUserContext ¶
func (mr *MockPrivateStateManagerMockRecorder) ResolveForUserContext(ctx interface{}) *gomock.Call
ResolveForUserContext indicates an expected call of ResolveForUserContext.
func (*MockPrivateStateManagerMockRecorder) StateRepository ¶
func (mr *MockPrivateStateManagerMockRecorder) StateRepository(blockHash interface{}) *gomock.Call
StateRepository indicates an expected call of StateRepository.
func (*MockPrivateStateManagerMockRecorder) TrieDB ¶
func (mr *MockPrivateStateManagerMockRecorder) TrieDB() *gomock.Call
TrieDB indicates an expected call of TrieDB.
type MockPrivateStateMetadataResolver ¶
type MockPrivateStateMetadataResolver struct {
// contains filtered or unexported fields
}
MockPrivateStateMetadataResolver is a mock of PrivateStateMetadataResolver interface.
func NewMockPrivateStateMetadataResolver ¶
func NewMockPrivateStateMetadataResolver(ctrl *gomock.Controller) *MockPrivateStateMetadataResolver
NewMockPrivateStateMetadataResolver creates a new mock instance.
func (*MockPrivateStateMetadataResolver) EXPECT ¶
func (m *MockPrivateStateMetadataResolver) EXPECT() *MockPrivateStateMetadataResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPrivateStateMetadataResolver) NotIncludeAny ¶
func (m *MockPrivateStateMetadataResolver) NotIncludeAny(psm *PrivateStateMetadata, managedParties ...string) bool
NotIncludeAny mocks base method.
func (*MockPrivateStateMetadataResolver) PSIs ¶
func (m *MockPrivateStateMetadataResolver) PSIs() []types.PrivateStateIdentifier
PSIs mocks base method.
func (*MockPrivateStateMetadataResolver) ResolveForManagedParty ¶
func (m *MockPrivateStateMetadataResolver) ResolveForManagedParty(managedParty string) (*PrivateStateMetadata, error)
ResolveForManagedParty mocks base method.
func (*MockPrivateStateMetadataResolver) ResolveForUserContext ¶
func (m *MockPrivateStateMetadataResolver) ResolveForUserContext(ctx context.Context) (*PrivateStateMetadata, error)
ResolveForUserContext mocks base method.
type MockPrivateStateMetadataResolverMockRecorder ¶
type MockPrivateStateMetadataResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockPrivateStateMetadataResolverMockRecorder is the mock recorder for MockPrivateStateMetadataResolver.
func (*MockPrivateStateMetadataResolverMockRecorder) NotIncludeAny ¶
func (mr *MockPrivateStateMetadataResolverMockRecorder) NotIncludeAny(psm interface{}, managedParties ...interface{}) *gomock.Call
NotIncludeAny indicates an expected call of NotIncludeAny.
func (*MockPrivateStateMetadataResolverMockRecorder) PSIs ¶
func (mr *MockPrivateStateMetadataResolverMockRecorder) PSIs() *gomock.Call
PSIs indicates an expected call of PSIs.
func (*MockPrivateStateMetadataResolverMockRecorder) ResolveForManagedParty ¶
func (mr *MockPrivateStateMetadataResolverMockRecorder) ResolveForManagedParty(managedParty interface{}) *gomock.Call
ResolveForManagedParty indicates an expected call of ResolveForManagedParty.
func (*MockPrivateStateMetadataResolverMockRecorder) ResolveForUserContext ¶
func (mr *MockPrivateStateMetadataResolverMockRecorder) ResolveForUserContext(ctx interface{}) *gomock.Call
ResolveForUserContext indicates an expected call of ResolveForUserContext.
type MockPrivateStateRepository ¶
type MockPrivateStateRepository struct {
// contains filtered or unexported fields
}
MockPrivateStateRepository is a mock of PrivateStateRepository interface.
func NewMockPrivateStateRepository ¶
func NewMockPrivateStateRepository(ctrl *gomock.Controller) *MockPrivateStateRepository
NewMockPrivateStateRepository creates a new mock instance.
func (*MockPrivateStateRepository) Commit ¶
func (m *MockPrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
Commit mocks base method.
func (*MockPrivateStateRepository) CommitAndWrite ¶
func (m *MockPrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
CommitAndWrite mocks base method.
func (*MockPrivateStateRepository) Copy ¶
func (m *MockPrivateStateRepository) Copy() PrivateStateRepository
Copy mocks base method.
func (*MockPrivateStateRepository) DefaultState ¶
func (m *MockPrivateStateRepository) DefaultState() (*state.StateDB, error)
DefaultState mocks base method.
func (*MockPrivateStateRepository) DefaultStateMetadata ¶
func (m *MockPrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
DefaultStateMetadata mocks base method.
func (*MockPrivateStateRepository) EXPECT ¶
func (m *MockPrivateStateRepository) EXPECT() *MockPrivateStateRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockPrivateStateRepository) IsMPS ¶
func (m *MockPrivateStateRepository) IsMPS() bool
IsMPS mocks base method.
func (*MockPrivateStateRepository) MergeReceipts ¶
func (m *MockPrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
MergeReceipts mocks base method.
func (*MockPrivateStateRepository) PrivateStateRoot ¶
func (m *MockPrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
PrivateStateRoot mocks base method.
func (*MockPrivateStateRepository) Reset ¶
func (m *MockPrivateStateRepository) Reset() error
Reset mocks base method.
func (*MockPrivateStateRepository) StatePSI ¶
func (m *MockPrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
StatePSI mocks base method.
type MockPrivateStateRepositoryMockRecorder ¶
type MockPrivateStateRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockPrivateStateRepositoryMockRecorder is the mock recorder for MockPrivateStateRepository.
func (*MockPrivateStateRepositoryMockRecorder) Commit ¶
func (mr *MockPrivateStateRepositoryMockRecorder) Commit(isEIP158, block interface{}) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockPrivateStateRepositoryMockRecorder) CommitAndWrite ¶
func (mr *MockPrivateStateRepositoryMockRecorder) CommitAndWrite(isEIP158, block interface{}) *gomock.Call
CommitAndWrite indicates an expected call of CommitAndWrite.
func (*MockPrivateStateRepositoryMockRecorder) Copy ¶
func (mr *MockPrivateStateRepositoryMockRecorder) Copy() *gomock.Call
Copy indicates an expected call of Copy.
func (*MockPrivateStateRepositoryMockRecorder) DefaultState ¶
func (mr *MockPrivateStateRepositoryMockRecorder) DefaultState() *gomock.Call
DefaultState indicates an expected call of DefaultState.
func (*MockPrivateStateRepositoryMockRecorder) DefaultStateMetadata ¶
func (mr *MockPrivateStateRepositoryMockRecorder) DefaultStateMetadata() *gomock.Call
DefaultStateMetadata indicates an expected call of DefaultStateMetadata.
func (*MockPrivateStateRepositoryMockRecorder) IsMPS ¶
func (mr *MockPrivateStateRepositoryMockRecorder) IsMPS() *gomock.Call
IsMPS indicates an expected call of IsMPS.
func (*MockPrivateStateRepositoryMockRecorder) MergeReceipts ¶
func (mr *MockPrivateStateRepositoryMockRecorder) MergeReceipts(pub, priv interface{}) *gomock.Call
MergeReceipts indicates an expected call of MergeReceipts.
func (*MockPrivateStateRepositoryMockRecorder) PrivateStateRoot ¶
func (mr *MockPrivateStateRepositoryMockRecorder) PrivateStateRoot(psi interface{}) *gomock.Call
PrivateStateRoot indicates an expected call of PrivateStateRoot.
func (*MockPrivateStateRepositoryMockRecorder) Reset ¶
func (mr *MockPrivateStateRepositoryMockRecorder) Reset() *gomock.Call
Reset indicates an expected call of Reset.
func (*MockPrivateStateRepositoryMockRecorder) StatePSI ¶
func (mr *MockPrivateStateRepositoryMockRecorder) StatePSI(psi interface{}) *gomock.Call
StatePSI indicates an expected call of StatePSI.
type MultiplePrivateStateRepository ¶
type MultiplePrivateStateRepository struct {
// contains filtered or unexported fields
}
MultiplePrivateStateRepository manages a number of state DB objects identified by their types.PrivateStateIdentifier. It also maintains a trie of private states whose root hash is mapped with a block hash.
func NewMultiplePrivateStateRepository ¶
func NewMultiplePrivateStateRepository(db ethdb.Database, cache state.Database, privateStatesTrieRoot common.Hash, privateCacheProvider privatecache.Provider) (*MultiplePrivateStateRepository, error)
func (*MultiplePrivateStateRepository) Commit ¶
func (mpsr *MultiplePrivateStateRepository) Commit(isEIP158 bool, block *types.Block) error
Commit commits all private states, updates the trie of private states only
func (*MultiplePrivateStateRepository) CommitAndWrite ¶
func (mpsr *MultiplePrivateStateRepository) CommitAndWrite(isEIP158 bool, block *types.Block) error
CommitAndWrite commits all private states, updates the trie of private states, writes to disk
func (*MultiplePrivateStateRepository) Copy ¶
func (mpsr *MultiplePrivateStateRepository) Copy() PrivateStateRepository
func (*MultiplePrivateStateRepository) DefaultState ¶
func (mpsr *MultiplePrivateStateRepository) DefaultState() (*state.StateDB, error)
func (*MultiplePrivateStateRepository) DefaultStateMetadata ¶
func (mpsr *MultiplePrivateStateRepository) DefaultStateMetadata() *PrivateStateMetadata
func (*MultiplePrivateStateRepository) IsMPS ¶
func (mpsr *MultiplePrivateStateRepository) IsMPS() bool
func (*MultiplePrivateStateRepository) MergeReceipts ¶
func (mpsr *MultiplePrivateStateRepository) MergeReceipts(pub, priv types.Receipts) types.Receipts
Given a slice of public receipts and an overlapping (smaller) slice of private receipts, return a new slice where the default for each location is the public receipt but we take the private receipt in each place we have one. Each entry for a private receipt will actually consist of a copy of a dummy auxiliary receipt, which holds the real private receipts for each PSI under PSReceipts[]. Note that we also add a private receipt for the "empty" PSI.
func (*MultiplePrivateStateRepository) PrivateStateRoot ¶
func (mpsr *MultiplePrivateStateRepository) PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error)
func (*MultiplePrivateStateRepository) Reset ¶
func (mpsr *MultiplePrivateStateRepository) Reset() error
func (*MultiplePrivateStateRepository) StatePSI ¶
func (mpsr *MultiplePrivateStateRepository) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error)
type PrivateStateManager ¶
type PrivateStateManager interface { PrivateStateMetadataResolver // StateRepository returns repository corresponding to a block hash StateRepository(blockHash common.Hash) (PrivateStateRepository, error) // CheckAt verifies if there's a state being managed at a block hash CheckAt(blockHash common.Hash) error // TrieDB returns the trie database TrieDB() *trie.Database }
PrivateStateManager interface separates
type PrivateStateMetadata ¶
type PrivateStateMetadata struct { ID types.PrivateStateIdentifier Name string Description string Type PrivateStateType // Addresses stores the public keys in the SAME ORDER being configured // in Tessera Addresses []string // contains filtered or unexported fields }
PrivateStateMetadata is the domain model in Quorum which maps with PrivacyGroup domain in Tessera
func NewPrivateStateMetadata ¶
func NewPrivateStateMetadata(id types.PrivateStateIdentifier, name, desc string, t PrivateStateType, addresses []string) *PrivateStateMetadata
func (*PrivateStateMetadata) FilterAddresses ¶
func (psm *PrivateStateMetadata) FilterAddresses(addresses ...string) []string
func (*PrivateStateMetadata) NotIncludeAny ¶
func (psm *PrivateStateMetadata) NotIncludeAny(addresses ...string) bool
func (*PrivateStateMetadata) String ¶
func (psm *PrivateStateMetadata) String() string
type PrivateStateMetadataResolver ¶
type PrivateStateMetadataResolver interface { ResolveForManagedParty(managedParty string) (*PrivateStateMetadata, error) ResolveForUserContext(ctx context.Context) (*PrivateStateMetadata, error) // PSIs returns list of types.PrivateStateIdentifier being managed PSIs() []types.PrivateStateIdentifier // NotIncludeAny returns true if NONE of the managedParties is a member // of the given psm, otherwise returns false NotIncludeAny(psm *PrivateStateMetadata, managedParties ...string) bool }
type PrivateStateRepository ¶
type PrivateStateRepository interface { PrivateStateRoot(psi types.PrivateStateIdentifier) (common.Hash, error) StatePSI(psi types.PrivateStateIdentifier) (*state.StateDB, error) CommitAndWrite(isEIP158 bool, block *types.Block) error Commit(isEIP158 bool, block *types.Block) error Copy() PrivateStateRepository Reset() error DefaultState() (*state.StateDB, error) DefaultStateMetadata() *PrivateStateMetadata IsMPS() bool MergeReceipts(pub, priv types.Receipts) types.Receipts }
PrivateStateRepository abstracts how we handle private state(s) including retrieving from and peristing private states to the underlying database
type PrivateStateType ¶
type PrivateStateType uint64
const ( Resident PrivateStateType = iota // 0 Legacy PrivateStateType = 1 << PrivateStateType(iota-1) // 1 Pantheon PrivateStateType = 1 << PrivateStateType(iota-1) // 2 )