Skip to content

deps: make syn and serde_json be workspac dependencies, manualy upgrade bitflags from 1.3 to 2.9 #4850

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ axum = "0.7"
backtrace = "0.3"
base64 = "0.21.0"
bit-vec = "0.6.3"
bitflags = "1.0"
bitflags = "2.9"
blake2b-ref = "0.3"
bloom-filters = "0.1"
bs58 = "0.5.0"
Expand Down Expand Up @@ -266,12 +266,14 @@ secp256k1 = "0.30"
semver = "1.0"
sentry = "0.34.0"
serde = "1.0"
serde_json = "1.0"
serde_plain = "0.3.0"
slab = "0.4"
sled = "0.34.7"
snap = "1"
sql-builder = "3.1"
sqlx = "0.8.2"
syn = "2.0"
tera = "1"
thiserror = "1.0.22"
time = "0.3.36"
Expand Down
2 changes: 1 addition & 1 deletion ckb-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/nervosnetwork/ckb"
[dependencies]
clap = { workspace = true, features = ["string", "wrap_help"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { version = "1.0" }
serde_json.workspace = true
serde_plain.workspace = true
toml.workspace = true
ckb-app-config.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions devtools/doc/rpc-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ repository = "https://github.com/nervosnetwork/ckb"
[dependencies]
ckb-rpc ={ workspace = true }
schemars.workspace = true
serde_json = "~1.0"
serde_json.workspace = true
tera.workspace = true
syn = { version = "2.0.39", features = ["extra-traits", "full", "parsing", "visit"] }
syn = { workspace = true, features = ["extra-traits", "full", "parsing", "visit"] }
walkdir.workspace = true
proc-macro2.workspace = true
2 changes: 1 addition & 1 deletion miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ckb-pow.workspace = true
rand.workspace = true
rand_distr.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = "1.0"
serde_json.workspace = true
ckb-jsonrpc-types.workspace = true
hyper = { workspace = true, features = ["client", "http2", "http1", "server"] }
hyper-util = { workspace = true, features = ["server-auto", "server-graceful", "client-legacy"] }
Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ hickory-resolver = { workspace = true, optional = true }
snap.workspace = true
ckb-types.workspace = true
ipnetwork.workspace = true
serde_json = "1.0"
serde_json.workspace = true
bloom-filters.workspace = true
ckb-spawn.workspace = true
bitflags.workspace = true
Expand Down
1 change: 1 addition & 0 deletions network/src/protocols/identify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ impl Identify {

bitflags::bitflags! {
/// Node Function Identification
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
pub struct Flags: u64 {
/// Compatibility reserved
const COMPATIBILITY = 0b1;
Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ckb-network-alert.workspace = true
ckb-app-config.workspace = true
ckb-constant.workspace = true
jsonrpc-core.workspace = true
serde_json = "1.0"
serde_json.workspace = true
jsonrpc-utils = { workspace = true, features = ["server", "macros", "axum"] }
ckb-jsonrpc-types.workspace = true
ckb-verification.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions shared/src/block_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use bitflags::bitflags;
bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct BlockStatus: u32 {
const UNKNOWN = 0;

const HEADER_VALID = 1;
const BLOCK_RECEIVED = 1 | (Self::HEADER_VALID.bits << 1);
const BLOCK_STORED = 1 | (Self::BLOCK_RECEIVED.bits << 1);
const BLOCK_VALID = 1 | (Self::BLOCK_STORED.bits << 1);
const BLOCK_RECEIVED = 1 | (Self::HEADER_VALID.bits() << 1);
const BLOCK_STORED = 1 | (Self::BLOCK_RECEIVED.bits() << 1);
const BLOCK_VALID = 1 | (Self::BLOCK_STORED.bits() << 1);

const BLOCK_INVALID = 1 << 12;
}
Expand Down
2 changes: 1 addition & 1 deletion tx-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ckb-channel.workspace = true
ckb-db.workspace = true
ckb-script.workspace = true
sentry = { workspace = true, optional = true }
serde_json = "1.0"
serde_json.workspace = true
rand.workspace = true
hyper = { workspace = true, features = ["http1", "http2", "client"] }
hyper-util = { workspace = true, features = ["client-legacy", "http1", "http2"] }
Expand Down
2 changes: 1 addition & 1 deletion util/app-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/nervosnetwork/ckb"

[dependencies]
serde = { workspace = true, features = ["derive"] }
serde_json = "1.0"
serde_json.workspace = true
toml.workspace = true
path-clean.workspace = true
ckb-logger.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion util/fixed-hash/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ schemars.workspace = true


[dev-dependencies]
serde_json = "1.0"
serde_json.workspace = true
2 changes: 1 addition & 1 deletion util/fixed-hash/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ proc-macro = true
[dependencies]
ckb-fixed-hash-core.workspace = true
quote.workspace = true
syn = "1.0"
syn.workspace = true
proc-macro2.workspace = true

[package.metadata.cargo-shear]
Expand Down
2 changes: 1 addition & 1 deletion util/indexer-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ ckb-types.workspace = true
numext-fixed-uint.workspace = true
rhai = { workspace = true, features = ["no_function", "no_float", "no_module", "sync"] }
rocksdb = { workspace = true, features = ["snappy"], default-features = false }
serde_json = "1.0"
serde_json.workspace = true
thiserror.workspace = true
2 changes: 1 addition & 1 deletion util/instrument/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ckb-chain.workspace = true
ckb-chain-iter.workspace = true
ckb-shared.workspace = true
ckb-jsonrpc-types.workspace = true
serde_json = "1.0"
serde_json.workspace = true
indicatif = { workspace = true, optional = true }

[features]
Expand Down
2 changes: 1 addition & 1 deletion util/jsonrpc-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/nervosnetwork/ckb"
[dependencies]
ckb-types.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json = "1.0"
serde_json.workspace = true
faster-hex.workspace = true
schemars.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion util/migrate/migration-template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ proc-macro = true

[dependencies]
quote.workspace = true
syn = { version = "1.0", features = ["full", "printing"] }
syn = { workspace = true, features = ["full", "printing"] }
2 changes: 1 addition & 1 deletion util/network-alert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ ckb-crypto.workspace = true
ckb-async-runtime.workspace = true
ckb-systemtime = { workspace = true, features = ["enable_faketime"] }
faster-hex.workspace = true
serde_json = "1.0"
serde_json.workspace = true
2 changes: 1 addition & 1 deletion util/occupied-capacity/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ proc-macro = true

[dependencies]
quote.workspace = true
syn = "1.0"
syn.workspace = true
ckb-occupied-capacity-core.workspace = true
2 changes: 1 addition & 1 deletion util/rich-indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ tempfile.workspace = true
[dev-dependencies]
hex.workspace = true
rand.workspace = true
serde_json = "1.0"
serde_json.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "sync"] }
13 changes: 7 additions & 6 deletions verification/traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub trait Verifier {

bitflags! {
/// The bit flags for particular process block verify
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Switch: u32 {
/// None of verifier will be disabled
const NONE = 0b00000000;
Expand Down Expand Up @@ -43,14 +44,14 @@ bitflags! {
const DISABLE_EXTENSION = 0b10000000;

/// Disable all verifier
const DISABLE_ALL = Self::DISABLE_EPOCH.bits | Self::DISABLE_UNCLES.bits |
Self::DISABLE_TWO_PHASE_COMMIT.bits | Self::DISABLE_DAOHEADER.bits |
Self::DISABLE_REWARD.bits |
Self::DISABLE_NON_CONTEXTUAL.bits | Self::DISABLE_SCRIPT.bits |
Self::DISABLE_EXTENSION.bits;
const DISABLE_ALL = Self::DISABLE_EPOCH.bits() | Self::DISABLE_UNCLES.bits() |
Self::DISABLE_TWO_PHASE_COMMIT.bits() | Self::DISABLE_DAOHEADER.bits() |
Self::DISABLE_REWARD.bits() |
Self::DISABLE_NON_CONTEXTUAL.bits() | Self::DISABLE_SCRIPT.bits() |
Self::DISABLE_EXTENSION.bits();

/// Only script verification
const ONLY_SCRIPT = Self::DISABLE_ALL.bits & (!Self::DISABLE_SCRIPT.bits);
const ONLY_SCRIPT = Self::DISABLE_ALL.bits() & (!Self::DISABLE_SCRIPT.bits());
}
}

Expand Down
Loading