Skip to content

Add support to DecodeWithMemTracking #315

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

Merged
merged 6 commits into from
May 21, 2025
Merged
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
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ edition = "2018"

[dependencies]
auto_impl = "1.0"
ethereum = { git = "https://github.com/rust-ethereum/ethereum.git", rev = "3be0d8fd4c2ad1ba216b69ef65b9382612efc8ba", default-features = false }
ethereum = { git = "https://github.com/rust-ethereum/ethereum.git", rev = "bbb544622208ef6e9890a2dbc224248f6dd13318", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorpaas could we have a new release for this package?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RomarQ could we merge it without the release?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems fine.

cc: @sorpaas @boundless-forest @koushiro
If you guys agree, we should be able to merge this.

log = { version = "0.4", default-features = false }
primitive-types = { version = "0.13", default-features = false, features = ["rlp"] }
rlp = { version = "0.6", default-features = false }
sha3 = { version = "0.10", default-features = false }

# Optional dependencies
environmental = { version = "1.1.2", default-features = false, optional = true }
scale-codec = { package = "parity-scale-codec", version = "3.2", default-features = false, features = ["derive"], optional = true }
scale-codec = { package = "parity-scale-codec", version = "3.7.5", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }

Expand Down Expand Up @@ -81,4 +81,4 @@ members = [
"gasometer",
"runtime",
"fuzzer",
]
]
35 changes: 30 additions & 5 deletions core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ pub enum Capture<E, T> {
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExitReason {
Expand Down Expand Up @@ -59,7 +64,12 @@ impl ExitReason {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExitSucceed {
Expand All @@ -81,7 +91,12 @@ impl From<ExitSucceed> for ExitReason {
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExitRevert {
Expand All @@ -99,7 +114,12 @@ impl From<ExitRevert> for ExitReason {
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExitError {
Expand Down Expand Up @@ -172,7 +192,12 @@ impl From<ExitError> for ExitReason {
#[derive(Clone, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ExitFatal {
Expand Down
7 changes: 6 additions & 1 deletion core/src/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[cfg_attr(
feature = "with-codec",
derive(scale_codec::Encode, scale_codec::Decode, scale_info::TypeInfo)
derive(
scale_codec::Encode,
scale_codec::Decode,
scale_codec::DecodeWithMemTracking,
scale_info::TypeInfo
)
)]
#[cfg_attr(feature = "with-serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Opcode(pub u8);
Expand Down