Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick latest Terraform and Helm changes #14077

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ jobs:

# Run only the targeted rust unit tests. This is a PR required job.
rust-targeted-unit-tests:
if: | # Don't run on release branches. Instead, all unit tests will be triggered.
(
!contains(github.event.pull_request.base.ref, '-release-')
)
needs: file_change_determinator
runs-on: high-perf-docker
steps:
Expand All @@ -126,7 +130,8 @@ jobs:
(
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'CICD:run-all-unit-tests')
contains(github.event.pull_request.labels.*.name, 'CICD:run-all-unit-tests') ||
contains(github.event.pull_request.base.ref, '-release-')
)
runs-on: high-perf-docker
steps:
Expand Down
35 changes: 24 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ members = [
"third_party/move/tools/move-resource-viewer",
"third_party/move/tools/move-unit-test",
"tools/calc-dep-sizes",
"tools/compute-module-expansion-size",
"types",
"vm-validator",
]
Expand Down
17 changes: 12 additions & 5 deletions api/types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,13 @@ impl ValidatorTransaction {
ValidatorTransaction::DkgResult(t) => t.timestamp,
}
}

pub fn events(&self) -> &[Event] {
match self {
ValidatorTransaction::ObservedJwkUpdate(t) => &t.events,
ValidatorTransaction::DkgResult(t) => &t.events,
}
}
}

impl
Expand Down Expand Up @@ -690,9 +697,9 @@ impl From<QuorumCertifiedUpdate> for ExportedQuorumCertifiedUpdate {
/// A more API-friendly representation of the on-chain `aptos_types::aggregate_signature::AggregateSignature`.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct ExportedAggregateSignature {
signer_indices: Vec<usize>,
pub signer_indices: Vec<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
sig: Option<HexEncodedBytes>,
pub sig: Option<HexEncodedBytes>,
}

