Documentation ¶
Index ¶
- Variables
- func RegisterScenarios() error
- type KeyValueEncTestClient
- func (cli *KeyValueEncTestClient) Clone() TestClient
- func (cli *KeyValueEncTestClient) Init(scenario *runtimeImpl) error
- func (cli *KeyValueEncTestClient) Start(ctx context.Context, childEnv *env.Env) error
- func (cli *KeyValueEncTestClient) Wait() error
- func (cli *KeyValueEncTestClient) WithKey(key string) *KeyValueEncTestClient
- func (cli *KeyValueEncTestClient) WithSeed(seed string) *KeyValueEncTestClient
- type KeyValueTestClient
- func (cli *KeyValueTestClient) Clone() TestClient
- func (cli *KeyValueTestClient) Init(scenario *runtimeImpl) error
- func (cli *KeyValueTestClient) Kill() error
- func (cli *KeyValueTestClient) Start(ctx context.Context, childEnv *env.Env) error
- func (cli *KeyValueTestClient) Wait() error
- func (cli *KeyValueTestClient) WithRepeat() *KeyValueTestClient
- func (cli *KeyValueTestClient) WithSeed(seed string) *KeyValueTestClient
- type LongTermMode
- type LongTermTestClient
- func (cli *LongTermTestClient) Clone() TestClient
- func (cli *LongTermTestClient) Init(scenario *runtimeImpl) error
- func (cli *LongTermTestClient) Start(ctx context.Context, childEnv *env.Env) error
- func (cli *LongTermTestClient) Wait() error
- func (cli *LongTermTestClient) WithMode(mode LongTermMode) *LongTermTestClient
- func (cli *LongTermTestClient) WithSeed(seed string) *LongTermTestClient
- type TestClient
- type TxnCall
- type TxnOutput
Constants ¶
This section is empty.
Variables ¶
var ( // ByzantineExecutorHonest is the byzantine executor honest scenario. ByzantineExecutorHonest scenario.Scenario = newByzantineImpl( "executor-honest", "executor", nil, oasis.ByzantineDefaultIdentitySeed, false, nil, nil, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, }, ) // ByzantineExecutorSchedulerHonest is the byzantine executor scheduler honest scenario. ByzantineExecutorSchedulerHonest scenario.Scenario = newByzantineImpl( "executor-scheduler-honest", "executor", nil, oasis.ByzantineSlot1IdentitySeed, false, nil, []oasis.Argument{ {Name: byzantine.CfgSchedulerRoleExpected}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, IsScheduler: true, }, ) // ByzantineExecutorWrong is the byzantine executor wrong scenario. ByzantineExecutorWrong scenario.Scenario = newByzantineImpl( "executor-wrong", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertNoTimeouts(), oasis.LogAssertNoRoundFailures(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineDefaultIdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeIncorrectResults: 1, staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorWrong.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, }, ) // ByzantineExecutorSchedulerWrong is the byzantine executor wrong scheduler scenario. ByzantineExecutorSchedulerWrong scenario.Scenario = newByzantineImpl( "executor-scheduler-wrong", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertRoundFailures(), oasis.LogAssertTimeouts(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineSlot1IdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgSchedulerRoleExpected}, {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorWrong.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, IsScheduler: true, }, ) // ByzantineExecutorSchedulerBogus is the byzantine executor scheduler with bogus txs scenario. ByzantineExecutorSchedulerBogus scenario.Scenario = newByzantineImpl( "executor-scheduler-bogus", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertRoundFailures(), oasis.LogAssertTimeouts(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineSlot1IdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgSchedulerRoleExpected}, {Name: byzantine.CfgExecutorProposeBogusTx}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, IsScheduler: true, }, ) // ByzantineExecutorStraggler is the byzantine executor straggler scenario. ByzantineExecutorStraggler scenario.Scenario = newByzantineImpl( "executor-straggler", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertTimeouts(), oasis.LogAssertNoRoundFailures(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineDefaultIdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorStraggler.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, }, ) // ByzantineExecutorSchedulerStraggler is the byzantine executor scheduler straggler scenario. ByzantineExecutorSchedulerStraggler scenario.Scenario = newByzantineImpl( "executor-scheduler-straggler", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertRoundFailures(), oasis.LogAssertTimeouts(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineSlot1IdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgSchedulerRoleExpected}, {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorStraggler.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, IsScheduler: true, }, ) // ByzantineExecutorFailureIndicating is the byzantine executor that submits failure indicating // commitments scenario. ByzantineExecutorFailureIndicating scenario.Scenario = newByzantineImpl( "executor-failure-indicating", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertNoTimeouts(), oasis.LogAssertNoRoundFailures(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineDefaultIdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorFailureIndicating.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, }, ) // ByzantineExecutorSchedulerFailureIndicating is the byzantine executor scheduler failure indicating scenario. ByzantineExecutorSchedulerFailureIndicating scenario.Scenario = newByzantineImpl( "executor-scheduler-failure-indicating", "executor", []log.WatcherHandlerFactory{ oasis.LogAssertRoundFailures(), oasis.LogAssertTimeouts(), oasis.LogAssertExecutionDiscrepancyDetected(), }, oasis.ByzantineSlot1IdentitySeed, false, map[staking.SlashReason]uint64{ staking.SlashRuntimeLiveness: 1, }, []oasis.Argument{ {Name: byzantine.CfgSchedulerRoleExpected}, {Name: byzantine.CfgExecutorMode, Values: []string{byzantine.ModeExecutorFailureIndicating.String()}}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, IsScheduler: true, }, ) // ByzantineExecutorCorruptGetDiff is the byzantine executor node scenario that corrupts GetDiff // responses. ByzantineExecutorCorruptGetDiff scenario.Scenario = newByzantineImpl( "executor-corrupt-getdiff", "executor", nil, oasis.ByzantineDefaultIdentitySeed, false, nil, []oasis.Argument{ {Name: byzantine.CfgCorruptGetDiff}, }, scheduler.ForceElectCommitteeRole{ Kind: scheduler.KindComputeExecutor, Role: scheduler.RoleWorker, }, ) )
var ( // DumpRestore is the dump and restore scenario. DumpRestore scenario.Scenario = newDumpRestoreImpl("dump-restore", nil) // DumpRestoreRuntimeRoundAdvance is the scenario where additional rounds are simulated after // the runtime stopped in the old network (so storage node state is behind). DumpRestoreRuntimeRoundAdvance scenario.Scenario = newDumpRestoreImpl( "dump-restore/runtime-round-advance", func(doc *genesis.Document) { for _, st := range doc.RootHash.RuntimeStates { st.Round += 10 } }, ) )
var ( // GovernanceConsensusUpgrade is the governance consensus upgrade scenario. GovernanceConsensusUpgrade scenario.Scenario = newGovernanceConsensusUpgradeImpl(true, false) // GovernanceConsensusFailUpgrade is the governance consensus upgrade scenario // where node should fail the upgrade. GovernanceConsensusFailUpgrade scenario.Scenario = newGovernanceConsensusUpgradeImpl(false, false) // GovernanceConsensusCancelUpgrade is the governance consensus upgrade scenario // where the pending upgrade is canceled. GovernanceConsensusCancelUpgrade scenario.Scenario = newGovernanceConsensusUpgradeImpl(true, true) )
var ( // HaltRestore is the halt and restore scenario. HaltRestore scenario.Scenario = newHaltRestoreImpl(false) // HaltRestoreSuspended is the halt and restore scenario with a suspended runtime. HaltRestoreSuspended scenario.Scenario = newHaltRestoreImpl(true) )
var ( // RuntimeParamsDummy is a dummy instance of runtimeImpl used to register global e2e/runtime flags. RuntimeParamsDummy *runtimeImpl = newRuntimeImpl("", nil) // Runtime is the basic network + client test case with runtime support. Runtime scenario.Scenario = newRuntimeImpl("runtime", BasicKVTestClient) // RuntimeEncryption is the basic network + client with encryption test case. RuntimeEncryption scenario.Scenario = newRuntimeImpl("runtime-encryption", BasicKVEncTestClient) // DefaultRuntimeLogWatcherHandlerFactories is a list of default log watcher // handler factories for the basic scenario. DefaultRuntimeLogWatcherHandlerFactories = []log.WatcherHandlerFactory{ oasis.LogAssertNoTimeouts(), oasis.LogAssertNoRoundFailures(), oasis.LogAssertNoExecutionDiscrepancyDetected(), } )
var BasicKVEncTestClient = NewKeyValueEncTestClient()
var BasicKVTestClient = NewKeyValueTestClient()
var GasFeesRuntimes scenario.Scenario = &gasFeesRuntimesImpl{ runtimeImpl: *newRuntimeImpl("gas-fees/runtimes", nil), }
GasFeesRuntimes is the runtime gas fees scenario.
var HaltRestoreNonMock scenario.Scenario = newHaltRestoreNonMockImpl()
HaltRestoreNonMock is the halt and restore scenario that uses the real beacon backend.
var HistoryReindex scenario.Scenario = newHistoryReindexImpl()
HistoryReindex is the scenario that triggers roothash history reindexing.
var KeymanagerReplicate scenario.Scenario = newKmReplicateImpl()
KeymanagerReplicate is the keymanager replication scenario.
var KeymanagerRestart scenario.Scenario = newKmRestartImpl()
KeymanagerRestart is the keymanager restart scenario.
var KeymanagerUpgrade scenario.Scenario = newKmUpgradeImpl()
KeymanagerUpgrade is the keymanager upgrade scenario.
var LateStart scenario.Scenario = newLateStartImpl("late-start")
LateStart is the LateStart node basic scenario.
var MultipleRuntimes = func() scenario.Scenario { sc := &multipleRuntimesImpl{ runtimeImpl: *newRuntimeImpl("multiple-runtimes", nil), } sc.Flags.Int(cfgNumComputeRuntimes, 2, "number of compute runtimes per worker") sc.Flags.Int(cfgNumComputeRuntimeTxns, 2, "number of transactions to perform") sc.Flags.Int(cfgNumComputeWorkers, 2, "number of workers to initiate") sc.Flags.Uint16(cfgExecutorGroupSize, 2, "number of executor workers in committee") return sc }()
MultipleRuntimes is a scenario which tests running multiple runtimes on one node.
var NodeShutdown scenario.Scenario = newNodeShutdownImpl()
NodeShutdown is the keymanager restart scenario.
var OffsetRestart scenario.Scenario = newOffsetRestartImpl()
OffsetRestart is the offset restart scenario..
var RuntimeDynamic scenario.Scenario = newRuntimeDynamicImpl()
RuntimeDynamic is the dynamic runtime registration scenario.
var RuntimeGovernance = func() scenario.Scenario { sc := &runtimeGovernanceImpl{ runtimeImpl: *newRuntimeImpl("runtime-governance", nil), } return sc }()
RuntimeGovernance is a scenario which tests runtime governance.
Two runtimes with the runtime governance model are created at genesis time. We submit an update_runtime runtime transaction with a slightly modified runtime descriptor to the first runtime. This transaction triggers the runtime to emit an update_runtime message, which in turn causes the runtime to be re-registered with the updated descriptor specified in the message. After an epoch transition, we fetch the runtime descriptor from the registry and check if the modification took place or not.
Additionally, we test that a runtime cannot update another runtime by passing a modified other runtime's descriptor to the update_runtime call of another runtime.
var ( // RuntimeMessage is the runtime message scenario. RuntimeMessage scenario.Scenario = newRuntimeMessage() )
var RuntimePrune scenario.Scenario = newRuntimePruneImpl()
RuntimePrune is the runtime prune scenario.
var RuntimeUpgrade scenario.Scenario = newRuntimeUpgradeImpl()
RuntimeUpgrade is the runtime upgrade scenario.
var ( // Sentry is the Sentry node basic scenario. Sentry scenario.Scenario = newSentryImpl("sentry", BasicKVTestClient) )
var StorageEarlyStateSync scenario.Scenario = newStorageEarlyStateSyncImpl()
StorageEarlyStateSync is the scenario where a runtime is registered first and is not yet operational, then a while later an executor node uses consensus layer state sync to catch up but the runtime has already advanced some epoch transition rounds and is no longer at genesis.
var StorageSync scenario.Scenario = newStorageSyncImpl()
StorageSync is the storage sync scenario.
var StorageSyncFromRegistered scenario.Scenario = newStorageSyncFromRegisteredImpl()
StorageSyncFromRegistered is the storage sync scenario which tests syncing from registered nodes not in committee.
var StorageSyncInconsistent scenario.Scenario = newStorageSyncInconsistentImpl()
StorageSyncInconsistent is the inconsistent storage sync scenario.
var TrustRoot scenario.Scenario = newTrustRootImpl()
TrustRoot is the consensus trust root verification scenario.
var TxSourceMulti scenario.Scenario = &txSourceImpl{ runtimeImpl: *newRuntimeImpl("txsource-multi", nil), clientWorkloads: []string{ workload.NameCommission, workload.NameDelegation, workload.NameOversized, workload.NameParallel, workload.NameRegistration, workload.NameRuntime, workload.NameTransfer, workload.NameGovernance, }, allNodeWorkloads: []string{ workload.NameQueries, }, timeLimit: timeLimitLong, nodeRestartInterval: nodeRestartIntervalLong, nodeLongRestartInterval: nodeLongRestartInterval, nodeLongRestartDuration: nodeLongRestartDuration, livenessCheckInterval: livenessCheckInterval, consensusPruneDisabledProbability: 0.1, consensusPruneMinKept: 100, consensusPruneMaxKept: 1000, enableCrashPoints: true, tendermintRecoverCorruptedWAL: true, numValidatorNodes: 4, numKeyManagerNodes: 2, numComputeNodes: 5, numClientNodes: 2, }
TxSourceMulti uses multiple workloads.
var TxSourceMultiShort scenario.Scenario = &txSourceImpl{ runtimeImpl: *newRuntimeImpl("txsource-multi-short", nil), clientWorkloads: []string{ workload.NameCommission, workload.NameDelegation, workload.NameOversized, workload.NameParallel, workload.NameRegistration, workload.NameRuntime, workload.NameTransfer, workload.NameGovernance, }, allNodeWorkloads: []string{ workload.NameQueries, }, timeLimit: timeLimitShort, livenessCheckInterval: livenessCheckInterval, consensusPruneDisabledProbability: 0.1, consensusPruneMinKept: 100, consensusPruneMaxKept: 200, numValidatorNodes: 4, numKeyManagerNodes: 2, numComputeNodes: 4, numClientNodes: 2, }
TxSourceMultiShort uses multiple workloads for a short time.
var TxSourceMultiShortSGX scenario.Scenario = &txSourceImpl{ runtimeImpl: *newRuntimeImpl("txsource-multi-short-sgx", nil), clientWorkloads: []string{ workload.NameCommission, workload.NameDelegation, workload.NameOversized, workload.NameParallel, workload.NameRegistration, workload.NameRuntime, workload.NameTransfer, workload.NameGovernance, }, allNodeWorkloads: []string{ workload.NameQueries, }, timeLimit: timeLimitShortSGX, livenessCheckInterval: livenessCheckInterval, consensusPruneDisabledProbability: 0.1, consensusPruneMinKept: 100, consensusPruneMaxKept: 200, numValidatorNodes: 3, numKeyManagerNodes: 1, numComputeNodes: 4, numClientNodes: 1, }
TxSourceMultiShortSGX uses multiple workloads for a short time.
Functions ¶
func RegisterScenarios ¶
func RegisterScenarios() error
RegisterScenarios registers all end-to-end scenarios.
Types ¶
type KeyValueEncTestClient ¶ added in v0.2103.0
type KeyValueEncTestClient struct {
// contains filtered or unexported fields
}
KeyValueEncTestClient is a client that exercises the simple key-value test runtime with encryption.
func NewKeyValueEncTestClient ¶ added in v0.2103.0
func NewKeyValueEncTestClient() *KeyValueEncTestClient
func (*KeyValueEncTestClient) Clone ¶ added in v0.2103.0
func (cli *KeyValueEncTestClient) Clone() TestClient
func (*KeyValueEncTestClient) Init ¶ added in v0.2103.0
func (cli *KeyValueEncTestClient) Init(scenario *runtimeImpl) error
func (*KeyValueEncTestClient) Wait ¶ added in v0.2103.0
func (cli *KeyValueEncTestClient) Wait() error
func (*KeyValueEncTestClient) WithKey ¶ added in v0.2103.0
func (cli *KeyValueEncTestClient) WithKey(key string) *KeyValueEncTestClient
func (*KeyValueEncTestClient) WithSeed ¶ added in v0.2103.0
func (cli *KeyValueEncTestClient) WithSeed(seed string) *KeyValueEncTestClient
type KeyValueTestClient ¶ added in v0.2103.0
type KeyValueTestClient struct {
// contains filtered or unexported fields
}
KeyValueTestClient is a client that exercises the simple key-value test runtime.
func NewKeyValueTestClient ¶ added in v0.2103.0
func NewKeyValueTestClient() *KeyValueTestClient
func (*KeyValueTestClient) Clone ¶ added in v0.2103.0
func (cli *KeyValueTestClient) Clone() TestClient
func (*KeyValueTestClient) Init ¶ added in v0.2103.0
func (cli *KeyValueTestClient) Init(scenario *runtimeImpl) error
func (*KeyValueTestClient) Kill ¶ added in v0.2103.0
func (cli *KeyValueTestClient) Kill() error
func (*KeyValueTestClient) Wait ¶ added in v0.2103.0
func (cli *KeyValueTestClient) Wait() error
func (*KeyValueTestClient) WithRepeat ¶ added in v0.2103.0
func (cli *KeyValueTestClient) WithRepeat() *KeyValueTestClient
func (*KeyValueTestClient) WithSeed ¶ added in v0.2103.0
func (cli *KeyValueTestClient) WithSeed(seed string) *KeyValueTestClient
type LongTermMode ¶ added in v0.2103.0
type LongTermMode int
const ( ModePart1 LongTermMode = iota ModePart1NoMsg ModePart2 )
type LongTermTestClient ¶ added in v0.2103.0
type LongTermTestClient struct {
// contains filtered or unexported fields
}
func NewLongTermTestClient ¶ added in v0.2103.0
func NewLongTermTestClient() *LongTermTestClient
func (*LongTermTestClient) Clone ¶ added in v0.2103.0
func (cli *LongTermTestClient) Clone() TestClient
func (*LongTermTestClient) Init ¶ added in v0.2103.0
func (cli *LongTermTestClient) Init(scenario *runtimeImpl) error
func (*LongTermTestClient) Wait ¶ added in v0.2103.0
func (cli *LongTermTestClient) Wait() error
func (*LongTermTestClient) WithMode ¶ added in v0.2103.0
func (cli *LongTermTestClient) WithMode(mode LongTermMode) *LongTermTestClient
func (*LongTermTestClient) WithSeed ¶ added in v0.2103.0
func (cli *LongTermTestClient) WithSeed(seed string) *LongTermTestClient
type TestClient ¶ added in v0.2103.0
type TestClient interface { Init(*runtimeImpl) error Start(context.Context, *env.Env) error Wait() error // Clone returns a clone of a RuntimeTestClient instance, in a state // that is ready for Init. Clone() TestClient }
TestClient is the interface exposed to implement a runtime test client that executes a pre-determined workload against a given runtime.
type TxnCall ¶ added in v0.2103.0
type TxnCall struct { // Method is the called method name. Method string `json:"method"` // Args are the method arguments. Args interface{} `json:"args"` }
TxnCall is a transaction call in the test runtime.
type TxnOutput ¶ added in v0.2103.0
type TxnOutput struct { // Success can be of any type. Success cbor.RawMessage // Error is a string describing the error message. Error *string }
TxnOutput is a transaction call output in the test runtime.
Source Files ¶
- byzantine.go
- dump_restore.go
- gas_fees.go
- governance_upgrade.go
- halt_restore.go
- halt_restore_nonmock.go
- history_reindex.go
- keymanager_replicate.go
- keymanager_restart.go
- keymanager_upgrade.go
- late_start.go
- multiple_runtimes.go
- node_shutdown.go
- offset_restart.go
- runtime.go
- runtime_client.go
- runtime_client_kv.go
- runtime_client_kv_enc.go
- runtime_client_longterm.go
- runtime_dynamic.go
- runtime_governance.go
- runtime_message.go
- runtime_prune.go
- runtime_upgrade.go
- sentry.go
- storage_early_state_sync.go
- storage_sync.go
- storage_sync_from_registered.go
- storage_sync_inconsistent.go
- trust_root.go
- txsource.go