mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
add match_same_arms clippy lint (#8549)
This commit is contained in:
@ -156,6 +156,7 @@ use_self = "warn"
|
|||||||
missing_const_for_fn = "warn"
|
missing_const_for_fn = "warn"
|
||||||
empty_line_after_doc_comments = "warn"
|
empty_line_after_doc_comments = "warn"
|
||||||
iter_on_single_items = "warn"
|
iter_on_single_items = "warn"
|
||||||
|
match_same_arms = "warn"
|
||||||
doc_markdown = "warn"
|
doc_markdown = "warn"
|
||||||
unnecessary_struct_initialization = "warn"
|
unnecessary_struct_initialization = "warn"
|
||||||
string_lit_as_bytes = "warn"
|
string_lit_as_bytes = "warn"
|
||||||
|
|||||||
@ -340,8 +340,7 @@ impl<T: Table> ExtraTableElement<T> {
|
|||||||
/// Return the key for the extra element
|
/// Return the key for the extra element
|
||||||
const fn key(&self) -> &T::Key {
|
const fn key(&self) -> &T::Key {
|
||||||
match self {
|
match self {
|
||||||
Self::First { key, .. } => key,
|
Self::First { key, .. } | Self::Second { key, .. } => key,
|
||||||
Self::Second { key, .. } => key,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -280,6 +280,7 @@ impl InsertBlockErrorKind {
|
|||||||
/// Returns true if the error is caused by an invalid block
|
/// Returns true if the error is caused by an invalid block
|
||||||
///
|
///
|
||||||
/// This is intended to be used to determine if the block should be marked as invalid.
|
/// This is intended to be used to determine if the block should be marked as invalid.
|
||||||
|
#[allow(clippy::match_same_arms)]
|
||||||
pub const fn is_invalid_block(&self) -> bool {
|
pub const fn is_invalid_block(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Self::SenderRecovery | Self::Consensus(_) => true,
|
Self::SenderRecovery | Self::Consensus(_) => true,
|
||||||
@ -321,9 +322,9 @@ impl InsertBlockErrorKind {
|
|||||||
CanonicalError::BlockchainTree(_) |
|
CanonicalError::BlockchainTree(_) |
|
||||||
CanonicalError::CanonicalCommit(_) |
|
CanonicalError::CanonicalCommit(_) |
|
||||||
CanonicalError::CanonicalRevert(_) |
|
CanonicalError::CanonicalRevert(_) |
|
||||||
CanonicalError::OptimisticTargetRevert(_) => false,
|
CanonicalError::OptimisticTargetRevert(_) |
|
||||||
CanonicalError::Validation(_) => true,
|
|
||||||
CanonicalError::Provider(_) => false,
|
CanonicalError::Provider(_) => false,
|
||||||
|
CanonicalError::Validation(_) => true,
|
||||||
},
|
},
|
||||||
Self::BlockchainTree(_) => false,
|
Self::BlockchainTree(_) => false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,8 +133,7 @@ impl Hardfork {
|
|||||||
Self::Tangerine => Some(2463000),
|
Self::Tangerine => Some(2463000),
|
||||||
Self::SpuriousDragon => Some(2675000),
|
Self::SpuriousDragon => Some(2675000),
|
||||||
Self::Byzantium => Some(4370000),
|
Self::Byzantium => Some(4370000),
|
||||||
Self::Constantinople => Some(7280000),
|
Self::Constantinople | Self::Petersburg => Some(7280000),
|
||||||
Self::Petersburg => Some(7280000),
|
|
||||||
Self::Istanbul => Some(9069000),
|
Self::Istanbul => Some(9069000),
|
||||||
Self::MuirGlacier => Some(9200000),
|
Self::MuirGlacier => Some(9200000),
|
||||||
Self::Berlin => Some(12244000),
|
Self::Berlin => Some(12244000),
|
||||||
@ -156,19 +155,19 @@ impl Hardfork {
|
|||||||
Self::Paris => Some(1735371),
|
Self::Paris => Some(1735371),
|
||||||
Self::Shanghai => Some(2990908),
|
Self::Shanghai => Some(2990908),
|
||||||
Self::Cancun => Some(5187023),
|
Self::Cancun => Some(5187023),
|
||||||
Self::Frontier => Some(0),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(0),
|
Self::Homestead |
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier => Some(0),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
@ -178,20 +177,20 @@ impl Hardfork {
|
|||||||
pub const fn arbitrum_sepolia_activation_block(&self) -> Option<u64> {
|
pub const fn arbitrum_sepolia_activation_block(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(0),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(0),
|
Self::Homestead |
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(0),
|
Self::Paris => Some(0),
|
||||||
Self::Shanghai => Some(10653737),
|
Self::Shanghai => Some(10653737),
|
||||||
// Hardfork::ArbOS11 => Some(10653737),
|
// Hardfork::ArbOS11 => Some(10653737),
|
||||||
@ -205,20 +204,20 @@ impl Hardfork {
|
|||||||
pub const fn arbitrum_activation_block(&self) -> Option<u64> {
|
pub const fn arbitrum_activation_block(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(0),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(0),
|
Self::Homestead |
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(0),
|
Self::Paris => Some(0),
|
||||||
Self::Shanghai => Some(184097479),
|
Self::Shanghai => Some(184097479),
|
||||||
// Hardfork::ArbOS11 => Some(184097479),
|
// Hardfork::ArbOS11 => Some(184097479),
|
||||||
@ -233,27 +232,25 @@ impl Hardfork {
|
|||||||
pub const fn base_sepolia_activation_block(&self) -> Option<u64> {
|
pub const fn base_sepolia_activation_block(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(0),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(0),
|
Self::Homestead |
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(0),
|
Self::Paris |
|
||||||
Self::Bedrock => Some(0),
|
Self::Bedrock |
|
||||||
Self::Regolith => Some(0),
|
Self::Regolith => Some(0),
|
||||||
Self::Shanghai => Some(2106456),
|
Self::Shanghai | Self::Canyon => Some(2106456),
|
||||||
Self::Canyon => Some(2106456),
|
Self::Cancun | Self::Ecotone => Some(6383256),
|
||||||
Self::Cancun => Some(6383256),
|
|
||||||
Self::Ecotone => Some(6383256),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,27 +260,25 @@ impl Hardfork {
|
|||||||
pub const fn base_mainnet_activation_block(&self) -> Option<u64> {
|
pub const fn base_mainnet_activation_block(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(0),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(0),
|
Self::Homestead |
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(0),
|
Self::Paris |
|
||||||
Self::Bedrock => Some(0),
|
Self::Bedrock |
|
||||||
Self::Regolith => Some(0),
|
Self::Regolith => Some(0),
|
||||||
Self::Shanghai => Some(9101527),
|
Self::Shanghai | Self::Canyon => Some(9101527),
|
||||||
Self::Canyon => Some(9101527),
|
Self::Cancun | Self::Ecotone => Some(11188936),
|
||||||
Self::Cancun => Some(11188936),
|
|
||||||
Self::Ecotone => Some(11188936),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,18 +287,18 @@ impl Hardfork {
|
|||||||
const fn holesky_activation_block(&self) -> Option<u64> {
|
const fn holesky_activation_block(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Dao => Some(0),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(0),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(0),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(0),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(0),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(0),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(0),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(0),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(0),
|
Self::Berlin |
|
||||||
Self::London => Some(0),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(0),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(0),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(0),
|
Self::Paris => Some(0),
|
||||||
Self::Shanghai => Some(6698),
|
Self::Shanghai => Some(6698),
|
||||||
Self::Cancun => Some(894733),
|
Self::Cancun => Some(894733),
|
||||||
@ -345,8 +340,7 @@ impl Hardfork {
|
|||||||
Self::Tangerine => Some(1476753571),
|
Self::Tangerine => Some(1476753571),
|
||||||
Self::SpuriousDragon => Some(1479788144),
|
Self::SpuriousDragon => Some(1479788144),
|
||||||
Self::Byzantium => Some(1508131331),
|
Self::Byzantium => Some(1508131331),
|
||||||
Self::Constantinople => Some(1551340324),
|
Self::Constantinople | Self::Petersburg => Some(1551340324),
|
||||||
Self::Petersburg => Some(1551340324),
|
|
||||||
Self::Istanbul => Some(1575807909),
|
Self::Istanbul => Some(1575807909),
|
||||||
Self::MuirGlacier => Some(1577953849),
|
Self::MuirGlacier => Some(1577953849),
|
||||||
Self::Berlin => Some(1618481223),
|
Self::Berlin => Some(1618481223),
|
||||||
@ -366,20 +360,20 @@ impl Hardfork {
|
|||||||
pub const fn sepolia_activation_timestamp(&self) -> Option<u64> {
|
pub const fn sepolia_activation_timestamp(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(1633267481),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1633267481),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1633267481),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1633267481),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1633267481),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1633267481),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1633267481),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1633267481),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1633267481),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1633267481),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1633267481),
|
Self::Berlin |
|
||||||
Self::London => Some(1633267481),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1633267481),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1633267481),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1633267481),
|
Self::Paris => Some(1633267481),
|
||||||
Self::Shanghai => Some(1677557088),
|
Self::Shanghai => Some(1677557088),
|
||||||
Self::Cancun => Some(1706655072),
|
Self::Cancun => Some(1706655072),
|
||||||
@ -393,20 +387,20 @@ impl Hardfork {
|
|||||||
match self {
|
match self {
|
||||||
Self::Shanghai => Some(1696000704),
|
Self::Shanghai => Some(1696000704),
|
||||||
Self::Cancun => Some(1707305664),
|
Self::Cancun => Some(1707305664),
|
||||||
Self::Frontier => Some(1695902100),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1695902100),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1695902100),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1695902100),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1695902100),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1695902100),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1695902100),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1695902100),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1695902100),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1695902100),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1695902100),
|
Self::Berlin |
|
||||||
Self::London => Some(1695902100),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1695902100),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1695902100),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1695902100),
|
Self::Paris => Some(1695902100),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
@ -417,20 +411,20 @@ impl Hardfork {
|
|||||||
pub const fn arbitrum_sepolia_activation_timestamp(&self) -> Option<u64> {
|
pub const fn arbitrum_sepolia_activation_timestamp(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(1692726996),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1692726996),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1692726996),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1692726996),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1692726996),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1692726996),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1692726996),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1692726996),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1692726996),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1692726996),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1692726996),
|
Self::Berlin |
|
||||||
Self::London => Some(1692726996),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1692726996),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1692726996),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1692726996),
|
Self::Paris => Some(1692726996),
|
||||||
Self::Shanghai => Some(1706634000),
|
Self::Shanghai => Some(1706634000),
|
||||||
// Hardfork::ArbOS11 => Some(1706634000),
|
// Hardfork::ArbOS11 => Some(1706634000),
|
||||||
@ -444,20 +438,20 @@ impl Hardfork {
|
|||||||
pub const fn arbitrum_activation_timestamp(&self) -> Option<u64> {
|
pub const fn arbitrum_activation_timestamp(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(1622240000),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1622240000),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1622240000),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1622240000),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1622240000),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1622240000),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1622240000),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1622240000),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1622240000),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1622240000),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1622240000),
|
Self::Berlin |
|
||||||
Self::London => Some(1622240000),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1622240000),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1622240000),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1622240000),
|
Self::Paris => Some(1622240000),
|
||||||
Self::Shanghai => Some(1708804873),
|
Self::Shanghai => Some(1708804873),
|
||||||
// Hardfork::ArbOS11 => Some(1708804873),
|
// Hardfork::ArbOS11 => Some(1708804873),
|
||||||
@ -472,27 +466,25 @@ impl Hardfork {
|
|||||||
pub const fn base_sepolia_activation_timestamp(&self) -> Option<u64> {
|
pub const fn base_sepolia_activation_timestamp(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(1695768288),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1695768288),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1695768288),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1695768288),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1695768288),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1695768288),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1695768288),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1695768288),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1695768288),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1695768288),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1695768288),
|
Self::Berlin |
|
||||||
Self::London => Some(1695768288),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1695768288),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1695768288),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1695768288),
|
Self::Paris |
|
||||||
Self::Bedrock => Some(1695768288),
|
Self::Bedrock |
|
||||||
Self::Regolith => Some(1695768288),
|
Self::Regolith => Some(1695768288),
|
||||||
Self::Shanghai => Some(1699981200),
|
Self::Shanghai | Self::Canyon => Some(1699981200),
|
||||||
Self::Canyon => Some(1699981200),
|
Self::Cancun | Self::Ecotone => Some(1708534800),
|
||||||
Self::Cancun => Some(1708534800),
|
|
||||||
Self::Ecotone => Some(1708534800),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -502,27 +494,25 @@ impl Hardfork {
|
|||||||
pub const fn base_mainnet_activation_timestamp(&self) -> Option<u64> {
|
pub const fn base_mainnet_activation_timestamp(&self) -> Option<u64> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
match self {
|
match self {
|
||||||
Self::Frontier => Some(1686789347),
|
Self::Frontier |
|
||||||
Self::Homestead => Some(1686789347),
|
Self::Homestead |
|
||||||
Self::Dao => Some(1686789347),
|
Self::Dao |
|
||||||
Self::Tangerine => Some(1686789347),
|
Self::Tangerine |
|
||||||
Self::SpuriousDragon => Some(1686789347),
|
Self::SpuriousDragon |
|
||||||
Self::Byzantium => Some(1686789347),
|
Self::Byzantium |
|
||||||
Self::Constantinople => Some(1686789347),
|
Self::Constantinople |
|
||||||
Self::Petersburg => Some(1686789347),
|
Self::Petersburg |
|
||||||
Self::Istanbul => Some(1686789347),
|
Self::Istanbul |
|
||||||
Self::MuirGlacier => Some(1686789347),
|
Self::MuirGlacier |
|
||||||
Self::Berlin => Some(1686789347),
|
Self::Berlin |
|
||||||
Self::London => Some(1686789347),
|
Self::London |
|
||||||
Self::ArrowGlacier => Some(1686789347),
|
Self::ArrowGlacier |
|
||||||
Self::GrayGlacier => Some(1686789347),
|
Self::GrayGlacier |
|
||||||
Self::Paris => Some(1686789347),
|
Self::Paris |
|
||||||
Self::Bedrock => Some(1686789347),
|
Self::Bedrock |
|
||||||
Self::Regolith => Some(1686789347),
|
Self::Regolith => Some(1686789347),
|
||||||
Self::Shanghai => Some(1704992401),
|
Self::Shanghai | Self::Canyon => Some(1704992401),
|
||||||
Self::Canyon => Some(1704992401),
|
Self::Cancun | Self::Ecotone => Some(1710374401),
|
||||||
Self::Cancun => Some(1710374401),
|
|
||||||
Self::Ecotone => Some(1710374401),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ pub enum StateRootError {
|
|||||||
impl From<StateRootError> for DatabaseError {
|
impl From<StateRootError> for DatabaseError {
|
||||||
fn from(err: StateRootError) -> Self {
|
fn from(err: StateRootError) -> Self {
|
||||||
match err {
|
match err {
|
||||||
StateRootError::DB(err) => err,
|
StateRootError::DB(err) |
|
||||||
StateRootError::StorageRootError(StorageRootError::DB(err)) => err,
|
StateRootError::StorageRootError(StorageRootError::DB(err)) => err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,7 +167,7 @@ impl Stream for MockDiscovery {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::Pong(_) => {}
|
Message::Pong(_) | Message::Neighbours(_) => {}
|
||||||
Message::FindNode(msg) => {
|
Message::FindNode(msg) => {
|
||||||
if let Some(nodes) = this.pending_neighbours.remove(&msg.id) {
|
if let Some(nodes) = this.pending_neighbours.remove(&msg.id) {
|
||||||
let msg = Message::Neighbours(Neighbours {
|
let msg = Message::Neighbours(Neighbours {
|
||||||
@ -181,7 +181,6 @@ impl Stream for MockDiscovery {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::Neighbours(_) => {}
|
|
||||||
Message::EnrRequest(_) | Message::EnrResponse(_) => todo!(),
|
Message::EnrRequest(_) | Message::EnrResponse(_) => todo!(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -222,6 +222,7 @@ impl Discv5 {
|
|||||||
|
|
||||||
/// Process an event from the underlying [`discv5::Discv5`] node.
|
/// Process an event from the underlying [`discv5::Discv5`] node.
|
||||||
pub fn on_discv5_update(&self, update: discv5::Event) -> Option<DiscoveredPeer> {
|
pub fn on_discv5_update(&self, update: discv5::Event) -> Option<DiscoveredPeer> {
|
||||||
|
#[allow(clippy::match_same_arms)]
|
||||||
match update {
|
match update {
|
||||||
discv5::Event::SocketUpdated(_) | discv5::Event::TalkRequest(_) |
|
discv5::Event::SocketUpdated(_) | discv5::Event::TalkRequest(_) |
|
||||||
// `Discovered` not unique discovered peers
|
// `Discovered` not unique discovered peers
|
||||||
|
|||||||
@ -378,7 +378,7 @@ where
|
|||||||
let target = headers.remove(0).seal_slow();
|
let target = headers.remove(0).seal_slow();
|
||||||
|
|
||||||
match sync_target {
|
match sync_target {
|
||||||
SyncTargetBlock::Hash(hash) => {
|
SyncTargetBlock::Hash(hash) | SyncTargetBlock::HashAndNumber { hash, .. } => {
|
||||||
if target.hash() != hash {
|
if target.hash() != hash {
|
||||||
return Err(HeadersResponseError {
|
return Err(HeadersResponseError {
|
||||||
request,
|
request,
|
||||||
@ -403,18 +403,6 @@ where
|
|||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SyncTargetBlock::HashAndNumber { hash, .. } => {
|
|
||||||
if target.hash() != hash {
|
|
||||||
return Err(HeadersResponseError {
|
|
||||||
request,
|
|
||||||
peer_id: Some(peer_id),
|
|
||||||
error: DownloadError::InvalidTip(
|
|
||||||
GotExpected { got: target.hash(), expected: hash }.into(),
|
|
||||||
),
|
|
||||||
}
|
|
||||||
.into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trace!(target: "downloaders::headers", head=?self.local_block_number(), hash=?target.hash(), number=%target.number, "Received sync target");
|
trace!(target: "downloaders::headers", head=?self.local_block_number(), hash=?target.hash(), number=%target.number, "Received sync target");
|
||||||
@ -1014,17 +1002,19 @@ impl SyncTargetBlock {
|
|||||||
const fn with_hash(self, hash: B256) -> Self {
|
const fn with_hash(self, hash: B256) -> Self {
|
||||||
match self {
|
match self {
|
||||||
Self::Hash(_) => Self::Hash(hash),
|
Self::Hash(_) => Self::Hash(hash),
|
||||||
Self::Number(number) => Self::HashAndNumber { hash, number },
|
Self::Number(number) | Self::HashAndNumber { number, .. } => {
|
||||||
Self::HashAndNumber { number, .. } => Self::HashAndNumber { hash, number },
|
Self::HashAndNumber { hash, number }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set a number on the instance.
|
/// Set a number on the instance.
|
||||||
const fn with_number(self, number: u64) -> Self {
|
const fn with_number(self, number: u64) -> Self {
|
||||||
match self {
|
match self {
|
||||||
Self::Hash(hash) => Self::HashAndNumber { hash, number },
|
Self::Hash(hash) | Self::HashAndNumber { hash, .. } => {
|
||||||
|
Self::HashAndNumber { hash, number }
|
||||||
|
}
|
||||||
Self::Number(_) => Self::Number(number),
|
Self::Number(_) => Self::Number(number),
|
||||||
Self::HashAndNumber { hash, .. } => Self::HashAndNumber { hash, number },
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,9 +1044,8 @@ impl SyncTargetBlock {
|
|||||||
/// Return the hash of the target block, if it is set.
|
/// Return the hash of the target block, if it is set.
|
||||||
const fn hash(&self) -> Option<B256> {
|
const fn hash(&self) -> Option<B256> {
|
||||||
match self {
|
match self {
|
||||||
Self::Hash(hash) => Some(*hash),
|
Self::Hash(hash) | Self::HashAndNumber { hash, .. } => Some(*hash),
|
||||||
Self::Number(_) => None,
|
Self::Number(_) => None,
|
||||||
Self::HashAndNumber { hash, .. } => Some(*hash),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1064,8 +1053,7 @@ impl SyncTargetBlock {
|
|||||||
const fn number(&self) -> Option<u64> {
|
const fn number(&self) -> Option<u64> {
|
||||||
match self {
|
match self {
|
||||||
Self::Hash(_) => None,
|
Self::Hash(_) => None,
|
||||||
Self::Number(number) => Some(*number),
|
Self::Number(number) | Self::HashAndNumber { number, .. } => Some(*number),
|
||||||
Self::HashAndNumber { number, .. } => Some(*number),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -389,8 +389,7 @@ mod tests {
|
|||||||
let mut forkhash = ForkHash::from(genesis_hash);
|
let mut forkhash = ForkHash::from(genesis_hash);
|
||||||
for (_, condition) in hardforks {
|
for (_, condition) in hardforks {
|
||||||
forkhash += match condition {
|
forkhash += match condition {
|
||||||
ForkCondition::Block(n) => n,
|
ForkCondition::Block(n) | ForkCondition::Timestamp(n) => n,
|
||||||
ForkCondition::Timestamp(n) => n,
|
|
||||||
_ => unreachable!("only block and timestamp forks are used in this test"),
|
_ => unreachable!("only block and timestamp forks are used in this test"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -331,8 +331,7 @@ impl SharedCapability {
|
|||||||
/// message id space.
|
/// message id space.
|
||||||
pub const fn message_id_offset(&self) -> u8 {
|
pub const fn message_id_offset(&self) -> u8 {
|
||||||
match self {
|
match self {
|
||||||
Self::Eth { offset, .. } => *offset,
|
Self::Eth { offset, .. } | Self::UnknownCapability { offset, .. } => *offset,
|
||||||
Self::UnknownCapability { offset, .. } => *offset,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,7 +86,7 @@ impl P2PStreamError {
|
|||||||
/// Returns the [`DisconnectReason`] if it is the `Disconnected` variant.
|
/// Returns the [`DisconnectReason`] if it is the `Disconnected` variant.
|
||||||
pub const fn as_disconnected(&self) -> Option<DisconnectReason> {
|
pub const fn as_disconnected(&self) -> Option<DisconnectReason> {
|
||||||
let reason = match self {
|
let reason = match self {
|
||||||
Self::HandshakeError(P2PHandshakeError::Disconnected(reason)) => reason,
|
Self::HandshakeError(P2PHandshakeError::Disconnected(reason)) |
|
||||||
Self::Disconnected(reason) => reason,
|
Self::Disconnected(reason) => reason,
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -703,8 +703,7 @@ impl Encodable for P2PMessage {
|
|||||||
Self::Hello(msg) => msg.length(),
|
Self::Hello(msg) => msg.length(),
|
||||||
Self::Disconnect(msg) => msg.length(),
|
Self::Disconnect(msg) => msg.length(),
|
||||||
// id + snappy encoded payload
|
// id + snappy encoded payload
|
||||||
Self::Ping => 3, // len([0x01, 0x00, 0xc0]) = 3
|
Self::Ping | Self::Pong => 3, // len([0x01, 0x00, 0xc0]) = 3
|
||||||
Self::Pong => 3, // len([0x01, 0x00, 0xc0]) = 3
|
|
||||||
};
|
};
|
||||||
payload_len + 1 // (1 for length of p2p message id)
|
payload_len + 1 // (1 for length of p2p message id)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,8 +125,7 @@ pub mod proto {
|
|||||||
let mut buf = BytesMut::new();
|
let mut buf = BytesMut::new();
|
||||||
buf.put_u8(self.message_type as u8);
|
buf.put_u8(self.message_type as u8);
|
||||||
match &self.message {
|
match &self.message {
|
||||||
TestProtoMessageKind::Ping => {}
|
TestProtoMessageKind::Ping | TestProtoMessageKind::Pong => {}
|
||||||
TestProtoMessageKind::Pong => {}
|
|
||||||
TestProtoMessageKind::Message(msg) => {
|
TestProtoMessageKind::Message(msg) => {
|
||||||
buf.put(msg.as_bytes());
|
buf.put(msg.as_bytes());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,7 +215,7 @@ impl Discovery {
|
|||||||
|
|
||||||
fn on_discv4_update(&mut self, update: DiscoveryUpdate) {
|
fn on_discv4_update(&mut self, update: DiscoveryUpdate) {
|
||||||
match update {
|
match update {
|
||||||
DiscoveryUpdate::Added(record) => {
|
DiscoveryUpdate::Added(record) | DiscoveryUpdate::DiscoveredAtCapacity(record) => {
|
||||||
self.on_node_record_update(record, None);
|
self.on_node_record_update(record, None);
|
||||||
}
|
}
|
||||||
DiscoveryUpdate::EnrForkId(node, fork_id) => {
|
DiscoveryUpdate::EnrForkId(node, fork_id) => {
|
||||||
@ -229,9 +229,6 @@ impl Discovery {
|
|||||||
self.on_discv4_update(update);
|
self.on_discv4_update(update);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DiscoveryUpdate::DiscoveredAtCapacity(record) => {
|
|
||||||
self.on_node_record_update(record, None);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -431,8 +431,9 @@ impl DownloadRequest {
|
|||||||
/// Returns the requested priority of this request
|
/// Returns the requested priority of this request
|
||||||
const fn get_priority(&self) -> &Priority {
|
const fn get_priority(&self) -> &Priority {
|
||||||
match self {
|
match self {
|
||||||
Self::GetBlockHeaders { priority, .. } => priority,
|
Self::GetBlockHeaders { priority, .. } | Self::GetBlockBodies { priority, .. } => {
|
||||||
Self::GetBlockBodies { priority, .. } => priority,
|
priority
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -316,10 +316,7 @@ where
|
|||||||
self.state_fetcher.on_pending_disconnect(&peer_id);
|
self.state_fetcher.on_pending_disconnect(&peer_id);
|
||||||
self.queued_messages.push_back(StateAction::Disconnect { peer_id, reason });
|
self.queued_messages.push_back(StateAction::Disconnect { peer_id, reason });
|
||||||
}
|
}
|
||||||
PeerAction::DisconnectBannedIncoming { peer_id } => {
|
PeerAction::DisconnectBannedIncoming { peer_id } |
|
||||||
self.state_fetcher.on_pending_disconnect(&peer_id);
|
|
||||||
self.queued_messages.push_back(StateAction::Disconnect { peer_id, reason: None });
|
|
||||||
}
|
|
||||||
PeerAction::DisconnectUntrustedIncoming { peer_id } => {
|
PeerAction::DisconnectUntrustedIncoming { peer_id } => {
|
||||||
self.state_fetcher.on_pending_disconnect(&peer_id);
|
self.state_fetcher.on_pending_disconnect(&peer_id);
|
||||||
self.queued_messages.push_back(StateAction::Disconnect { peer_id, reason: None });
|
self.queued_messages.push_back(StateAction::Disconnect { peer_id, reason: None });
|
||||||
@ -334,8 +331,7 @@ where
|
|||||||
PeerAction::PeerRemoved(peer_id) => {
|
PeerAction::PeerRemoved(peer_id) => {
|
||||||
self.queued_messages.push_back(StateAction::PeerRemoved(peer_id))
|
self.queued_messages.push_back(StateAction::PeerRemoved(peer_id))
|
||||||
}
|
}
|
||||||
PeerAction::BanPeer { .. } => {}
|
PeerAction::BanPeer { .. } | PeerAction::UnBanPeer { .. } => {}
|
||||||
PeerAction::UnBanPeer { .. } => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -244,7 +244,7 @@ impl ValidateTx68 for EthMessageFilter {
|
|||||||
fn max_encoded_tx_length(&self, ty: TxType) -> Option<usize> {
|
fn max_encoded_tx_length(&self, ty: TxType) -> Option<usize> {
|
||||||
// the biggest transaction so far is a blob transaction, which is currently max 2^17,
|
// the biggest transaction so far is a blob transaction, which is currently max 2^17,
|
||||||
// encoded length, nonetheless, the blob tx may become bigger in the future.
|
// encoded length, nonetheless, the blob tx may become bigger in the future.
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns, clippy::match_same_arms)]
|
||||||
match ty {
|
match ty {
|
||||||
TxType::Legacy | TxType::Eip2930 | TxType::Eip1559 => Some(MAX_MESSAGE_SIZE),
|
TxType::Legacy | TxType::Eip2930 | TxType::Eip1559 => Some(MAX_MESSAGE_SIZE),
|
||||||
TxType::Eip4844 => None,
|
TxType::Eip4844 => None,
|
||||||
|
|||||||
@ -54,7 +54,7 @@ async fn test_establish_connections() {
|
|||||||
let mut established = listener0.take(4);
|
let mut established = listener0.take(4);
|
||||||
while let Some(ev) = established.next().await {
|
while let Some(ev) = established.next().await {
|
||||||
match ev {
|
match ev {
|
||||||
NetworkEvent::SessionClosed { .. } => {
|
NetworkEvent::SessionClosed { .. } | NetworkEvent::PeerRemoved(_) => {
|
||||||
panic!("unexpected event")
|
panic!("unexpected event")
|
||||||
}
|
}
|
||||||
NetworkEvent::SessionEstablished { peer_id, .. } => {
|
NetworkEvent::SessionEstablished { peer_id, .. } => {
|
||||||
@ -63,9 +63,6 @@ async fn test_establish_connections() {
|
|||||||
NetworkEvent::PeerAdded(peer_id) => {
|
NetworkEvent::PeerAdded(peer_id) => {
|
||||||
assert!(expected_peers.remove(&peer_id))
|
assert!(expected_peers.remove(&peer_id))
|
||||||
}
|
}
|
||||||
NetworkEvent::PeerRemoved(_) => {
|
|
||||||
panic!("unexpected event")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert!(expected_connections.is_empty());
|
assert!(expected_connections.is_empty());
|
||||||
|
|||||||
@ -99,11 +99,8 @@ mod proto {
|
|||||||
let mut buf = BytesMut::new();
|
let mut buf = BytesMut::new();
|
||||||
buf.put_u8(self.message_type as u8);
|
buf.put_u8(self.message_type as u8);
|
||||||
match &self.message {
|
match &self.message {
|
||||||
PingPongProtoMessageKind::Ping => {}
|
PingPongProtoMessageKind::Ping | PingPongProtoMessageKind::Pong => {}
|
||||||
PingPongProtoMessageKind::Pong => {}
|
PingPongProtoMessageKind::PingMessage(msg) |
|
||||||
PingPongProtoMessageKind::PingMessage(msg) => {
|
|
||||||
buf.put(msg.as_bytes());
|
|
||||||
}
|
|
||||||
PingPongProtoMessageKind::PongMessage(msg) => {
|
PingPongProtoMessageKind::PongMessage(msg) => {
|
||||||
buf.put(msg.as_bytes());
|
buf.put(msg.as_bytes());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,11 +61,11 @@ impl EthResponseValidator for RequestResult<Vec<Header>> {
|
|||||||
fn reputation_change_err(&self) -> Option<ReputationChangeKind> {
|
fn reputation_change_err(&self) -> Option<ReputationChangeKind> {
|
||||||
if let Err(err) = self {
|
if let Err(err) = self {
|
||||||
match err {
|
match err {
|
||||||
RequestError::ChannelClosed => None,
|
RequestError::ChannelClosed |
|
||||||
RequestError::ConnectionDropped => None,
|
RequestError::ConnectionDropped |
|
||||||
RequestError::UnsupportedCapability => None,
|
RequestError::UnsupportedCapability |
|
||||||
RequestError::Timeout => Some(ReputationChangeKind::Timeout),
|
|
||||||
RequestError::BadResponse => None,
|
RequestError::BadResponse => None,
|
||||||
|
RequestError::Timeout => Some(ReputationChangeKind::Timeout),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@ -848,9 +848,9 @@ impl ChainSpec {
|
|||||||
// We filter out TTD-based forks w/o a pre-known block since those do not show up in the
|
// We filter out TTD-based forks w/o a pre-known block since those do not show up in the
|
||||||
// fork filter.
|
// fork filter.
|
||||||
Some(match condition {
|
Some(match condition {
|
||||||
ForkCondition::Block(block) => ForkFilterKey::Block(block),
|
ForkCondition::Block(block) |
|
||||||
ForkCondition::Timestamp(time) => ForkFilterKey::Time(time),
|
|
||||||
ForkCondition::TTD { fork_block: Some(block), .. } => ForkFilterKey::Block(block),
|
ForkCondition::TTD { fork_block: Some(block), .. } => ForkFilterKey::Block(block),
|
||||||
|
ForkCondition::Timestamp(time) => ForkFilterKey::Time(time),
|
||||||
_ => return None,
|
_ => return None,
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@ -213,7 +213,7 @@ impl BlobTransaction {
|
|||||||
// decode the _first_ list header for the rest of the transaction
|
// decode the _first_ list header for the rest of the transaction
|
||||||
let outer_header = Header::decode(data)?;
|
let outer_header = Header::decode(data)?;
|
||||||
if !outer_header.list {
|
if !outer_header.list {
|
||||||
return Err(RlpError::Custom("PooledTransactions blob tx must be encoded as a list"))
|
return Err(RlpError::Custom("PooledTransactions blob tx must be encoded as a list"));
|
||||||
}
|
}
|
||||||
|
|
||||||
let outer_remaining_len = data.len();
|
let outer_remaining_len = data.len();
|
||||||
@ -225,7 +225,7 @@ impl BlobTransaction {
|
|||||||
if !inner_header.list {
|
if !inner_header.list {
|
||||||
return Err(RlpError::Custom(
|
return Err(RlpError::Custom(
|
||||||
"PooledTransactions inner blob tx must be encoded as a list",
|
"PooledTransactions inner blob tx must be encoded as a list",
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let inner_remaining_len = data.len();
|
let inner_remaining_len = data.len();
|
||||||
@ -239,7 +239,7 @@ impl BlobTransaction {
|
|||||||
// the inner header only decodes the transaction and signature, so we check the length here
|
// the inner header only decodes the transaction and signature, so we check the length here
|
||||||
let inner_consumed = inner_remaining_len - data.len();
|
let inner_consumed = inner_remaining_len - data.len();
|
||||||
if inner_consumed != inner_header.payload_length {
|
if inner_consumed != inner_header.payload_length {
|
||||||
return Err(RlpError::UnexpectedLength)
|
return Err(RlpError::UnexpectedLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
// All that's left are the blobs, commitments, and proofs
|
// All that's left are the blobs, commitments, and proofs
|
||||||
|
|||||||
@ -859,8 +859,8 @@ mod tests {
|
|||||||
|
|
||||||
loop {
|
loop {
|
||||||
match select(closed, stream.next()).await {
|
match select(closed, stream.next()).await {
|
||||||
// subscription closed.
|
// subscription closed or stream is closed.
|
||||||
Either::Left((_, _)) => break Ok(()),
|
Either::Left((_, _)) | Either::Right((None, _)) => break Ok(()),
|
||||||
|
|
||||||
// received new item from the stream.
|
// received new item from the stream.
|
||||||
Either::Right((Some(Ok(item)), c)) => {
|
Either::Right((Some(Ok(item)), c)) => {
|
||||||
@ -878,9 +878,6 @@ mod tests {
|
|||||||
|
|
||||||
// Send back back the error.
|
// Send back back the error.
|
||||||
Either::Right((Some(Err(e)), _)) => break Err(e.into()),
|
Either::Right((Some(Err(e)), _)) => break Err(e.into()),
|
||||||
|
|
||||||
// Stream is closed.
|
|
||||||
Either::Right((None, _)) => break Ok(()),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,8 +49,7 @@ fn fill(
|
|||||||
|
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
let (gas_price, max_fee_per_gas) = match signed_tx.tx_type() {
|
let (gas_price, max_fee_per_gas) = match signed_tx.tx_type() {
|
||||||
TxType::Legacy => (Some(signed_tx.max_fee_per_gas()), None),
|
TxType::Legacy | TxType::Eip2930 => (Some(signed_tx.max_fee_per_gas()), None),
|
||||||
TxType::Eip2930 => (Some(signed_tx.max_fee_per_gas()), None),
|
|
||||||
TxType::Eip1559 | TxType::Eip4844 => {
|
TxType::Eip1559 | TxType::Eip4844 => {
|
||||||
// the gas price field for EIP1559 is set to `min(tip, gasFeeCap - baseFee) +
|
// the gas price field for EIP1559 is set to `min(tip, gasFeeCap - baseFee) +
|
||||||
// baseFee`
|
// baseFee`
|
||||||
|
|||||||
@ -150,7 +150,8 @@ impl From<EthApiError> for ErrorObject<'static> {
|
|||||||
EthApiError::InvalidBlockData(_) |
|
EthApiError::InvalidBlockData(_) |
|
||||||
EthApiError::Internal(_) |
|
EthApiError::Internal(_) |
|
||||||
EthApiError::TransactionNotFound |
|
EthApiError::TransactionNotFound |
|
||||||
EthApiError::EvmCustom(_) => internal_rpc_err(error.to_string()),
|
EthApiError::EvmCustom(_) |
|
||||||
|
EthApiError::InvalidRewardPercentiles => internal_rpc_err(error.to_string()),
|
||||||
EthApiError::UnknownBlockNumber | EthApiError::UnknownBlockOrTxIndex => {
|
EthApiError::UnknownBlockNumber | EthApiError::UnknownBlockOrTxIndex => {
|
||||||
rpc_error_with_code(EthRpcErrorCode::ResourceNotFound.code(), error.to_string())
|
rpc_error_with_code(EthRpcErrorCode::ResourceNotFound.code(), error.to_string())
|
||||||
}
|
}
|
||||||
@ -160,12 +161,12 @@ impl From<EthApiError> for ErrorObject<'static> {
|
|||||||
EthApiError::Unsupported(msg) => internal_rpc_err(msg),
|
EthApiError::Unsupported(msg) => internal_rpc_err(msg),
|
||||||
EthApiError::InternalJsTracerError(msg) => internal_rpc_err(msg),
|
EthApiError::InternalJsTracerError(msg) => internal_rpc_err(msg),
|
||||||
EthApiError::InvalidParams(msg) => invalid_params_rpc_err(msg),
|
EthApiError::InvalidParams(msg) => invalid_params_rpc_err(msg),
|
||||||
EthApiError::InvalidRewardPercentiles => internal_rpc_err(error.to_string()),
|
|
||||||
err @ EthApiError::ExecutionTimedOut(_) => {
|
err @ EthApiError::ExecutionTimedOut(_) => {
|
||||||
rpc_error_with_code(CALL_EXECUTION_FAILED_CODE, err.to_string())
|
rpc_error_with_code(CALL_EXECUTION_FAILED_CODE, err.to_string())
|
||||||
}
|
}
|
||||||
err @ EthApiError::InternalBlockingTaskError => internal_rpc_err(err.to_string()),
|
err @ EthApiError::InternalBlockingTaskError | err @ EthApiError::InternalEthError => {
|
||||||
err @ EthApiError::InternalEthError => internal_rpc_err(err.to_string()),
|
internal_rpc_err(err.to_string())
|
||||||
|
}
|
||||||
err @ EthApiError::TransactionInputError(_) => invalid_params_rpc_err(err.to_string()),
|
err @ EthApiError::TransactionInputError(_) => invalid_params_rpc_err(err.to_string()),
|
||||||
EthApiError::Other(err) => err.to_rpc_error(),
|
EthApiError::Other(err) => err.to_rpc_error(),
|
||||||
EthApiError::MuxTracerError(msg) => internal_rpc_err(msg.to_string()),
|
EthApiError::MuxTracerError(msg) => internal_rpc_err(msg.to_string()),
|
||||||
@ -392,10 +393,9 @@ impl RpcInvalidTransactionError {
|
|||||||
pub(crate) const fn out_of_gas(reason: OutOfGasError, gas_limit: u64) -> Self {
|
pub(crate) const fn out_of_gas(reason: OutOfGasError, gas_limit: u64) -> Self {
|
||||||
match reason {
|
match reason {
|
||||||
OutOfGasError::Basic => Self::BasicOutOfGas(gas_limit),
|
OutOfGasError::Basic => Self::BasicOutOfGas(gas_limit),
|
||||||
OutOfGasError::Memory => Self::MemoryOutOfGas(gas_limit),
|
OutOfGasError::Memory | OutOfGasError::MemoryLimit => Self::MemoryOutOfGas(gas_limit),
|
||||||
OutOfGasError::Precompile => Self::PrecompileOutOfGas(gas_limit),
|
OutOfGasError::Precompile => Self::PrecompileOutOfGas(gas_limit),
|
||||||
OutOfGasError::InvalidOperand => Self::InvalidOperandOutOfGas(gas_limit),
|
OutOfGasError::InvalidOperand => Self::InvalidOperandOutOfGas(gas_limit),
|
||||||
OutOfGasError::MemoryLimit => Self::MemoryOutOfGas(gas_limit),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -471,7 +471,7 @@ impl From<reth_primitives::InvalidTransactionError> for RpcInvalidTransactionErr
|
|||||||
InvalidTransactionError::ChainIdMismatch => Self::InvalidChainId,
|
InvalidTransactionError::ChainIdMismatch => Self::InvalidChainId,
|
||||||
InvalidTransactionError::Eip2930Disabled |
|
InvalidTransactionError::Eip2930Disabled |
|
||||||
InvalidTransactionError::Eip1559Disabled |
|
InvalidTransactionError::Eip1559Disabled |
|
||||||
InvalidTransactionError::Eip4844Disabled => Self::TxTypeNotSupported,
|
InvalidTransactionError::Eip4844Disabled |
|
||||||
InvalidTransactionError::TxTypeNotSupported => Self::TxTypeNotSupported,
|
InvalidTransactionError::TxTypeNotSupported => Self::TxTypeNotSupported,
|
||||||
InvalidTransactionError::GasUintOverflow => Self::GasUintOverflow,
|
InvalidTransactionError::GasUintOverflow => Self::GasUintOverflow,
|
||||||
InvalidTransactionError::GasTooLow => Self::GasTooLow,
|
InvalidTransactionError::GasTooLow => Self::GasTooLow,
|
||||||
@ -589,8 +589,9 @@ impl From<PoolError> for RpcPoolError {
|
|||||||
match err.kind {
|
match err.kind {
|
||||||
PoolErrorKind::ReplacementUnderpriced => Self::ReplaceUnderpriced,
|
PoolErrorKind::ReplacementUnderpriced => Self::ReplaceUnderpriced,
|
||||||
PoolErrorKind::FeeCapBelowMinimumProtocolFeeCap(_) => Self::Underpriced,
|
PoolErrorKind::FeeCapBelowMinimumProtocolFeeCap(_) => Self::Underpriced,
|
||||||
PoolErrorKind::SpammerExceededCapacity(_) => Self::TxPoolOverflow,
|
PoolErrorKind::SpammerExceededCapacity(_) | PoolErrorKind::DiscardedOnInsert => {
|
||||||
PoolErrorKind::DiscardedOnInsert => Self::TxPoolOverflow,
|
Self::TxPoolOverflow
|
||||||
|
}
|
||||||
PoolErrorKind::InvalidTransaction(err) => err.into(),
|
PoolErrorKind::InvalidTransaction(err) => err.into(),
|
||||||
PoolErrorKind::Other(err) => Self::Other(err),
|
PoolErrorKind::Other(err) => Self::Other(err),
|
||||||
PoolErrorKind::AlreadyImported => Self::AlreadyKnown,
|
PoolErrorKind::AlreadyImported => Self::AlreadyKnown,
|
||||||
|
|||||||
@ -711,12 +711,8 @@ impl From<FilterError> for jsonrpsee::types::error::ErrorObject<'static> {
|
|||||||
rpc_error_with_code(jsonrpsee::types::error::INTERNAL_ERROR_CODE, err.to_string())
|
rpc_error_with_code(jsonrpsee::types::error::INTERNAL_ERROR_CODE, err.to_string())
|
||||||
}
|
}
|
||||||
FilterError::EthAPIError(err) => err.into(),
|
FilterError::EthAPIError(err) => err.into(),
|
||||||
err @ FilterError::InvalidBlockRangeParams => {
|
err @ FilterError::InvalidBlockRangeParams |
|
||||||
rpc_error_with_code(jsonrpsee::types::error::INVALID_PARAMS_CODE, err.to_string())
|
err @ FilterError::QueryExceedsMaxBlocks(_) |
|
||||||
}
|
|
||||||
err @ FilterError::QueryExceedsMaxBlocks(_) => {
|
|
||||||
rpc_error_with_code(jsonrpsee::types::error::INVALID_PARAMS_CODE, err.to_string())
|
|
||||||
}
|
|
||||||
err @ FilterError::QueryExceedsMaxResults(_) => {
|
err @ FilterError::QueryExceedsMaxResults(_) => {
|
||||||
rpc_error_with_code(jsonrpsee::types::error::INVALID_PARAMS_CODE, err.to_string())
|
rpc_error_with_code(jsonrpsee::types::error::INVALID_PARAMS_CODE, err.to_string())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,9 +57,7 @@ impl StaticFileSegment {
|
|||||||
};
|
};
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
Self::Headers => default_config,
|
Self::Headers | Self::Transactions | Self::Receipts => default_config,
|
||||||
Self::Transactions => default_config,
|
|
||||||
Self::Receipts => default_config,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,8 +65,7 @@ impl StaticFileSegment {
|
|||||||
pub const fn columns(&self) -> usize {
|
pub const fn columns(&self) -> usize {
|
||||||
match self {
|
match self {
|
||||||
Self::Headers => 3,
|
Self::Headers => 3,
|
||||||
Self::Transactions => 1,
|
Self::Transactions | Self::Receipts => 1,
|
||||||
Self::Receipts => 1,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,8 +26,7 @@ impl<'a> EnumHandler<'a> {
|
|||||||
// The following method will advance the
|
// The following method will advance the
|
||||||
// `fields_iterator` by itself and stop right before the next variant.
|
// `fields_iterator` by itself and stop right before the next variant.
|
||||||
FieldTypes::EnumVariant(name) => self.to(name, ident),
|
FieldTypes::EnumVariant(name) => self.to(name, ident),
|
||||||
FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
FieldTypes::EnumUnnamedField(_) | FieldTypes::StructField(_) => unreachable!(),
|
||||||
FieldTypes::StructField(_) => unreachable!(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.enum_lines
|
self.enum_lines
|
||||||
@ -39,8 +38,7 @@ impl<'a> EnumHandler<'a> {
|
|||||||
// The following method will advance the
|
// The following method will advance the
|
||||||
// `fields_iterator` by itself and stop right before the next variant.
|
// `fields_iterator` by itself and stop right before the next variant.
|
||||||
FieldTypes::EnumVariant(name) => self.from(name, ident),
|
FieldTypes::EnumVariant(name) => self.from(name, ident),
|
||||||
FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
FieldTypes::EnumUnnamedField(_) | FieldTypes::StructField(_) => unreachable!(),
|
||||||
FieldTypes::StructField(_) => unreachable!(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.enum_lines
|
self.enum_lines
|
||||||
|
|||||||
@ -23,8 +23,7 @@ impl<'a> StructHandler<'a> {
|
|||||||
pub fn generate_to(mut self) -> Vec<TokenStream2> {
|
pub fn generate_to(mut self) -> Vec<TokenStream2> {
|
||||||
while let Some(field) = self.next_field() {
|
while let Some(field) = self.next_field() {
|
||||||
match field {
|
match field {
|
||||||
FieldTypes::EnumVariant(_) => unreachable!(),
|
FieldTypes::EnumVariant(_) | FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
||||||
FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
|
||||||
FieldTypes::StructField(field_descriptor) => self.to(field_descriptor),
|
FieldTypes::StructField(field_descriptor) => self.to(field_descriptor),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,8 +33,7 @@ impl<'a> StructHandler<'a> {
|
|||||||
pub fn generate_from(&mut self, known_types: &[&str]) -> Vec<TokenStream2> {
|
pub fn generate_from(&mut self, known_types: &[&str]) -> Vec<TokenStream2> {
|
||||||
while let Some(field) = self.next_field() {
|
while let Some(field) = self.next_field() {
|
||||||
match field {
|
match field {
|
||||||
FieldTypes::EnumVariant(_) => unreachable!(),
|
FieldTypes::EnumVariant(_) | FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
||||||
FieldTypes::EnumUnnamedField(_) => unreachable!(),
|
|
||||||
FieldTypes::StructField(field_descriptor) => {
|
FieldTypes::StructField(field_descriptor) => {
|
||||||
self.from(field_descriptor, known_types)
|
self.from(field_descriptor, known_types)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -191,10 +191,10 @@ impl Error {
|
|||||||
Self::WannaRecovery => ffi::MDBX_WANNA_RECOVERY,
|
Self::WannaRecovery => ffi::MDBX_WANNA_RECOVERY,
|
||||||
Self::KeyMismatch => ffi::MDBX_EKEYMISMATCH,
|
Self::KeyMismatch => ffi::MDBX_EKEYMISMATCH,
|
||||||
Self::DecodeErrorLenDiff | Self::DecodeError => ffi::MDBX_EINVAL,
|
Self::DecodeErrorLenDiff | Self::DecodeError => ffi::MDBX_EINVAL,
|
||||||
Self::Access => ffi::MDBX_EACCESS,
|
|
||||||
Self::TooLarge => ffi::MDBX_TOO_LARGE,
|
Self::TooLarge => ffi::MDBX_TOO_LARGE,
|
||||||
Self::BadSignature => ffi::MDBX_EBADSIGN,
|
Self::BadSignature => ffi::MDBX_EBADSIGN,
|
||||||
Self::WriteTransactionUnsupportedInReadOnlyMode => ffi::MDBX_EACCESS,
|
Self::Access |
|
||||||
|
Self::WriteTransactionUnsupportedInReadOnlyMode |
|
||||||
Self::NestedTransactionsUnsupportedWithWriteMap => ffi::MDBX_EACCESS,
|
Self::NestedTransactionsUnsupportedWithWriteMap => ffi::MDBX_EACCESS,
|
||||||
Self::ReadTransactionTimeout => -96000, // Custom non-MDBX error code
|
Self::ReadTransactionTimeout => -96000, // Custom non-MDBX error code
|
||||||
Self::Other(err_code) => *err_code,
|
Self::Other(err_code) => *err_code,
|
||||||
|
|||||||
@ -107,8 +107,7 @@ impl CanonStateNotification {
|
|||||||
/// Returns the new committed [Chain] for [`Self::Reorg`] and [`Self::Commit`] variants.
|
/// Returns the new committed [Chain] for [`Self::Reorg`] and [`Self::Commit`] variants.
|
||||||
pub fn committed(&self) -> Arc<Chain> {
|
pub fn committed(&self) -> Arc<Chain> {
|
||||||
match self {
|
match self {
|
||||||
Self::Commit { new } => new.clone(),
|
Self::Commit { new } | Self::Reorg { new, .. } => new.clone(),
|
||||||
Self::Reorg { new, .. } => new.clone(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,8 +117,7 @@ impl CanonStateNotification {
|
|||||||
/// 1 new block.
|
/// 1 new block.
|
||||||
pub fn tip(&self) -> &SealedBlockWithSenders {
|
pub fn tip(&self) -> &SealedBlockWithSenders {
|
||||||
match self {
|
match self {
|
||||||
Self::Commit { new } => new.tip(),
|
Self::Commit { new } | Self::Reorg { new, .. } => new.tip(),
|
||||||
Self::Reorg { new, .. } => new.tip(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -92,6 +92,7 @@ impl PoolError {
|
|||||||
/// erroneous transaction.
|
/// erroneous transaction.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_bad_transaction(&self) -> bool {
|
pub fn is_bad_transaction(&self) -> bool {
|
||||||
|
#[allow(clippy::match_same_arms)]
|
||||||
match &self.kind {
|
match &self.kind {
|
||||||
PoolErrorKind::AlreadyImported => {
|
PoolErrorKind::AlreadyImported => {
|
||||||
// already imported but not bad
|
// already imported but not bad
|
||||||
@ -213,6 +214,7 @@ impl InvalidPoolTransactionError {
|
|||||||
/// context of the transaction pool and warrants peer penalization.
|
/// context of the transaction pool and warrants peer penalization.
|
||||||
///
|
///
|
||||||
/// See [`PoolError::is_bad_transaction`].
|
/// See [`PoolError::is_bad_transaction`].
|
||||||
|
#[allow(clippy::match_same_arms)]
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_bad_transaction(&self) -> bool {
|
fn is_bad_transaction(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
@ -243,10 +245,10 @@ impl InvalidPoolTransactionError {
|
|||||||
// settings
|
// settings
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
InvalidTransactionError::OldLegacyChainId => true,
|
InvalidTransactionError::OldLegacyChainId |
|
||||||
InvalidTransactionError::ChainIdMismatch => true,
|
InvalidTransactionError::ChainIdMismatch |
|
||||||
InvalidTransactionError::GasUintOverflow => true,
|
InvalidTransactionError::GasUintOverflow |
|
||||||
InvalidTransactionError::TxTypeNotSupported => true,
|
InvalidTransactionError::TxTypeNotSupported |
|
||||||
InvalidTransactionError::SignerAccountHasBytecode => true,
|
InvalidTransactionError::SignerAccountHasBytecode => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1036,7 +1036,7 @@ impl PoolTransaction for EthPooledTransaction {
|
|||||||
///
|
///
|
||||||
/// This will return `None` for non-EIP1559 transactions
|
/// This will return `None` for non-EIP1559 transactions
|
||||||
fn max_priority_fee_per_gas(&self) -> Option<u128> {
|
fn max_priority_fee_per_gas(&self) -> Option<u128> {
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns, clippy::match_same_arms)]
|
||||||
match &self.transaction.transaction {
|
match &self.transaction.transaction {
|
||||||
Transaction::Legacy(_) | Transaction::Eip2930(_) => None,
|
Transaction::Legacy(_) | Transaction::Eip2930(_) => None,
|
||||||
Transaction::Eip1559(tx) => Some(tx.max_priority_fee_per_gas),
|
Transaction::Eip1559(tx) => Some(tx.max_priority_fee_per_gas),
|
||||||
|
|||||||
@ -333,9 +333,9 @@ impl From<ForkSpec> for ChainSpec {
|
|||||||
ForkSpec::Istanbul => spec_builder.istanbul_activated(),
|
ForkSpec::Istanbul => spec_builder.istanbul_activated(),
|
||||||
ForkSpec::Berlin => spec_builder.berlin_activated(),
|
ForkSpec::Berlin => spec_builder.berlin_activated(),
|
||||||
ForkSpec::London | ForkSpec::BerlinToLondonAt5 => spec_builder.london_activated(),
|
ForkSpec::London | ForkSpec::BerlinToLondonAt5 => spec_builder.london_activated(),
|
||||||
ForkSpec::Merge => spec_builder.paris_activated(),
|
ForkSpec::Merge |
|
||||||
ForkSpec::MergeEOF => spec_builder.paris_activated(),
|
ForkSpec::MergeEOF |
|
||||||
ForkSpec::MergeMeterInitCode => spec_builder.paris_activated(),
|
ForkSpec::MergeMeterInitCode |
|
||||||
ForkSpec::MergePush0 => spec_builder.paris_activated(),
|
ForkSpec::MergePush0 => spec_builder.paris_activated(),
|
||||||
ForkSpec::Shanghai => spec_builder.shanghai_activated(),
|
ForkSpec::Shanghai => spec_builder.shanghai_activated(),
|
||||||
ForkSpec::Cancun => spec_builder.cancun_activated(),
|
ForkSpec::Cancun => spec_builder.cancun_activated(),
|
||||||
|
|||||||
Reference in New Issue
Block a user