From ec7065380a33aa17301401c86327285c6e15c0a9 Mon Sep 17 00:00:00 2001 From: Eason Date: Sun, 8 Oct 2023 17:16:08 +0800 Subject: [PATCH] remove useless code --- Cargo.lock | 1 + .../contracts/metadata/Metadata.sol | 1 - core/executor/Cargo.toml | 1 + core/executor/src/precompiles/metadata.rs | 75 ------------------- core/executor/src/precompiles/mod.rs | 1 - .../metadata/abi/metadata_abi.json | 10 --- .../metadata/abi/metadata_abi.rs | 23 +++--- .../src/system_contract/metadata/abi/mod.rs | 2 - .../src/tests/system_script/metadata.rs | 3 +- protocol/src/types/block.rs | 1 - protocol/src/types/primitive.rs | 2 - 11 files changed, 15 insertions(+), 105 deletions(-) delete mode 100644 core/executor/src/precompiles/metadata.rs diff --git a/Cargo.lock b/Cargo.lock index 7a2a42583..29f24e46a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1746,6 +1746,7 @@ dependencies = [ "core-rpc-client", "core-storage", "criterion", + "env_logger", "ethabi 18.0.0", "ethabi-contract", "ethabi-derive", diff --git a/builtin-contract/system-contract/contracts/metadata/Metadata.sol b/builtin-contract/system-contract/contracts/metadata/Metadata.sol index 0432713df..dd9284729 100644 --- a/builtin-contract/system-contract/contracts/metadata/Metadata.sol +++ b/builtin-contract/system-contract/contracts/metadata/Metadata.sol @@ -37,7 +37,6 @@ library MetadataType { uint64 tx_num_limit; uint64 max_tx_size; uint64 gas_limit; - uint64 gas_price; uint64 interval; } diff --git a/core/executor/Cargo.toml b/core/executor/Cargo.toml index b98bb0e56..755a90cb8 100644 --- a/core/executor/Cargo.toml +++ b/core/executor/Cargo.toml @@ -42,6 +42,7 @@ common-crypto = { path = "../../common/crypto" } core-rpc-client = { path = "../rpc-client" } core-storage = { path = "../storage" } criterion = "0.5" +env_logger = "0.10" ethabi = "18.0" ethabi-contract = { git = "https://github.com/rust-ethereum/ethabi.git", rev = "7edf185" } ethabi-derive = { git = "https://github.com/rust-ethereum/ethabi.git", rev = "7edf185" } diff --git a/core/executor/src/precompiles/metadata.rs b/core/executor/src/precompiles/metadata.rs deleted file mode 100644 index 95d46b53a..000000000 --- a/core/executor/src/precompiles/metadata.rs +++ /dev/null @@ -1,75 +0,0 @@ -use evm::executor::stack::{PrecompileFailure, PrecompileOutput}; -use evm::{Context, ExitError, ExitSucceed}; - -use protocol::types::H160; - -use crate::precompiles::{axon_precompile_address, PrecompileContract}; -use crate::{err, system_contract::metadata::MetadataHandle, CURRENT_METADATA_ROOT}; - -const INPUT_LEN: usize = 1 + 8; - -/// The input argument must includes 9 bytes schema: -/// input[0]: an u8 on behalf of the call type. 0u8 means get metadata by block -/// number and 1u8 means get metadata by epoch number. -/// input[1..9]: 8 bytes of a **little endian** u64 value. If call type is 0u8, -/// it means a block number. If call type is 1u8, it means a epoch number. -#[derive(Default, Clone)] -pub struct Metadata; - -impl PrecompileContract for Metadata { - const ADDRESS: H160 = axon_precompile_address(0x01); - const MIN_GAS: u64 = 500; - - fn exec_fn( - input: &[u8], - gas_limit: Option, - _context: &Context, - _is_static: bool, - ) -> Result<(PrecompileOutput, u64), PrecompileFailure> { - if let Some(gas) = gas_limit { - if let Some(limit) = gas_limit { - if limit < gas { - return err!(); - } - } - - let (ty, number) = parse_input(input)?; - let root = CURRENT_METADATA_ROOT.with(|r| *r.borrow()); - - let metadata = match ty { - 0u8 => MetadataHandle::new(root) - .get_metadata_by_block_number(number) - .map_err(|e| err!(_, e.to_string()))?, - 1u8 => MetadataHandle::new(root) - .get_metadata_by_epoch(number) - .map_err(|e| err!(_, e.to_string()))?, - _ => return err!("Invalid call type"), - }; - - return Ok(( - PrecompileOutput { - exit_status: ExitSucceed::Returned, - output: rlp::encode(&metadata).to_vec(), - }, - Self::MIN_GAS, - )); - } - - err!() - } - - fn gas_cost(_input: &[u8]) -> u64 { - Self::MIN_GAS - } -} - -fn parse_input(input: &[u8]) -> Result<(u8, u64), PrecompileFailure> { - if input.len() != INPUT_LEN { - return err!("Invalid input length"); - } - - let mut buf = [0u8; 8]; - buf.copy_from_slice(&input[1..]); - - Ok((input[0], u64::from_le_bytes(buf))) -} diff --git a/core/executor/src/precompiles/mod.rs b/core/executor/src/precompiles/mod.rs index 53a324762..beedf1fa2 100644 --- a/core/executor/src/precompiles/mod.rs +++ b/core/executor/src/precompiles/mod.rs @@ -7,7 +7,6 @@ mod ecrecover; mod get_cell; mod get_header; mod identity; -mod metadata; mod modexp; mod ripemd160; mod rsa; diff --git a/core/executor/src/system_contract/metadata/abi/metadata_abi.json b/core/executor/src/system_contract/metadata/abi/metadata_abi.json index 2d635c31e..009d7c767 100644 --- a/core/executor/src/system_contract/metadata/abi/metadata_abi.json +++ b/core/executor/src/system_contract/metadata/abi/metadata_abi.json @@ -111,11 +111,6 @@ "name": "gas_limit", "type": "uint64" }, - { - "internalType": "uint64", - "name": "gas_price", - "type": "uint64" - }, { "internalType": "uint64", "name": "interval", @@ -221,11 +216,6 @@ "name": "gas_limit", "type": "uint64" }, - { - "internalType": "uint64", - "name": "gas_price", - "type": "uint64" - }, { "internalType": "uint64", "name": "interval", diff --git a/core/executor/src/system_contract/metadata/abi/metadata_abi.rs b/core/executor/src/system_contract/metadata/abi/metadata_abi.rs index acae469ed..48b1c95cf 100644 --- a/core/executor/src/system_contract/metadata/abi/metadata_abi.rs +++ b/core/executor/src/system_contract/metadata/abi/metadata_abi.rs @@ -11,7 +11,7 @@ pub use metadata_contract::*; )] pub mod metadata_contract { #[rustfmt::skip] - const __ABI: &str = "[\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"start\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"end\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.MetadataVersion\",\n \"name\": \"version\",\n \"type\": \"tuple\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"epoch\",\n \"type\": \"uint64\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"bytes\",\n \"name\": \"bls_pub_key\",\n \"type\": \"bytes\"\n },\n {\n \"internalType\": \"bytes\",\n \"name\": \"pub_key\",\n \"type\": \"bytes\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"address_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint32\",\n \"name\": \"propose_weight\",\n \"type\": \"uint32\"\n },\n {\n \"internalType\": \"uint32\",\n \"name\": \"vote_weight\",\n \"type\": \"uint32\"\n }\n ],\n \"internalType\": \"struct MetadataType.ValidatorExtend[]\",\n \"name\": \"verifier_list\",\n \"type\": \"tuple[]\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"address\",\n \"name\": \"address_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"count\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ProposeCount[]\",\n \"name\": \"propose_counter\",\n \"type\": \"tuple[]\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"propose_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"prevote_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"precommit_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"brake_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"tx_num_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"max_tx_size\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_price\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"interval\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ConsensusConfig\",\n \"name\": \"consensus_config\",\n \"type\": \"tuple\"\n }\n ],\n \"internalType\": \"struct MetadataType.Metadata\",\n \"name\": \"metadata\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"appendMetadata\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"internalType\": \"bytes32\",\n \"name\": \"metadata_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"checkpoint_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"xudt_args\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"stake_smt_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"delegate_smt_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"reward_smt_type_id\",\n \"type\": \"bytes32\"\n }\n ],\n \"internalType\": \"struct MetadataType.CkbRelatedInfo\",\n \"name\": \"info\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"setCkbRelatedInfo\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"propose_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"prevote_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"precommit_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"brake_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"tx_num_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"max_tx_size\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_price\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"interval\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ConsensusConfig\",\n \"name\": \"config\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"updateConsensusConfig\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n }\n]\n"; + const __ABI: &str = "[\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"start\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"end\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.MetadataVersion\",\n \"name\": \"version\",\n \"type\": \"tuple\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"epoch\",\n \"type\": \"uint64\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"bytes\",\n \"name\": \"bls_pub_key\",\n \"type\": \"bytes\"\n },\n {\n \"internalType\": \"bytes\",\n \"name\": \"pub_key\",\n \"type\": \"bytes\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"address_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint32\",\n \"name\": \"propose_weight\",\n \"type\": \"uint32\"\n },\n {\n \"internalType\": \"uint32\",\n \"name\": \"vote_weight\",\n \"type\": \"uint32\"\n }\n ],\n \"internalType\": \"struct MetadataType.ValidatorExtend[]\",\n \"name\": \"verifier_list\",\n \"type\": \"tuple[]\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"address\",\n \"name\": \"address_\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"count\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ProposeCount[]\",\n \"name\": \"propose_counter\",\n \"type\": \"tuple[]\"\n },\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"propose_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"prevote_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"precommit_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"brake_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"tx_num_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"max_tx_size\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"interval\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ConsensusConfig\",\n \"name\": \"consensus_config\",\n \"type\": \"tuple\"\n }\n ],\n \"internalType\": \"struct MetadataType.Metadata\",\n \"name\": \"metadata\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"appendMetadata\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"internalType\": \"bytes32\",\n \"name\": \"metadata_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"checkpoint_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"xudt_args\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"stake_smt_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"delegate_smt_type_id\",\n \"type\": \"bytes32\"\n },\n {\n \"internalType\": \"bytes32\",\n \"name\": \"reward_smt_type_id\",\n \"type\": \"bytes32\"\n }\n ],\n \"internalType\": \"struct MetadataType.CkbRelatedInfo\",\n \"name\": \"info\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"setCkbRelatedInfo\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"components\": [\n {\n \"internalType\": \"uint64\",\n \"name\": \"propose_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"prevote_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"precommit_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"brake_ratio\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"tx_num_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"max_tx_size\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"gas_limit\",\n \"type\": \"uint64\"\n },\n {\n \"internalType\": \"uint64\",\n \"name\": \"interval\",\n \"type\": \"uint64\"\n }\n ],\n \"internalType\": \"struct MetadataType.ConsensusConfig\",\n \"name\": \"config\",\n \"type\": \"tuple\"\n }\n ],\n \"name\": \"updateConsensusConfig\",\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n }\n]\n"; /// The parsed JSON ABI of the contract. pub static METADATACONTRACT_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = ::ethers::contract::Lazy::new(|| { @@ -57,13 +57,13 @@ pub mod metadata_contract { )) } - /// Calls the contract's `appendMetadata` (0x53ec79e6) function + /// Calls the contract's `appendMetadata` (0x4677ae59) function pub fn append_metadata( &self, metadata: Metadata, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([83, 236, 121, 230], (metadata,)) + .method_hash([70, 119, 174, 89], (metadata,)) .expect("method not found (this should never happen)") } @@ -77,13 +77,13 @@ pub mod metadata_contract { .expect("method not found (this should never happen)") } - /// Calls the contract's `updateConsensusConfig` (0xb76fac01) function + /// Calls the contract's `updateConsensusConfig` (0x3b05ee4f) function pub fn update_consensus_config( &self, config: ConsensusConfig, ) -> ::ethers::contract::builders::ContractCall { self.0 - .method_hash([183, 111, 172, 1], (config,)) + .method_hash([59, 5, 238, 79], (config,)) .expect("method not found (this should never happen)") } } @@ -98,7 +98,7 @@ pub mod metadata_contract { /// function with signature /// `appendMetadata(((uint64,uint64),uint64,(bytes,bytes,address,uint32, /// uint32)[],(address,uint64)[],(uint64,uint64,uint64,uint64,uint64,uint64, - /// uint64,uint64,uint64)))` and selector `0x53ec79e6` + /// uint64,uint64)))` and selector `0x4677ae59` #[derive( Clone, ::ethers::contract::EthCall, @@ -111,7 +111,7 @@ pub mod metadata_contract { )] #[ethcall( name = "appendMetadata", - abi = "appendMetadata(((uint64,uint64),uint64,(bytes,bytes,address,uint32,uint32)[],(address,uint64)[],(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)))" + abi = "appendMetadata(((uint64,uint64),uint64,(bytes,bytes,address,uint32,uint32)[],(address,uint64)[],(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)))" )] pub struct AppendMetadataCall { pub metadata: Metadata, @@ -140,7 +140,7 @@ pub mod metadata_contract { /// Container type for all input parameters for the `updateConsensusConfig` /// function with signature /// `updateConsensusConfig((uint64,uint64,uint64,uint64,uint64,uint64, - /// uint64,uint64,uint64))` and selector `0xb76fac01` + /// uint64,uint64))` and selector `0x3b05ee4f` #[derive( Clone, ::ethers::contract::EthCall, @@ -153,7 +153,7 @@ pub mod metadata_contract { )] #[ethcall( name = "updateConsensusConfig", - abi = "updateConsensusConfig((uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64))" + abi = "updateConsensusConfig((uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64))" )] pub struct UpdateConsensusConfigCall { pub config: ConsensusConfig, @@ -243,7 +243,7 @@ pub mod metadata_contract { pub reward_smt_type_id: [u8; 32], } /// `ConsensusConfig(uint64,uint64,uint64,uint64,uint64,uint64,uint64, - /// uint64,uint64)` + /// uint64)` #[derive( Clone, ::ethers::contract::EthAbiType, @@ -262,12 +262,11 @@ pub mod metadata_contract { pub tx_num_limit: u64, pub max_tx_size: u64, pub gas_limit: u64, - pub gas_price: u64, pub interval: u64, } /// `Metadata((uint64,uint64),uint64,(bytes,bytes,address,uint32,uint32)[], /// (address,uint64)[],(uint64,uint64,uint64,uint64,uint64,uint64,uint64, - /// uint64,uint64))` + /// uint64))` #[derive( Clone, ::ethers::contract::EthAbiType, diff --git a/core/executor/src/system_contract/metadata/abi/mod.rs b/core/executor/src/system_contract/metadata/abi/mod.rs index 1212fe9e2..b215b872c 100644 --- a/core/executor/src/system_contract/metadata/abi/mod.rs +++ b/core/executor/src/system_contract/metadata/abi/mod.rs @@ -42,7 +42,6 @@ impl From for metadata_abi::ConsensusConfig { tx_num_limit: value.tx_num_limit, max_tx_size: value.max_tx_size, gas_limit: value.gas_limit, - gas_price: value.gas_price, interval: value.interval, } } @@ -58,7 +57,6 @@ impl From for ConsensusConfig { tx_num_limit: value.tx_num_limit, max_tx_size: value.max_tx_size, gas_limit: value.gas_limit, - gas_price: value.gas_price, interval: value.interval, } } diff --git a/core/executor/src/tests/system_script/metadata.rs b/core/executor/src/tests/system_script/metadata.rs index d5ad4b715..d86384149 100644 --- a/core/executor/src/tests/system_script/metadata.rs +++ b/core/executor/src/tests/system_script/metadata.rs @@ -22,6 +22,7 @@ static ROCKSDB_PATH: &str = "./free-space/system-contract/metadata"; #[test] fn test_write_functions() { + env_logger::init(); let vicinity = gen_vicinity(); let mut backend = MemoryBackend::new(&vicinity, BTreeMap::new()); @@ -47,6 +48,7 @@ fn test_init<'a>(backend: &mut MemoryBackend<'a>, executor: &MetadataContract Metadata { propose_counter: vec![], consensus_config: ConsensusConfig { gas_limit: 1u64, - gas_price: 0u64, interval: 0u64, propose_ratio: 1u64, prevote_ratio: 1u64, diff --git a/protocol/src/types/block.rs b/protocol/src/types/block.rs index ab1236dbe..b4d284b5f 100644 --- a/protocol/src/types/block.rs +++ b/protocol/src/types/block.rs @@ -362,7 +362,6 @@ mod tests { }], consensus_config: ConsensusConfig { gas_limit: 4294967295, - gas_price: 1, interval: 3000, propose_ratio: 15, prevote_ratio: 10, diff --git a/protocol/src/types/primitive.rs b/protocol/src/types/primitive.rs index 9e510a126..e0c2df4d0 100644 --- a/protocol/src/types/primitive.rs +++ b/protocol/src/types/primitive.rs @@ -313,8 +313,6 @@ pub struct ConsensusConfig { #[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))] pub gas_limit: u64, #[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))] - pub gas_price: u64, - #[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))] pub interval: u64, #[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))] pub propose_ratio: u64,