impl From<AggregateSignature> for ExportedAggregateSignature {
Expand Down Expand Up @@ -744,9 +751,9 @@ pub struct DKGResultTransaction {

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct ExportedDKGTranscript {
epoch: U64,
author: Address,
payload: HexEncodedBytes,
pub epoch: U64,
pub author: Address,
pub payload: HexEncodedBytes,
}

impl From<DKGTranscript> for ExportedDKGTranscript {
Expand Down
5 changes: 4 additions & 1 deletion aptos-move/aptos-gas-schedule/src/ver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
/// - Changing how gas is calculated in any way
///
/// Change log:
/// - V21
/// - Fix type to type tag conversion in MoveVM
/// - V20
/// - Limits for bounding MoveVM type sizes
/// - V19
Expand Down Expand Up @@ -64,7 +66,7 @@
/// global operations.
/// - V1
/// - TBA
pub const LATEST_GAS_FEATURE_VERSION: u64 = 20;
pub const LATEST_GAS_FEATURE_VERSION: u64 = gas_feature_versions::RELEASE_V1_16;

pub mod gas_feature_versions {
pub const RELEASE_V1_8: u64 = 11;
Expand All @@ -76,4 +78,5 @@ pub mod gas_feature_versions {
pub const RELEASE_V1_13: u64 = 18;
pub const RELEASE_V1_14: u64 = 19;
pub const RELEASE_V1_15: u64 = 20;
pub const RELEASE_V1_16: u64 = 21;
}
11 changes: 6 additions & 5 deletions aptos-move/aptos-release-builder/data/release.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
remote_endpoint: ~
name: "v1.14"
name: "v1.16"
proposals:
- name: step_1_upgrade_framework
metadata:
title: "Multi-step proposal to upgrade mainnet framework to v1.14"
description: "This includes changes in https://github.com/aptos-labs/aptos-core/commits/aptos-release-v1.13"
title: "Multi-step proposal to upgrade mainnet framework to v1.16"
description: "This includes changes in https://github.com/aptos-labs/aptos-core/commits/aptos-release-v1.16"
execution_mode: MultiStep
update_sequence:
- Gas:
old: https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/gas/v1.15.2.json
new: https://raw.githubusercontent.com/aptos-labs/aptos-networks/main/gas/v1.16.1-rc.json
- Framework:
bytecode_version: 6
git_hash: ~
- Gas:
new: current
6 changes: 2 additions & 4 deletions aptos-move/aptos-vm-types/src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,12 @@ impl Environment {
chain_id: ChainId,
ty_builder: TypeBuilder,
) -> Self {
// By default, do not use delayed field optimization. Instead, clients should enable it
// manually where applicable.
let delayed_field_optimization_enabled = false;
let pseudo_meter_vector_ty_to_ty_tag_construction = true;

let vm_config = aptos_prod_vm_config(
&features,
&timed_features,
delayed_field_optimization_enabled,
pseudo_meter_vector_ty_to_ty_tag_construction,
ty_builder,
);

Expand Down
14 changes: 13 additions & 1 deletion aptos-move/aptos-vm/src/aptos_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use aptos_types::{
move_utils::as_move_value::AsMoveValue,
on_chain_config::{
new_epoch_event_key, ApprovedExecutionHashes, ConfigStorage, FeatureFlag, Features,
OnChainConfig, TimedFeatures,
OnChainConfig, TimedFeatureFlag, TimedFeatures,
},
randomness::Randomness,
state_store::{StateView, TStateView},
Expand Down Expand Up @@ -1431,6 +1431,18 @@ impl AptosVM {
// TODO: Revisit the order of traversal. Consider switching to alphabetical order.
}

if self
.timed_features()
.is_enabled(TimedFeatureFlag::ModuleComplexityCheck)
{
for (module, blob) in modules.iter().zip(bundle.iter()) {
// TODO(Gas): Make budget configurable.
let budget = 2048 + blob.code().len() as u64 * 20;
move_binary_format::check_complexity::check_module_complexity(module, budget)
.map_err(|err| err.finish(Location::Undefined))?;
}
}

// Validate the module bundle
self.validate_publish_request(session, modules, expected_modules, allowed_deps)?;

Expand Down
1 change: 1 addition & 0 deletions aptos-move/aptos-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

#![forbid(unsafe_code)]
#![deny(deprecated)]

//! # The VM runtime
//!
Expand Down
27 changes: 9 additions & 18 deletions aptos-move/aptos-vm/src/move_vm_ext/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use crate::{
use aptos_crypto::HashValue;
use aptos_gas_algebra::DynamicExpression;
use aptos_gas_schedule::{
AptosGasParameters, MiscGasParameters, NativeGasParameters, LATEST_GAS_FEATURE_VERSION,
gas_feature_versions::RELEASE_V1_16, AptosGasParameters, MiscGasParameters,
NativeGasParameters, LATEST_GAS_FEATURE_VERSION,
};
use aptos_native_interface::SafeNativeBuilder;
use aptos_types::{
Expand All @@ -21,7 +22,7 @@ use aptos_vm_types::{
environment::{aptos_default_ty_builder, aptos_prod_ty_builder, Environment},
storage::change_set_configs::ChangeSetConfigs,
};
use move_vm_runtime::{config::VMConfig, move_vm::MoveVM};
use move_vm_runtime::move_vm::MoveVM;
use std::{ops::Deref, sync::Arc};

/// MoveVM wrapper which is used to run genesis initializations. Designed as a
Expand All @@ -39,13 +40,11 @@ impl GenesisMoveVM {
let features = Features::default();
let timed_features = TimedFeaturesBuilder::enable_all().build();

// Genesis runs sessions, where there is no concept of block execution.
// Hence, delayed fields are not enabled.
let delayed_field_optimization_enabled = false;
let pseudo_meter_vector_ty_to_ty_tag_construction = true;
let vm_config = aptos_prod_vm_config(
&features,
&timed_features,
delayed_field_optimization_enabled,
pseudo_meter_vector_ty_to_ty_tag_construction,
aptos_default_ty_builder(&features),
);

Expand Down Expand Up @@ -142,18 +141,10 @@ impl MoveVmExt {
);

// TODO(George): Move gas configs to environment to avoid this clone!
let vm_config = VMConfig {
verifier_config: env.vm_config().verifier_config.clone(),
deserializer_config: env.vm_config().deserializer_config.clone(),
paranoid_type_checks: env.vm_config().paranoid_type_checks,
check_invariant_in_swap_loc: env.vm_config().check_invariant_in_swap_loc,
max_value_nest_depth: env.vm_config().max_value_nest_depth,
type_max_cost: env.vm_config().type_max_cost,
type_base_cost: env.vm_config().type_base_cost,
type_byte_cost: env.vm_config().type_byte_cost,
delayed_field_optimization_enabled: env.vm_config().delayed_field_optimization_enabled,
ty_builder,
};
let mut vm_config = env.vm_config().clone();
vm_config.pseudo_meter_vector_ty_to_ty_tag_construction =
gas_feature_version >= RELEASE_V1_16;
vm_config.ty_builder = ty_builder;

Self {
inner: WarmVmCache::get_warm_vm(
Expand Down
7 changes: 5 additions & 2 deletions aptos-move/aptos-vm/src/verifier/resource_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use aptos_framework::{ResourceGroupScope, RuntimeModuleMetadataV1};
use move_binary_format::{
access::ModuleAccess,
errors::{Location, PartialVMError, VMError, VMResult},
normalized::Struct,
CompiledModule,
};
use move_core_types::{
Expand Down Expand Up @@ -172,7 +171,11 @@ pub(crate) fn extract_resource_group_metadata_from_module(
let structs = module
.struct_defs()
.iter()
.map(|d| Struct::new(&module, d).0.into_string())
.map(|struct_def| {
let struct_handle = module.struct_handle_at(struct_def.struct_handle);
let name = module.identifier_at(struct_handle.name).to_string();
name
})
.collect::<BTreeSet<_>>();
Ok((groups, members, structs))
} else {
Expand Down
Loading
Loading