Documentation ¶
Overview ¶
Package e2e implements the Oasis e2e test scenarios.
Index ¶
- Constants
- Variables
- func RegisterScenarios() error
- type Scenario
- func (sc *Scenario) ChainContext(ctx context.Context) (string, error)
- func (sc *Scenario) Clone() scenario.Scenario
- func (sc *Scenario) DumpRestoreNetwork(childEnv *env.Env, fixture *oasis.NetworkFixture, doDbDump bool, ...) error
- func (sc *Scenario) EnsureProposalFinalized(ctx context.Context, content *governance.ProposalContent, entity *oasis.Entity, ...) (*governance.Proposal, uint64, beacon.EpochTime, error)
- func (sc *Scenario) EntityNonce(ctx context.Context, ent *entity.Entity) (uint64, error)
- func (sc *Scenario) EntityNonceByID(ctx context.Context, id signature.PublicKey) (uint64, error)
- func (sc *Scenario) ExportedGenesisFiles(skipCompute bool) ([]string, error)
- func (sc *Scenario) Fixture() (*oasis.NetworkFixture, error)
- func (sc *Scenario) Init(_ *env.Env, net *oasis.Network) error
- func (sc *Scenario) Name() string
- func (sc *Scenario) Network() *oasis.Network
- func (sc *Scenario) Parameters() *env.ParameterFlagSet
- func (sc *Scenario) PreInit() error
- func (sc *Scenario) RegisterEntity(childEnv *env.Env, cli *cli.Helpers, ent *oasis.Entity, nonce uint64) error
- func (sc *Scenario) RegisterRuntime(childEnv *env.Env, cli *cli.Helpers, rt registry.Runtime, nonce uint64) error
- func (sc *Scenario) ResetConsensusState(childEnv *env.Env, flags map[uint8]bool) error
- func (sc *Scenario) Run(context.Context, *env.Env) error
- func (sc *Scenario) TestEntityNonce(ctx context.Context) (uint64, error)
- func (sc *Scenario) TrustRoot(ctx context.Context) (*TrustRoot, error)
- func (sc *Scenario) WaitBlocks(ctx context.Context, n int) (*consensus.Block, error)
- func (sc *Scenario) WaitEpochs(ctx context.Context, n beacon.EpochTime) error
- type TrustRoot
Constants ¶
const ( PreserveValidatorRuntimeStorage uint8 = iota PreserveValidatorLocalStorage ForceValidatorReset PreserveComputeWorkerRuntimeStorage PreserveComputeWorkerLocalStorage ForceComputeWorkerReset PreserveClientRuntimeStorage PreserveClientLocalStorage ForceClientReset PreserveByzantineRuntimeStorage PreserveByzantineLocalStorage ForceByzantineReset PreserveSentryRuntimeStorage PreserveSentryLocalStorage ForceSentryReset PreserveKeymanagerRuntimeStorage PreserveKeymanagerLocalStorage ForceKeymanagerReset )
Flag for consensus state reset.
Variables ¶
var ( // ByzantineVRFBeaconHonest is the honest byzantine VRF beacon scenario. ByzantineVRFBeaconHonest scenario.Scenario = &byzantineVRFBeaconImpl{ Scenario: *NewScenario("byzantine/beacon-vrf-honest"), extraArgs: []oasis.Argument{ {Name: byzantine.CfgVRFBeaconMode, Values: []string{byzantine.ModeVRFBeaconHonest.String()}}, }, identitySeed: byzantineBeaconIdentitySeed, } // ByzantineVRFBeaconEarly is the early-proof byzantine beacon scenario. ByzantineVRFBeaconEarly scenario.Scenario = &byzantineVRFBeaconImpl{ Scenario: *NewScenario("byzantine/beacon-vrf-early"), extraArgs: []oasis.Argument{ {Name: byzantine.CfgVRFBeaconMode, Values: []string{byzantine.ModeVRFBeaconEarly.String()}}, }, identitySeed: byzantineBeaconIdentitySeed, } // ByzantineVRFBeaconMissing is the missing-proof byzantine beacon scenario. ByzantineVRFBeaconMissing scenario.Scenario = &byzantineVRFBeaconImpl{ Scenario: *NewScenario("byzantine/beacon-vrf-missing"), extraArgs: []oasis.Argument{ {Name: byzantine.CfgVRFBeaconMode, Values: []string{byzantine.ModeVRFBeaconMissing.String()}}, }, identitySeed: byzantineBeaconIdentitySeed, } )
var ( // GasFeesStaking is the staking gas fees scenario. GasFeesStaking scenario.Scenario = &gasFeesImpl{ Scenario: *NewScenario("gas-fees/staking"), } // GasFeesStakingDumpRestore is the staking gas fees scenario with // dump-restore. GasFeesStakingDumpRestore scenario.Scenario = &gasFeesImpl{ Scenario: *NewScenario("gas-fees/staking-dump-restore"), dumpRestore: true, } )
var ( TestEntityAccount = stakingTests.AddressFromString("oasis1qq7us2p22udg2t24u6ry4m29wzql005pjsske8gt") DeterministicEntity1 = stakingTests.AddressFromString("oasis1qqncl383h8458mr9cytatygctzwsx02n4c5f8ed7") DeterministicEntity2 = stakingTests.AddressFromString("oasis1qznshq4ttrgh83d9wqvgmsuq3pfsndg3tus7lx98") DeterministicEntity3 = stakingTests.AddressFromString("oasis1qrz6kjp9lu6vc6snhlszq3p2nlx76qasaqr2auqk") DeterministicEntity4 = stakingTests.AddressFromString("oasis1qqw3ka3eeuy5qaytyhesxtj4fe5pp0xkdy954uwk") DeterministicValidator0 = stakingTests.AddressFromString("oasis1qpt202cf6t0s5ugkk34p83yf0c30gpjkny92u7dh") DeterministicValidator1 = stakingTests.AddressFromString("oasis1qryg8qf3ydzcphr328l8psz007fms9dxeuy8lgzq") DeterministicValidator2 = stakingTests.AddressFromString("oasis1qz74khszg55gfnmpxut3t3gdymn76hfchu9nhtd0") DeterministicValidator3 = stakingTests.AddressFromString("oasis1qqkspsglt3quhpkghr837trfwm048srjuv8g92jj") DeterministicCompute0 = stakingTests.AddressFromString("oasis1qp6tl30ljsrrqnw2awxxu2mtxk0qxyy2nymtsy90") DeterministicCompute1 = stakingTests.AddressFromString("oasis1qr77y0cqdzcqgz2wqkv59yz0j4vfvyryfv8vxllt") DeterministicCompute2 = stakingTests.AddressFromString("oasis1qzyw75ds6nw0af98xfmmpl3z8sgf3mdslvtzzcn6") DeterministicCompute3 = stakingTests.AddressFromString("oasis1qrp7l53vn6h2z7p242ldtkqtttz2jf9dwsgu05aa") DeterministicCompute4 = stakingTests.AddressFromString("oasis1qzpgrrd7435s2vaxr6s7xhqxusu4muq3y5qyph7u") DeterministicStorage0 = stakingTests.AddressFromString("oasis1qrhp36j49ncpaac0aufwyuvtk04nfxcj2yq7y4my") DeterministicStorage1 = stakingTests.AddressFromString("oasis1qzc2fexm30puzq2cmlm832fvpnyaxrq33cx4zukj") DeterministicStorage2 = stakingTests.AddressFromString("oasis1qq2t9c27y6kylqz4n6qmh3vn9zessh8guglsg8qc") DeterministicStorage3 = stakingTests.AddressFromString("oasis1qz359ng7waf2lp7j8c6vzd6qw4g4xtelysr0hl6x") DeterministicKeyManager0 = stakingTests.AddressFromString("oasis1qpx0k28va6n0r25qd2j4jdh9f42n5vex6s9lp780") DeterministicKeyManager1 = stakingTests.AddressFromString("oasis1qz30d8mqzrsrsu7fr0e6nxk0ze7ffdkj8ur7sqp0") )
Deterministic Test Accounts.
var ( // NodeUpgradeDummy is the node upgrade dummy scenario. NodeUpgradeDummy scenario.Scenario = newNodeUpgradeImpl(migrations.DummyUpgradeHandler, &dummyUpgradeChecker{}, true) // NodeUpgradeEmpty is the empty node upgrade scenario. NodeUpgradeEmpty scenario.Scenario = newNodeUpgradeImpl(migrations.EmptyHandler, &noOpUpgradeChecker{}, false) // NodeUpgradeConsensus240 is the node upgrade scenario for migrating to consensus 24.0. NodeUpgradeConsensus240 scenario.Scenario = newNodeUpgradeImpl(migrations.Consensus240, &upgrade240Checker{}, false) // NodeUpgradeConsensus242 is the node upgrade scenario for migrating to consensus 24.2. NodeUpgradeConsensus242 scenario.Scenario = newNodeUpgradeImpl(migrations.Consensus242, &upgrade242Checker{}, false) )
var ChangeParametersMinCommissionRate scenario.Scenario = newConsensusParameterUpgradeImpl( "change-parameters-min-commission-rate", &api.ChangeParametersProposal{ Module: staking.ModuleName, Changes: cbor.Marshal(minCommissionRateChanges), }, &minCommissionRateChecker{}, )
ChangeParametersMinCommissionRate is the governance change parameters scenario that changes minimum commission rate.
var ChangeParametersRewardSchedule scenario.Scenario = newChangeRewardScheduleImpl( "change-parameters-reward-schedule", &api.ChangeParametersProposal{ Module: staking.ModuleName, Changes: cbor.Marshal(rewardScheduleChanges), }, )
ChangeParametersRewardSchedule is the governance change parameters scenario that changes the reward schedule.
var ConsensusStateSync scenario.Scenario = &consensusStateSyncImpl{ Scenario: *NewScenario("consensus-state-sync"), }
ConsensusStateSync is the consensus state sync scenario.
var Debond scenario.Scenario = &debondImpl{ Scenario: *NewScenario("debond"), }
Debond tests debonding records created in the genesis document.
var GenesisFile scenario.Scenario = &genesisFileImpl{ Scenario: *NewScenario("genesis-file"), }
GenesisFile is the scenario for testing the correctness of marshalled genesis documents.
var IdentityCLI scenario.Scenario = &identityCLIImpl{ Scenario: *NewScenario("identity-cli"), }
IdentityCLI is the identity CLI scenario.
var ( MinTransactBalance scenario.Scenario = &minTransactBalanceImpl{ Scenario: *NewScenario("min-transact-balance"), } )
var MultipleSeeds scenario.Scenario = &multipleSeeds{ Scenario: *NewScenario("multiple-seeds"), }
MultipleSeeds is the scenario where multiple seed nodes are used.
var NodeUpgradeCancel scenario.Scenario = newNodeUpgradeCancelImpl()
NodeUpgradeCancel is the node upgrade scenario.
var ParamsDummyScenario = NewScenario("")
ParamsDummyScenario is a dummy instance of E2E scenario used to register global E2E flags.
var SeedAPI scenario.Scenario = &seedAPI{ Scenario: *NewScenario("seed-api"), }
SeedAPI is the scenario where seed node control and consensus APIs are tested.
var ValidatorEquivocation scenario.Scenario = &validatorEquivocationImpl{ Scenario: *NewScenario("validator-equivocation"), }
ValidatorEquivocation is the validator equivocation scenario.
Functions ¶
func RegisterScenarios ¶
func RegisterScenarios() error
RegisterScenarios registers all end-to-end scenarios.
Types ¶
type Scenario ¶ added in v0.2202.9
type Scenario struct { Net *oasis.Network Flags *env.ParameterFlagSet Logger *logging.Logger // contains filtered or unexported fields }
Scenario is a base scenario for oasis-node end-to-end tests.
func NewScenario ¶ added in v0.2202.9
NewScenario creates a new base scenario for oasis-node end-to-end tests.
func (*Scenario) ChainContext ¶ added in v0.2300.0
ChainContext returns the consensus chain context.
func (*Scenario) DumpRestoreNetwork ¶ added in v0.2202.9
func (sc *Scenario) DumpRestoreNetwork( childEnv *env.Env, fixture *oasis.NetworkFixture, doDbDump bool, genesisMapFn func(*genesis.Document), resetFlags map[uint8]bool, ) error
DumpRestoreNetwork first dumps the current network state and then attempts to restore it.
func (*Scenario) EnsureProposalFinalized ¶ added in v0.2300.0
func (sc *Scenario) EnsureProposalFinalized(ctx context.Context, content *governance.ProposalContent, entity *oasis.Entity, entityNonce uint64, currentEpoch beacon.EpochTime) (*governance.Proposal, uint64, beacon.EpochTime, error)
EnsureProposalFinalized submits a proposal, votes for it and ensures the proposal is finalized.
func (*Scenario) EntityNonce ¶ added in v0.2300.0
EntityNonce returns the nonce of the specified entity.
func (*Scenario) EntityNonceByID ¶ added in v0.2300.0
EntityNonceByID returns the nonce of the specified entity.
func (*Scenario) ExportedGenesisFiles ¶ added in v0.2300.0
ExportedGenesisFiles gathers exported genesis files and ensures all exported genesis files match.
func (*Scenario) Fixture ¶ added in v0.2202.9
func (sc *Scenario) Fixture() (*oasis.NetworkFixture, error)
Fixture implements scenario.Scenario.
func (*Scenario) Parameters ¶ added in v0.2202.9
func (sc *Scenario) Parameters() *env.ParameterFlagSet
Parameters implements scenario.Scenario.
func (*Scenario) RegisterEntity ¶ added in v0.2300.0
func (sc *Scenario) RegisterEntity(childEnv *env.Env, cli *cli.Helpers, ent *oasis.Entity, nonce uint64) error
RegisterEntity registers the specified entity.
func (*Scenario) RegisterRuntime ¶ added in v0.2300.0
func (sc *Scenario) RegisterRuntime(childEnv *env.Env, cli *cli.Helpers, rt registry.Runtime, nonce uint64) error
RegisterRuntime registers the specified runtime.
func (*Scenario) ResetConsensusState ¶ added in v0.2202.9
ResetConsensusState removes all consensus state, preserving runtime storage and node-local storage databases unless specified with flags otherwise.
func (*Scenario) TestEntityNonce ¶ added in v0.2300.0
TestEntityNonce returns the nonce of the test entity.
func (*Scenario) TrustRoot ¶ added in v0.2300.0
TrustRoot returns a suitable trust root after running the network for a few blocks.
func (*Scenario) WaitBlocks ¶ added in v0.2300.0
WaitBlocks waits for the specified number of blocks.
Source Files ¶
- byzantine_beacon_vrf.go
- change_reward_schedule.go
- consensus_parameter_upgrade.go
- consensus_state_sync.go
- debond.go
- gas_fees_staking.go
- genesis_file.go
- helpers_consensus.go
- helpers_network.go
- identity_cli.go
- min_transact_balance.go
- multiple_seeds.go
- scenario.go
- seed_api.go
- test_accounts.go
- upgrade.go
- upgrade_cancel.go
- validator_equivocation.go