Skip to content

Commit

Permalink
Merge pull request #77 from weaveVM/fix/fix-pathes
Browse files Browse the repository at this point in the history
fix pathes, naming, fmt
  • Loading branch information
allnil authored Oct 14, 2024
2 parents 34d4fdf + 53fa5e9 commit 01a855d
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 45 deletions.
48 changes: 24 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ members = [
"wvm-apps/wvm-exexed/crates/exex-etl/",
"wvm-apps/wvm-exexed/crates/lambda/",
"wvm-apps/wvm-exexed/crates/precompiles/",
"wvm-apps/wvm-exexed/crates/wevm-borsh/",
"wvm-apps/wvm-exexed/crates/wvm-borsh/",
"wvm-apps/wvm-exexed/crates/brotli/",
]
default-members = ["bin/reth"]
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives-traits/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub const EPOCH_SLOTS: u64 = 32;
///
/// This is the time period of 1 seconds in which a randomly chosen validator has time to propose a
/// block.
pub const SLOT_DURATION: Duration = Duration::from_secs(1); // Wevm #356: 1s per block
pub const SLOT_DURATION: Duration = Duration::from_secs(1); // wvm #356: 1s per block

/// An EPOCH is a series of 32 slots (~6.4min).
pub const EPOCH_DURATION: Duration = Duration::from_secs(12 * EPOCH_SLOTS);
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ where
}
// Increment block_env number and timestamp for the next bundle
block_env.number += U256::from(1);
block_env.timestamp += U256::from(1); // Wevm #356: 1s per block
block_env.timestamp += U256::from(1); // wvm #356: 1s per block

