Skip to content

Commit

Permalink
Feature: use parity-grade serialization (#462)
Browse files Browse the repository at this point in the history
* Fix: use parity-grade serialization

* Fix: more cleanups

* Fix: unhardcode version, some todos
  • Loading branch information
Tirka authored Sep 27, 2023
1 parent 259d914 commit c934621
Show file tree
Hide file tree
Showing 50 changed files with 482 additions and 523 deletions.
20 changes: 4 additions & 16 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 accounts-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ solana-logger = { path = "../logger", version = "=1.10.41" }
solana-measure = { path = "../measure", version = "=1.10.41" }
solana-runtime = { path = "../runtime", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion accounts-cluster-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-test-validator = { path = "../test-validator", version = "=1.10.41" }
solana-transaction-status = { path = "../transaction-status", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
spl-token = { version = "=3.5.0", features = ["no-entrypoint"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion banking-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ solana-poh = { path = "../poh", version = "=1.10.41" }
solana-runtime = { path = "../runtime", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion bench-streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ clap = "2.33.1"
crossbeam-channel = "0.5"
solana-net-utils = { path = "../net-utils", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
2 changes: 1 addition & 1 deletion bench-tps-evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ solana-runtime = { path = "../runtime", version = "1.4.0" }
solana-sdk = { path = "../sdk", version = "1.4.0" }
solana-gossip = { path = "../gossip", version = "1.9.23" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
solana-evm-loader-program = { path = "../evm-utils/programs/evm_loader" }
rand_isaac = "0.1.1"
simple_logger = "2.2"
Expand Down
2 changes: 1 addition & 1 deletion bench-tps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ solana-rpc = { path = "../rpc", version = "=1.10.41" }
solana-runtime = { path = "../runtime", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
thiserror = "1.0"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ solana-program-runtime = { path = "../program-runtime", version = "=1.10.41" }
solana-remote-wallet = { path = "../remote-wallet", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-transaction-status = { path = "../transaction-status", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
solana-vote-program = { path = "../programs/vote", version = "=1.10.41" }
solana_rbpf = "=0.2.24"
spl-memo = { version = "=3.0.1", features = ["no-entrypoint"] }
Expand Down
9 changes: 2 additions & 7 deletions cli/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,7 @@ fn get_evm_balance(rpc_client: &RpcClient, address: evm::H160) -> anyhow::Result

println!(
"EVM address: {:?}, balance {} ({} in hex)",
address,
vlx,
Hex(balance)
address, vlx, balance
);
Ok(())
}
Expand Down Expand Up @@ -326,10 +324,7 @@ fn transfer(
Default::default(),
)?
};
Ok(format!(
"Transaction signature = {}",
signature
))
Ok(format!("Transaction signature = {}", signature))
}
}

Expand Down
2 changes: 1 addition & 1 deletion client-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-test-validator = { path = "../test-validator", version = "=1.10.41" }
solana-transaction-status = { path = "../transaction-status", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
systemstat = "0.1.10"
tokio = { version = "~1.14.1", features = ["full"] }

Expand Down
2 changes: 1 addition & 1 deletion client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ solana-net-utils = { path = "../net-utils", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-transaction-status = { path = "../transaction-status", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
solana-vote-program = { path = "../programs/vote", version = "=1.10.41" }
spl-token-2022 = { version = "=0.4.2", features = ["no-entrypoint"] }
thiserror = "1.0"
Expand Down
18 changes: 5 additions & 13 deletions client/src/nonblocking/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5351,24 +5351,16 @@ impl RpcClient {
&self,
address: &evm_state::Address,
) -> ClientResult<evm_state::U256> {
self.send::<evm_rpc::Hex<_>>(
RpcRequest::EthGetTransactionCount,
json!([evm_rpc::Hex(*address)]),
)
.await
.map(|h| h.0)
self.send(RpcRequest::EthGetTransactionCount, json!([*address]))
.await
}

pub async fn get_evm_balance(
&self,
address: &evm_state::Address,
) -> ClientResult<evm_state::U256> {
self.send::<evm_rpc::Hex<_>>(
RpcRequest::EthGetBalance,
json!([evm_rpc::Hex(*address), "latest"]),
)
.await
.map(|h| h.0)
self.send(RpcRequest::EthGetBalance, json!([*address, "latest"]))
.await
}

pub async fn get_evm_transaction_receipt(
Expand All @@ -5377,7 +5369,7 @@ impl RpcClient {
) -> ClientResult<Option<evm_rpc::RPCReceipt>> {
self.send::<Option<evm_rpc::RPCReceipt>>(
RpcRequest::EthGetTransactionReceipt,
json!([evm_rpc::Hex(*hash)]),
json!([*hash]),
)
.await
}
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-send-transaction-service = { path = "../send-transaction-service", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-transaction-status = { path = "../transaction-status", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }
solana-vote-program = { path = "../programs/vote", version = "=1.10.41" }
sys-info = "0.9.1"
tempfile = "3.3.0"
Expand Down
2 changes: 1 addition & 1 deletion dos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ solana-net-utils = { path = "../net-utils", version = "=1.10.41" }
solana-perf = { path = "../perf", version = "=1.10.41" }
solana-sdk = { path = "../sdk", version = "=1.10.41" }
solana-streamer = { path = "../streamer", version = "=1.10.41" }
solana-version = { path = "../version", version = "=0.6.3" }
solana-version = { path = "../version", version = "=0.7.0" }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
2 changes: 1 addition & 1 deletion evm-utils/evm-block-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readme = "README.MD"
bincode = "1.3.3"
chrono = { version = "0.4.19", features = ["serde"] }
clap = { version = "4.3.21", features = ["derive"] }
clap_complete = "=4.0.7"
clap_complete = "=4.3.2"
dotenvy = "0.15.3"
env_logger = "0.10.0"
evm-rpc = { path = "../evm-rpc" }
Expand Down
4 changes: 2 additions & 2 deletions evm-utils/evm-block-recovery/src/routines/restore_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use {
extensions::NativeBlockExt,
ledger,
},
evm_rpc::{Hex, RPCTransaction},
evm_rpc::RPCTransaction,
evm_state::{Block, BlockHeader, TransactionInReceipt, H256},
serde_json::json,
solana_client::{rpc_client::RpcClient, rpc_request::RpcRequest},
Expand Down Expand Up @@ -297,7 +297,7 @@ async fn request_restored_block(
last_hashes: Vec<H256>,
block_header: BlockHeader,
state_root: H256,
) -> Result<(Block, Vec<Hex<H256>>), AppError> {
) -> Result<(Block, Vec<H256>), AppError> {
let unsigned_tx_fix = true;
let clear_logs_on_error = true;
let accept_zero_gas_price_with_native_fee = true;
Expand Down
Loading

0 comments on commit c934621

Please sign in to comment.