diff --git a/Cargo.toml b/Cargo.toml index 329f3271e148..9ce33fa77029 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,7 @@ revm-inspectors = { git = "https://github.com/telosnetwork/telos-evm-inspectors" # eth alloy-chains = { version = "0.1", feature = ["serde", "rlp", "arbitrary"] } -alloy-primitives = "0.6" +alloy-primitives = { version = "0.6", feature = ["serde"] } alloy-dyn-abi = "0.6" alloy-sol-types = "0.6" alloy-rlp = "0.3" diff --git a/crates/telos/src/lib.rs b/crates/telos/src/lib.rs index 71f0bc8cc3e7..bb3dce4f987d 100644 --- a/crates/telos/src/lib.rs +++ b/crates/telos/src/lib.rs @@ -31,30 +31,6 @@ pub struct TelosNetworkConfig { pub gas_cache: GasPriceCache, } -pub fn deserialize_u256<'de, D>(deserializer: D) -> Result -where - D: Deserializer<'de>, -{ - struct U256Visitor; - - impl<'de> serde::de::Visitor<'de> for U256Visitor { - type Value = U256; - - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { - formatter.write_str("a hex string representing a U256 value") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - Ok(U256::from_str_radix(v, 16).unwrap()) - } - } - - deserializer.deserialize_str(U256Visitor) -} - // Telos EVM Account Table Row #[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] #[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))] @@ -63,7 +39,6 @@ pub struct TelosAccountTableRow { pub account: String, pub nonce: u64, pub code: Bytes, - #[serde(deserialize_with = "deserialize_u256")] pub balance: U256 } @@ -72,9 +47,7 @@ pub struct TelosAccountTableRow { #[cfg_attr(feature = "ssz", derive(ssz_derive::Encode, ssz_derive::Decode))] pub struct TelosAccountStateTableRow { pub address: Address, - #[serde(deserialize_with = "deserialize_u256")] pub key: U256, - #[serde(deserialize_with = "deserialize_u256")] pub value: U256 } diff --git a/scripts/build-dev.sh b/scripts/build-dev.sh new file mode 100755 index 000000000000..347985fbb6e8 --- /dev/null +++ b/scripts/build-dev.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +INSTALL_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +OG_DIR="$(pwd)" +cd $INSTALL_ROOT +cargo build --features telos +cd $OG_DIR diff --git a/scripts/run-dev.sh b/scripts/run-dev.sh new file mode 100755 index 000000000000..b3134c3303b3 --- /dev/null +++ b/scripts/run-dev.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +INSTALL_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +OG_DIR="$(pwd)" +cd $INSTALL_ROOT + +LOG_NAME="$(basename $INSTALL_ROOT)" +LOG_PATH="$INSTALL_ROOT/$LOG_NAME.log" + +CLIENT_BIN="$INSTALL_ROOT/target/debug/reth" + +export RUST_BACKTRACE=full + +$CLIENT_BIN node --log.stdout.filter info \ + --dev \ + --datadir $INSTALL_ROOT/data \ + --chain tevmmainnet-base \ + --config $INSTALL_ROOT/config.toml \ + --http --http.api all \ + --ws --ws.api all \ + --telos.telos_endpoint https://mainnet.telos.net \ + --telos.signer_account rpc.evm \ + --telos.signer_permission rpc \ + --telos.signer_key 5Hq1FmDPfxxxxxxxxxxxxxxynBtJ6oS5C7LfZE5MMyZeRJ \ + --telos.gas_cache_seconds 30 \ + "$@" + +cd $OG_DIR diff --git a/scripts/start-dev.sh b/scripts/start-dev.sh new file mode 100755 index 000000000000..bef16268ce91 --- /dev/null +++ b/scripts/start-dev.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +INSTALL_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" +OG_DIR="$(pwd)" +cd $INSTALL_ROOT + +LOG_NAME="$(basename $INSTALL_ROOT)" +LOG_PATH="$INSTALL_ROOT/$LOG_NAME.log" + +CLIENT_BIN="$INSTALL_ROOT/target/debug/reth" + +export RUST_BACKTRACE=full + +nohup $CLIENT_BIN node --log.stdout.filter info \ + --dev \ + --datadir $INSTALL_ROOT/data \ + --chain tevmmainnet-base \ + --config $INSTALL_ROOT/config.toml \ + --http --http.api all \ + --ws --ws.api all \ + --telos.telos_endpoint https://mainnet.telos.net \ + --telos.signer_account rpc.evm \ + --telos.signer_permission rpc \ + --telos.signer_key 5Hq1FmDPfxxxxxxxxxxxxxxynBtJ6oS5C7LfZE5MMyZeRJ \ + --telos.gas_cache_seconds 30 \ + "$@" >> "$LOG_PATH" 2>&1 & + +PID="$!" +echo "telos-reth started with pid $PID logging to $LOG_PATH" +echo $PID > $INSTALL_ROOT/telos-reth.pid +cd $OG_DIR diff --git a/scripts/start.sh b/scripts/start.sh index d3dbfac556fc..b92bbecf2729 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -9,6 +9,8 @@ LOG_PATH="$INSTALL_ROOT/$LOG_NAME.log" CLIENT_BIN="$INSTALL_ROOT/target/release/reth" +export RUST_BACKTRACE=full + nohup $CLIENT_BIN node --log.stdout.filter info \ --dev \ --datadir $INSTALL_ROOT/data \ @@ -26,4 +28,4 @@ nohup $CLIENT_BIN node --log.stdout.filter info \ PID="$!" echo "telos-reth started with pid $PID logging to $LOG_PATH" echo $PID > $INSTALL_ROOT/telos-reth.pid -cd $OG_DIR \ No newline at end of file +cd $OG_DIR