Skip to content

Commit

Permalink
Merge #5041
Browse files Browse the repository at this point in the history
5041: Remove 0_9_0 chainspec r=EdHastingsCasperAssociation a=darthsiroftardis

Remove of old chainspecs that were used for testing that aren't required anymire
Removal of unnecessary fields and added comments to the added `enable_addressable_entity` field

Co-authored-by: Karan Dhareshwar <[email protected]>
Co-authored-by: edhastings <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
2 parents 7ce0125 + e32e798 commit 9213b9c
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 793 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub struct UpgradeRequestBuilder {
global_state_update: BTreeMap<Key, StoredValue>,
chainspec_registry: ChainspecRegistry,
fee_handling: FeeHandling,
migrate_legacy_accounts: bool,
migrate_legacy_contracts: bool,
maximum_delegation_amount: u64,
minimum_delegation_amount: u64,
enable_addressable_entity: bool,
Expand Down Expand Up @@ -126,18 +124,6 @@ impl UpgradeRequestBuilder {
self
}

/// Sets the migrate legacy accounts.
pub fn with_migrate_legacy_accounts(mut self, migrate_legacy_accounts: bool) -> Self {
self.migrate_legacy_accounts = migrate_legacy_accounts;
self
}

/// Sets the migrate legacy contracts.
pub fn with_migrate_legacy_contracts(mut self, migrate_legacy_contracts: bool) -> Self {
self.migrate_legacy_contracts = migrate_legacy_contracts;
self
}

/// Sets the maximum delegation for the validators bid during migration.
pub fn with_maximum_delegation_amount(mut self, maximum_delegation_amount: u64) -> Self {
self.maximum_delegation_amount = maximum_delegation_amount;
Expand Down Expand Up @@ -173,8 +159,6 @@ impl UpgradeRequestBuilder {
self.global_state_update,
self.chainspec_registry,
self.fee_handling,
self.migrate_legacy_accounts,
self.migrate_legacy_contracts,
self.maximum_delegation_amount,
self.minimum_delegation_amount,
self.enable_addressable_entity,
Expand All @@ -199,8 +183,6 @@ impl Default for UpgradeRequestBuilder {
global_state_update: Default::default(),
chainspec_registry: ChainspecRegistry::new_with_optional_global_state(&[], None),
fee_handling: FeeHandling::default(),
migrate_legacy_accounts: false,
migrate_legacy_contracts: false,
maximum_delegation_amount: u64::MAX,
minimum_delegation_amount: 0,
enable_addressable_entity: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@ fn should_upgrade_legacy_accounts() {
.with_activation_point(DEFAULT_ACTIVATION_POINT)
.with_minimum_delegation_amount(250_000_000_000)
.with_maximum_delegation_amount(500_000_000_000)
.with_migrate_legacy_accounts(true)
.build()
};

Expand Down
2 changes: 2 additions & 0 deletions node/src/components/transaction_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ impl TransactionBuffer {
timestamp,
);
if Timestamp::now() >= request_expiry {
debug!("TransactionBuffer: request expiry reached, returning empty proposal");
return ret;
}

Expand All @@ -463,6 +464,7 @@ impl TransactionBuffer {

while let Some(payload_hash) = payload_hashes_queue.pop_front() {
if Timestamp::now() > request_expiry {
debug!("TransactionBuffer: request expiry reached, returning proposal");
break;
}
#[cfg(test)]
Expand Down
22 changes: 12 additions & 10 deletions resources/local/chainspec.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ start_protocol_version_with_strict_finality_signatures_required = '1.5.0'
# `start_protocol_version_with_strict_finality_signatures_required`.
legacy_required_finality = 'Strict'

# If true, the protocol upgrade will migrate ALL userland accounts to addressable entity.
# If false, userland accounts will instead be left as is and will be lazily migrated
# on a per-account basis if / when that account is used during transaction execution.
migrate_legacy_accounts = true

# If true, the protocol upgrade will migrate ALL userland contracts to addressable entity.
# If false, userland contracts will instead be left as is and will be lazily migrated
# on a per-contract basis if / when that contract is used during transaction execution.
migrate_legacy_contracts = true

# Number of eras before an auction actually defines the set of validators. If you bond with a sufficient bid in era N,
# you will be a validator in era N + auction_delay + 1.
auction_delay = 1
Expand Down Expand Up @@ -164,6 +154,18 @@ gas_hold_interval = '24 hours'
# List of public keys of administrator accounts. Setting this option makes only on private chains which require
# administrator accounts for regulatory reasons.
administrators = []
# Flag that triggers a migration of all accounts and contracts present in global state to the addressable
# entity in lazy manner.
# If the flag is set to false then no accounts and contracts are migrated during a protocol upgrade;
# i.e all Account records will be present under Key::Account and Contracts and their associated ContractPackage
# will be written underneath Key::Hash.
# If the flag is set to true then accounts and contracts are migrated lazily; i.e on first use of the Account
# and/or Contract as part of the execution of a Transaction. This means the Accounts/Contracts will be migrated
# to their corresponding AddressableEntity and the NamedKeys for previous record and sepeareted and wrriten
# as discrete top level records. For Contracts specifically the entrypoints are also written as discrete top
# level records
# Note: Enabling of the AddressableEntity feature is one-way; i.e once enabled as part of a protocol upgrade
# the flag cannot be disabled in a future protocol upgrade.
enable_addressable_entity = false

[highway]
Expand Down
23 changes: 12 additions & 11 deletions resources/production/chainspec.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ start_protocol_version_with_strict_finality_signatures_required = '1.5.0'
# in a protocol version before
# `start_protocol_version_with_strict_finality_signatures_required`.
legacy_required_finality = 'Strict'

# If true, the protocol upgrade will migrate ALL userland accounts to addressable entity.
# If false, userland accounts will instead be left as is and will be lazily migrated
# on a per-account basis if / when that account is used during transaction execution.
migrate_legacy_accounts = true

# If true, the protocol upgrade will migrate ALL userland contracts to addressable entity.
# If false, userland contracts will instead be left as is and will be lazily migrated
# on a per-contract basis if / when that contract is used during transaction execution.
migrate_legacy_contracts = true

# Number of eras before an auction actually defines the set of validators. If you bond with a sufficient bid in era N,
# you will be a validator in era N + auction_delay + 1.
auction_delay = 1
Expand Down Expand Up @@ -171,6 +160,18 @@ gas_hold_interval = '24 hours'
# List of public keys of administrator accounts. Setting this option makes only on private chains which require
# administrator accounts for regulatory reasons.
administrators = []
# Flag that triggers a migration of all userland accounts and contracts present in global state to the addressable
# entity in lazy manner.
# If the flag is set to false then no accounts and contracts are migrated during a protocol upgrade;
# i.e all Account records will be present under Key::Account and Contracts and their associated ContractPackage
# will be written underneath Key::Hash.
# If the flag is set to true then accounts and contracts are migrated lazily; i.e on first use of the Account
# and/or Contract as part of the execution of a Transaction. This means the Accounts/Contracts will be migrated
# to their corresponding AddressableEntity and the NamedKeys for previous record and sepeareted and wrriten
# as discrete top level records. For Contracts specifically the entrypoints are also written as discrete top
# level records
# Note: Enabling of the AddressableEntity feature is one-way; i.e once enabled as part of a protocol upgrade
# the flag cannot be disabled in a future protocol upgrade.
enable_addressable_entity = false

[highway]
Expand Down
39 changes: 0 additions & 39 deletions resources/test/valid/0_9_0/accounts.toml

This file was deleted.

188 changes: 0 additions & 188 deletions resources/test/valid/0_9_0/chainspec.toml

This file was deleted.

Loading

0 comments on commit 9213b9c

Please sign in to comment.