all_bundles.push(results);
}
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ brotlic.workspace = true
lambda = { path = "crates/lambda" }
arweave-upload = { path = "crates/arweave-upload" }
precompiles = { path = "crates/precompiles" }
wevm-borsh = { path = "crates/wevm-borsh" }
wvm-borsh = { path = "crates/wvm-borsh" }
exex-etl = { path = "crates/exex-etl" }
rbrotli = { path = "crates/brotli" }
borsh.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/brotli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ reth.workspace = true
brotlic.workspace = true
borsh.workspace = true
serde_json.workspace = true
wevm-borsh = { path = "../wevm-borsh", name = "wevm-borsh" }
wvm-borsh = { path = "../wvm-borsh", name = "wvm-borsh" }
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/brotli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn from_brotli(data: Vec<u8>) -> Vec<u8> {
mod brotlic_tests {
use crate::{from_brotli, to_brotli};
use reth::primitives::SealedBlockWithSenders;
use wevm_borsh::block::BorshSealedBlockWithSenders;
use wvm_borsh::block::BorshSealedBlockWithSenders;

#[test]
pub fn test_brotlic_block() {
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/precompiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ arweave-upload = { path = "../arweave-upload" }
tokio.workspace = true
reqwest-graphql = "1.0.0"
rbrotli = { path = "../brotli" }
wevm-borsh = { path = "../wevm-borsh", name = "wevm-borsh" }
wvm-borsh = { path = "../wvm-borsh", name = "wvm-borsh" }
borsh.workspace = true
alloy-primitives.workspace = true
reth-evm-ethereum.workspace = true
4 changes: 2 additions & 2 deletions wvm-apps/wvm-exexed/crates/precompiles/src/inner/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::inner::{
arweave_precompile::ARWEAVE_UPLOAD_PC, arweave_read_precompile::ARWEAVE_READ_PC,
kyve_precompile::KYVE_READ_PC, test_precompile::HELLO_WORLD_PC,
wevm_block_precompile::WVM_BLOCK_PC,
wvm_block_precompile::WVM_BLOCK_PC,
};
use reth::revm::precompile::{u64_to_address, PrecompileWithAddress};

Expand All @@ -12,7 +12,7 @@ mod kyve_precompile;
mod string_block;
mod test_precompile;
mod util;
mod wevm_block_precompile;
mod wvm_block_precompile;

fn hex_to_u64(hex_str: &str) -> u64 {
u64::from_str_radix(&hex_str[2..], 16).unwrap()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use wevm_borsh::block::BorshSealedBlockWithSenders;
use wvm_borsh::block::BorshSealedBlockWithSenders;

#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[serde(rename_all = "camelCase")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use alloy_primitives::Bytes;
use rbrotli::from_brotli;
use reth::primitives::revm_primitives::{Precompile, PrecompileOutput, PrecompileResult};
use revm_primitives::{PrecompileError, PrecompileErrors};
use wevm_borsh::block::BorshSealedBlockWithSenders;
use wvm_borsh::block::BorshSealedBlockWithSenders;

pub const WVM_BLOCK_PC: Precompile = Precompile::Standard(wevm_read_block_pc);
pub const WVM_BLOCK_PC: Precompile = Precompile::Standard(wvm_read_block_pc);

pub const WVM_BLOCK_PC_READ_BASE: u64 = 10_000;

Expand Down Expand Up @@ -65,7 +65,7 @@ async fn fetch_with_fallback(
send_and_get_edge(fallback_gateway, query).await
}

fn wevm_read_block_pc(input: &Bytes, gas_limit: u64) -> PrecompileResult {
fn wvm_read_block_pc(input: &Bytes, gas_limit: u64) -> PrecompileResult {
let data_size = input.len();
let gas_used: u64 = (WVM_BLOCK_PC_READ_BASE as usize + data_size * 3) as u64;

Expand Down Expand Up @@ -239,14 +239,14 @@ fn wevm_read_block_pc(input: &Bytes, gas_limit: u64) -> PrecompileResult {

#[cfg(test)]
mod arweave_read_pc_tests {
use crate::inner::wevm_block_precompile::wevm_read_block_pc;
use crate::inner::wvm_block_precompile::wvm_read_block_pc;
use alloy_primitives::Bytes;
use reth::primitives::revm_primitives::PrecompileOutput;

#[test]
pub fn test_read_wvm_block() {
let input = Bytes::from("https://arweave.mainnet.irys.xyz;1127975;hash".as_bytes());
let PrecompileOutput { gas_used, bytes } = wevm_read_block_pc(&input, 100_000).unwrap();
let PrecompileOutput { gas_used, bytes } = wvm_read_block_pc(&input, 100_000).unwrap();
assert_eq!(bytes.len(), 66);
assert_eq!(
bytes.to_vec(),
Expand All @@ -259,7 +259,7 @@ mod arweave_read_pc_tests {
#[test]
pub fn test_read_wvm_block_arweave_fallback() {
let input = Bytes::from("https://arweave.net;1127975;hash".as_bytes());
let PrecompileOutput { gas_used, bytes } = wevm_read_block_pc(&input, 100_000).unwrap();
let PrecompileOutput { gas_used, bytes } = wvm_read_block_pc(&input, 100_000).unwrap();
assert_eq!(bytes.len(), 66);
assert_eq!(
bytes.to_vec(),
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/precompiles/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ extern crate core;

pub mod inner;
pub mod node;
pub mod wevm_node_config;
pub mod wvm_node_config;

pub const WVM_DATA_PUBLISHERS: [&str; 1] = ["5JUE58yemNynRDeQDyVECKbGVCQbnX7unPrBRqCPVn5Z"];
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/precompiles/src/node.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{inner::wvm_precompiles, wevm_node_config::WvmEthEvmConfig};
use crate::{inner::wvm_precompiles, wvm_node_config::WvmEthEvmConfig};
use reth::{
api::{FullNodeTypes, NodeTypes, PayloadTypes},
builder::{
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/reth-exexed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ reth-primitives.workspace = true
eyre.workspace = true
borsh.workspace = true
serde_json.workspace = true
wevm-borsh = { path = "../wevm-borsh", name = "wevm-borsh" }
wvm-borsh = { path = "../wvm-borsh", name = "wvm-borsh" }
exex-etl = { path = "../exex-etl" }
lambda = { path = "../lambda" }
arweave-upload = { path = "../arweave-upload" }
Expand Down
2 changes: 1 addition & 1 deletion wvm-apps/wvm-exexed/crates/reth-exexed/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use reth_exex::{ExExContext, ExExEvent, ExExNotification};
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_primitives::constants::SLOT_DURATION;
use tracing::{error, info};
use wevm_borsh::block::BorshSealedBlockWithSenders;
use wvm_borsh::block::BorshSealedBlockWithSenders;

async fn exex_etl_processor<Node: FullNodeComponents>(
mut ctx: ExExContext<Node>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "wevm-borsh"
name = "wvm-borsh"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down

0 comments on commit 01a855d

Please sign in to comment.