Skip to content

Commit

Permalink
[dep] upgrade serde and serde-reflection (#11137)
Browse files Browse the repository at this point in the history
* fix generate-format
* update serde-reflection
* upgrade proptest
* fix aggregator tests due to proptest upgrade
  • Loading branch information
ibalajiarun committed Jan 4, 2024
1 parent 198fe38 commit 5718388
Show file tree
Hide file tree
Showing 13 changed files with 2,053 additions and 1,883 deletions.
3,855 changes: 2,011 additions & 1,844 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ backoff = { version = "0.4.0", features = ["tokio"] }
backtrace = "0.3.58"
bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" }
better_any = "0.1.1"
bigdecimal = { version = "0.3.0", features = ["serde"] }
bigdecimal = { version = "0.4.0", features = ["serde"] }
version-compare = "0.1.1"
bitvec = "1.0.1"
blake2 = "0.10.4"
Expand Down Expand Up @@ -594,8 +594,8 @@ project-root = "0.2.2"
prometheus = { version = "0.13.3", default-features = false }
prometheus-http-query = "0.5.2"
prometheus-parse = "0.2.4"
proptest = "1.0.0"
proptest-derive = "0.3.0"
proptest = "1.4.0"
proptest-derive = "0.4.0"
prost = "0.12.1"
prost-types = "0.12.1"
quanta = "0.10.1"
Expand Down Expand Up @@ -629,16 +629,14 @@ sha256 = "1.4.0"
sha2_0_10_6 = { package = "sha2", version = "0.10.6" }
sha3 = "0.9.1"
siphasher = "0.3.10"
# For more information about why we are pinned to 1.0.152, see this issue:
# https://github.com/aptos-labs/aptos-core/issues/10424
serde = { version = "=1.0.152", features = ["derive", "rc"] }
serde = { version = "1.0.193", features = ["derive", "rc"] }
serde_bytes = "0.11.6"
serde_json = { version = "1.0.81", features = ["preserve_order", "arbitrary_precision"] } # Note: arbitrary_precision is required to parse u256 in JSON
serde_repr = "0.1"
serde_merge = "0.1.3"
serde-name = "0.1.1"
serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev = "73b6bbf748334b71ff6d7d09d06a29e3062ca075" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "73b6bbf748334b71ff6d7d09d06a29e3062ca075" }
serde_yaml = "0.8.24"
shadow-rs = "0.16.2"
smallvec = "1.8.0"
Expand Down Expand Up @@ -762,7 +760,7 @@ debug-assertions = true
debug = true

[patch.crates-io]
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "73b6bbf748334b71ff6d7d09d06a29e3062ca075" }
merlin = { git = "https://github.com/aptos-labs/merlin" }
x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1" }
# More context here: https://github.com/weiznich/diesel_async/pull/121.
Expand Down
36 changes: 12 additions & 24 deletions api/doc/spec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
openapi: 3.0.0
info:
title: Aptos Node API
description: The Aptos Node API is a RESTful API for client applications to interact
with the Aptos blockchain.
description: The Aptos Node API is a RESTful API for client applications to interact with the Aptos blockchain.
version: 1.2.0
contact:
name: Aptos Labs
Expand Down Expand Up @@ -9172,8 +9171,7 @@ components:
vm_error_code:
type: integer
format: uint64
description: A code providing VM error details when submitting transactions
to the VM
description: A code providing VM error details when submitting transactions to the VM
AptosErrorCode:
type: string
description: |-
Expand Down Expand Up @@ -9273,8 +9271,7 @@ components:
description: Whether the transaction was successful
vm_status:
type: string
description: The VM status of the transaction, can tell useful information
in a failure
description: The VM status of the transaction, can tell useful information in a failure
accumulator_root_hash:
$ref: '#/components/schemas/HashValue'
changes:
Expand Down Expand Up @@ -9516,8 +9513,7 @@ components:
$ref: '#/components/schemas/Address'
secondary_signers:
type: array
description: The associated signatures, in the same order as the secondary
addresses
description: The associated signatures, in the same order as the secondary addresses
items:
$ref: '#/components/schemas/AccountSignature'
fee_payer_address:
Expand Down Expand Up @@ -9601,8 +9597,7 @@ components:
description: Whether the transaction was successful
vm_status:
type: string
description: The VM status of the transaction, can tell useful information
in a failure
description: The VM status of the transaction, can tell useful information in a failure
accumulator_root_hash:
$ref: '#/components/schemas/HashValue'
changes:
Expand Down Expand Up @@ -9716,8 +9711,7 @@ components:
$ref: '#/components/schemas/MoveFunctionVisibility'
is_entry:
type: boolean
description: Whether the function can be called as an entry function directly
in a transaction
description: Whether the function can be called as an entry function directly in a transaction
is_view:
type: boolean
description: Whether the function is a view function or not
Expand All @@ -9744,8 +9738,7 @@ components:
properties:
constraints:
type: array
description: Move abilities tied to the generic type param and associated
with the function that uses it
description: Move abilities tied to the generic type param and associated with the function that uses it
items:
$ref: '#/components/schemas/MoveAbility'
MoveFunctionVisibility:
Expand Down Expand Up @@ -9875,8 +9868,7 @@ components:
properties:
constraints:
type: array
description: Move abilities tied to the generic type param and associated
with the type that uses it
description: Move abilities tied to the generic type param and associated with the type that uses it
items:
$ref: '#/components/schemas/MoveAbility'
MoveStructTag:
Expand Down Expand Up @@ -10023,8 +10015,7 @@ components:
$ref: '#/components/schemas/Address'
secondary_signers:
type: array
description: The associated signatures, in the same order as the secondary
addresses
description: The associated signatures, in the same order as the secondary addresses
items:
$ref: '#/components/schemas/AccountSignature'
MultiEd25519Signature:
Expand Down Expand Up @@ -10247,8 +10238,7 @@ components:
description: Whether the transaction was successful
vm_status:
type: string
description: The VM status of the transaction, can tell useful information
in a failure
description: The VM status of the transaction, can tell useful information in a failure
accumulator_root_hash:
$ref: '#/components/schemas/HashValue'
changes:
Expand Down Expand Up @@ -10600,8 +10590,7 @@ components:
description: Whether the transaction was successful
vm_status:
type: string
description: The VM status of the transaction, can tell useful information
in a failure
description: The VM status of the transaction, can tell useful information in a failure
accumulator_root_hash:
$ref: '#/components/schemas/HashValue'
changes:
Expand Down Expand Up @@ -10662,8 +10651,7 @@ components:
description: Whether the transaction was successful
vm_status:
type: string
description: The VM status of the transaction, can tell useful information
in a failure
description: The VM status of the transaction, can tell useful information in a failure
accumulator_root_hash:
$ref: '#/components/schemas/HashValue'
changes:
Expand Down
2 changes: 1 addition & 1 deletion api/src/tests/transaction_vector_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl Formatter for NumberToStringFormatter {
}

