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

Feat/fuel vm v2 #14

Merged
merged 7 commits into from
Oct 11, 2024
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
900 changes: 121 additions & 779 deletions Cargo.lock

Large diffs are not rendered by default.

67 changes: 25 additions & 42 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -349,54 +349,37 @@ reth-trie-parallel = { path = "crates/trie/parallel" }
#], default-features = false }
#revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "4fe17f0" }

#revm = { package = "revm-fluent", git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", features = [
# "std",
# "secp256k1",
# "blst",
# "rwasm",
# # "debug_print",
#], default-features = false }
#revm-primitives = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", features = ["rwasm"] }
#revm-inspectors = { git = "https://github.com/fluentlabs-xyz/revm-inspectors.git", branch = "devel", features = [
# "rwasm",
#] }
revm = { package = "revm-fluent", path = "../fluentbase/revm/crates/revm_fluent", features = [
revm = { package = "revm", git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", features = [
"std",
"secp256k1",
"hashbrown",
"blst",
"rwasm",
# "debug_print",
], default-features = false }
revm-primitives = { package = "revm-primitives", path = "../fluentbase/revm/crates/primitives", features = ["rwasm"] }
revm-inspectors = { package = "revm-inspectors", path = "../revm-inspectors", features = ["rwasm"] }

#fluentbase-poseidon = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
#fluentbase-core = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
#fluentbase-runtime = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
#fluentbase-sdk = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
#fluentbase-genesis = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
#fluentbase-types = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "devel", default-features = false }
fluentbase-poseidon = { path = "../fluentbase/crates/poseidon", default-features = false }
fluentbase-core = { path = "../fluentbase/crates/core", default-features = false }
fluentbase-runtime = { path = "../fluentbase/crates/runtime", default-features = false }
fluentbase-sdk = { path = "../fluentbase/crates/sdk", default-features = false }
fluentbase-genesis = { path = "../fluentbase/crates/genesis", default-features = false }
fluentbase-types = { path = "../fluentbase/crates/types", default-features = false }
revm-primitives = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm" }
revm-inspectors = { git = "https://github.com/fluentlabs-xyz/revm-inspectors.git", branch = "feat/fuel-vm", features = [
# "rwasm",
] }
#revm = { package = "revm", path = "../fluentbase/revm/crates/revm", features = [
# "std",
# "secp256k1",
# "blst",
#], default-features = false }
#revm-primitives = { package = "revm-primitives", path = "../fluentbase/revm/crates/primitives", features = ["rwasm"] }
#revm-inspectors = { package = "revm-inspectors", path = "../revm-inspectors", features = ["rwasm"] }

#fuel-tx = { git = "https://github.com/fluentlabs-xyz/fuel-vm", branch = "develop", default-features = false, features = ["alloc"] }
#fuel-vm = { git = "https://github.com/fluentlabs-xyz/fuel-vm", branch = "develop", default-features = false, features = ["alloc"] }
#fuel-core = { git = "https://github.com/fluentlabs-xyz/fuel-core", branch = "devel" }
#fuel-core-types = { git = "https://github.com/fluentlabs-xyz/fuel-core", branch = "devel", default-features = false, features = ["serde", "alloc"] }
#fuel-core-executor = { git = "https://github.com/fluentlabs-xyz/fuel-core", branch = "devel", default-features = false, features = ["alloc"] }
#fuel-core-storage = { git = "https://github.com/fluentlabs-xyz/fuel-core", branch = "devel", default-features = false, features = ["alloc"] }
fuel-tx = { path = "../fuel-vm/fuel-tx", default-features = false, features = ["alloc"] }
fuel-vm = { path = "../fuel-vm/fuel-vm", default-features = false, features = ["alloc"] }
fuel-core = { path = "../fuel-core/crates/fuel-core" }
fuel-core-types = { path = "../fuel-core/crates/types", default-features = false, features = ["serde", "alloc"] }
fuel-core-executor = { path = "../fuel-core/crates/services/executor", default-features = false, features = ["alloc"] }
fuel-core-storage = { path = "../fuel-core/crates/storage", default-features = false, features = ["alloc"] }
fluentbase-poseidon = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", default-features = false }
fluentbase-core = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", default-features = false }
fluentbase-sdk = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", default-features = false }
fluentbase-genesis = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", default-features = false }
fluentbase-types = { git = "https://github.com/fluentlabs-xyz/fluentbase", branch = "feat/fuel-vm", default-features = false }
#fluentbase-poseidon = { path = "../fluentbase/crates/poseidon", default-features = false }
#fluentbase-core = { path = "../fluentbase/crates/core", default-features = false }
#fluentbase-sdk = { path = "../fluentbase/crates/sdk", default-features = false }
#fluentbase-genesis = { path = "../fluentbase/crates/genesis", default-features = false }
#fluentbase-types = { path = "../fluentbase/crates/types", default-features = false }

fuel-ee-core = { path = "../fuel-ee/crates/core", default-features = false, features = [] }
fuel-ee-core = { git = "https://github.com/fluentlabs-xyz/fuel-ee", branch = "devel", default-features = false }
#fuel-ee-core = { path = "../fuel-ee/crates/core", default-features = false, features = ["std"] }

# eth
alloy-chains = "0.1.15"
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,12 @@ pr:
make update-book-cli && \
make test

FLUENT_NODE_BUILD_PROFILE=--release
FLUENT_NODE_BUILD_PROFILE=--profile dev

.PHONY: fluent_build
fluent_build:
cargo build -p reth
cargo build -p reth --bin reth $(FLUENT_NODE_BUILD_PROFILE)

FLUENT_DATADIR:=datadir
.PHONY: fluent_clear_datadir
Expand All @@ -486,7 +489,7 @@ fluent_clear_datadir:

.PHONY: fluent_run
fluent_run:
cargo run -p reth --bin reth -- --color=never --chain=dev node --datadir=./$(FLUENT_DATADIR) --dev --full --http --port=30305
cargo run -p reth --bin reth $(FLUENT_NODE_BUILD_PROFILE) -- --color=never --chain=dev node --datadir=./$(FLUENT_DATADIR) --dev --full --http --port=30305

.PHONY: fluent_run_clean
fluent_run_clean:
Expand Down
15 changes: 8 additions & 7 deletions crates/primitives-traits/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pub struct Account {
pub balance: U256,
/// Hash of the account's bytecode.
pub bytecode_hash: Option<B256>,
/// Hash of the rWASM bytecode
pub rwasm_hash: Option<B256>,
// /// Hash of the rWASM bytecode
// pub rwasm_hash: Option<B256>,
}

impl Account {
Expand All @@ -43,16 +43,17 @@ impl Account {
// .or_else(|| {
// value.code.as_ref().map(|bytes| keccak256(bytes.as_ref()))
// });
let rwasm_hash =
value.storage.as_ref().and_then(|s| s.get(&GENESIS_KECCAK_HASH_SLOT)).cloned().or_else(
|| value.code.as_ref().map(|bytes| B256::from(poseidon_hash(bytes.as_ref()))),
);
// let rwasm_hash =
// value.storage.as_ref().and_then(|s|
// s.get(&GENESIS_KECCAK_HASH_SLOT)).cloned().or_else( ||
// value.code.as_ref().map(|bytes| B256::from(poseidon_hash(bytes.as_ref()))),
// );
Self {
// nonce must exist, so we default to zero when converting a genesis account
nonce: value.nonce.unwrap_or_default(),
balance: value.balance,
bytecode_hash: value.code.as_ref().map(keccak256),
rwasm_hash,
// rwasm_hash,
}
}

Expand Down
15 changes: 8 additions & 7 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ fluentbase-core.workspace = true
fluentbase-types.workspace = true

# fuel
fuel-vm = { workspace = true, default-features = false, features = ["alloc"] }
fuel-tx = { workspace = true, default-features = false, features = ["alloc"] }
fuel-core = { workspace = true }
fuel-core-types = { workspace = true, default-features = false, features = ["serde", "alloc"] }
fuel-core-executor = { workspace = true, default-features = false, features = ["alloc"] }
fuel-core-storage = { workspace = true, default-features = false, features = ["alloc"] }
#fuel-vm = { workspace = true, default-features = false, features = ["alloc"] }
#fuel-tx = { workspace = true, default-features = false, features = ["alloc"] }
#fuel-core = { workspace = true }
#fuel-core-types = { workspace = true, default-features = false, features = ["serde", "alloc"] }
#fuel-core-executor = { workspace = true, default-features = false, features = ["alloc"] }
#fuel-core-storage = { workspace = true, default-features = false, features = ["alloc"] }

fuel-ee-core = { workspace = true }

Expand Down Expand Up @@ -81,7 +81,8 @@ alloy-eips = { workspace = true, features = ["arbitrary"] }
alloy-consensus = { workspace = true, features = ["arbitrary"] }

# fuel-vm
fuel-vm = { workspace = true, default-features = false, features = ["test-helpers"] }
#fuel-vm = { workspace = true, default-features = false, features = ["test-helpers"] }
fuel-ee-core = { workspace = true }

assert_matches.workspace = true
arbitrary = { workspace = true, features = ["derive"] }
Expand Down
Loading
Loading