// Formats u128 as a string
fn write_number_str<W>(&mut self, writer: &mut W, value: &str) -> io::Result<()>
fn write_u128<W>(&mut self, writer: &mut W, value: u128) -> io::Result<()>
where
W: ?Sized + io::Write,
{
Expand Down
3 changes: 2 additions & 1 deletion aptos-move/e2e-move-tests/src/tests/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ proptest! {
#![proptest_config(ProptestConfig {
// Cases are expensive, few cases is enough.
cases: 5,
result_cache: prop::test_runner::basic_result_cache,
// TODO: result cache breaks with proptest v1.1 and above because of this change: https://github.com/proptest-rs/proptest/pull/295.
// result_cache: prop::test_runner::basic_result_cache,
.. ProptestConfig::default()
})]

Expand Down
3 changes: 2 additions & 1 deletion aptos-move/e2e-move-tests/src/tests/aggregator_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ proptest! {
#![proptest_config(ProptestConfig {
// Cases are expensive, few cases is enough for these
cases: if STRESSTEST_MODE { 1000 } else { 10 },
result_cache: if STRESSTEST_MODE { prop::test_runner::noop_result_cache } else {prop::test_runner::basic_result_cache },
// TODO: result cache breaks with proptest v1.1 and above because of this change: https://github.com/proptest-rs/proptest/pull/295.
// result_cache: if STRESSTEST_MODE { prop::test_runner::noop_result_cache } else {prop::test_runner::basic_result_cache },
.. ProptestConfig::default()
})]

Expand Down
4 changes: 2 additions & 2 deletions crates/aptos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ move-unit-test = { workspace = true, features = [ "debugging" ] }
move-vm-runtime = { workspace = true, features = [ "testing" ] }
once_cell = { workspace = true }
poem = { workspace = true }
processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2d5cb211a89a8705674e9e1e741c841dd899c558" }
processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "af795c0a082385908d8ff3c72e54d53810e337fc" }
rand = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
self_update = { version = "0.38.0", features = ["archive-zip", "compression-zip-deflate"] }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2d5cb211a89a8705674e9e1e741c841dd899c558" }
server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "af795c0a082385908d8ff3c72e54d53810e337fc" }
tempfile = { workspace = true }
termcolor = { workspace = true }
thiserror = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/aptos/src/node/local_testnet/processors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ impl ProcessorManager {
starting_version: None,
ending_version: None,
number_concurrent_processing_tasks: None,
enable_verbose_logging: None,
};
let manager = Self {
config,
Expand Down
3 changes: 3 additions & 0 deletions testsuite/generate-format/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,8 @@ pub fn get_registry() -> Result<Registry> {
// output types
tracer.trace_type::<CoinStoreResource>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", &["type_params"])?;

tracer.registry()
}
4 changes: 4 additions & 0 deletions testsuite/generate-format/src/aptos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,9 @@ pub fn get_registry() -> Result<Registry> {
tracer.trace_type::<transaction::authenticator::AnyPublicKey>(&samples)?;
tracer.trace_type::<transaction::authenticator::AnySignature>(&samples)?;
tracer.trace_type::<write_set::WriteOp>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", &["type_params"])?;

tracer.registry()
}
3 changes: 3 additions & 0 deletions testsuite/generate-format/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,8 @@ pub fn get_registry() -> Result<Registry> {
tracer.trace_type::<aptos_consensus_types::block_retrieval::BlockRetrievalStatus>(&samples)?;
tracer.trace_type::<aptos_consensus_types::common::Payload>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", &["type_params"])?;

tracer.registry()
}
4 changes: 4 additions & 0 deletions testsuite/generate-format/src/move_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ pub fn get_registry() -> Result<Registry> {
// 2. Trace the main entry point(s) + every enum separately.
tracer.trace_type::<transaction::EntryABI>(&samples)?;
tracer.trace_type::<language_storage::TypeTag>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", &["type_params"])?;

tracer.registry()
}
2 changes: 1 addition & 1 deletion third_party/move/tools/move-bytecode-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ anyhow = "1.0.52"
move-binary-format = { path = "../../move-binary-format" }
move-core-types = { path = "../../move-core/types" }
petgraph = "0.5.1"
serde-reflection = "0.3.2"
serde-reflection = { workspace = true }

0 comments on commit 5718388

Please sign in to comment.