mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-06-20 10:21:05 +00:00
Allow for the consensus to be specified for the revive dev node
This commit is contained in:
@@ -680,6 +680,14 @@ pub struct ReviveDevNodeConfiguration {
|
|||||||
value_parser = parse_duration
|
value_parser = parse_duration
|
||||||
)]
|
)]
|
||||||
pub start_timeout_ms: Duration,
|
pub start_timeout_ms: Duration,
|
||||||
|
|
||||||
|
/// The consensus to use for the spawned revive-dev-node.
|
||||||
|
#[clap(
|
||||||
|
id = "revive-dev-node.consensus",
|
||||||
|
long = "revive-dev-node.consensus",
|
||||||
|
default_value = "instant-seal"
|
||||||
|
)]
|
||||||
|
pub consensus: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A set of configuration parameters for the ETH RPC.
|
/// A set of configuration parameters for the ETH RPC.
|
||||||
|
|||||||
+14
-6
@@ -184,6 +184,7 @@ impl Platform for KitchensinkPolkavmResolcPlatform {
|
|||||||
let node = SubstrateNode::new(
|
let node = SubstrateNode::new(
|
||||||
kitchensink_path,
|
kitchensink_path,
|
||||||
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
None,
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
let node = spawn_node(node, genesis)?;
|
let node = spawn_node(node, genesis)?;
|
||||||
@@ -236,6 +237,7 @@ impl Platform for KitchensinkRevmSolcPlatform {
|
|||||||
let node = SubstrateNode::new(
|
let node = SubstrateNode::new(
|
||||||
kitchensink_path,
|
kitchensink_path,
|
||||||
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
None,
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
let node = spawn_node(node, genesis)?;
|
let node = spawn_node(node, genesis)?;
|
||||||
@@ -280,14 +282,17 @@ impl Platform for ReviveDevNodePolkavmResolcPlatform {
|
|||||||
context: Context,
|
context: Context,
|
||||||
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
||||||
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
||||||
let revive_dev_node_path = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context)
|
let revive_dev_node_configuration = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context);
|
||||||
.path
|
|
||||||
.clone();
|
let revive_dev_node_path = revive_dev_node_configuration.path.clone();
|
||||||
|
let revive_dev_node_consensus = revive_dev_node_configuration.consensus.clone();
|
||||||
|
|
||||||
let genesis = genesis_configuration.genesis()?.clone();
|
let genesis = genesis_configuration.genesis()?.clone();
|
||||||
Ok(thread::spawn(move || {
|
Ok(thread::spawn(move || {
|
||||||
let node = SubstrateNode::new(
|
let node = SubstrateNode::new(
|
||||||
revive_dev_node_path,
|
revive_dev_node_path,
|
||||||
SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
Some(revive_dev_node_consensus),
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
let node = spawn_node(node, genesis)?;
|
let node = spawn_node(node, genesis)?;
|
||||||
@@ -332,14 +337,17 @@ impl Platform for ReviveDevNodeRevmSolcPlatform {
|
|||||||
context: Context,
|
context: Context,
|
||||||
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
) -> anyhow::Result<JoinHandle<anyhow::Result<Box<dyn EthereumNode + Send + Sync>>>> {
|
||||||
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
let genesis_configuration = AsRef::<GenesisConfiguration>::as_ref(&context);
|
||||||
let revive_dev_node_path = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context)
|
let revive_dev_node_configuration = AsRef::<ReviveDevNodeConfiguration>::as_ref(&context);
|
||||||
.path
|
|
||||||
.clone();
|
let revive_dev_node_path = revive_dev_node_configuration.path.clone();
|
||||||
|
let revive_dev_node_consensus = revive_dev_node_configuration.consensus.clone();
|
||||||
|
|
||||||
let genesis = genesis_configuration.genesis()?.clone();
|
let genesis = genesis_configuration.genesis()?.clone();
|
||||||
Ok(thread::spawn(move || {
|
Ok(thread::spawn(move || {
|
||||||
let node = SubstrateNode::new(
|
let node = SubstrateNode::new(
|
||||||
revive_dev_node_path,
|
revive_dev_node_path,
|
||||||
SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::REVIVE_DEV_NODE_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
Some(revive_dev_node_consensus),
|
||||||
context,
|
context,
|
||||||
);
|
);
|
||||||
let node = spawn_node(node, genesis)?;
|
let node = spawn_node(node, genesis)?;
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ pub struct SubstrateNode {
|
|||||||
wallet: Arc<EthereumWallet>,
|
wallet: Arc<EthereumWallet>,
|
||||||
nonce_manager: CachedNonceManager,
|
nonce_manager: CachedNonceManager,
|
||||||
provider: OnceCell<ConcreteProvider<ReviveNetwork, Arc<EthereumWallet>>>,
|
provider: OnceCell<ConcreteProvider<ReviveNetwork, Arc<EthereumWallet>>>,
|
||||||
|
consensus: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SubstrateNode {
|
impl SubstrateNode {
|
||||||
@@ -103,6 +104,7 @@ impl SubstrateNode {
|
|||||||
pub fn new(
|
pub fn new(
|
||||||
node_path: PathBuf,
|
node_path: PathBuf,
|
||||||
export_chainspec_command: &str,
|
export_chainspec_command: &str,
|
||||||
|
consensus: Option<String>,
|
||||||
context: impl AsRef<WorkingDirectoryConfiguration>
|
context: impl AsRef<WorkingDirectoryConfiguration>
|
||||||
+ AsRef<EthRpcConfiguration>
|
+ AsRef<EthRpcConfiguration>
|
||||||
+ AsRef<WalletConfiguration>,
|
+ AsRef<WalletConfiguration>,
|
||||||
@@ -132,6 +134,7 @@ impl SubstrateNode {
|
|||||||
wallet: wallet.clone(),
|
wallet: wallet.clone(),
|
||||||
nonce_manager: Default::default(),
|
nonce_manager: Default::default(),
|
||||||
provider: Default::default(),
|
provider: Default::default(),
|
||||||
|
consensus,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +232,7 @@ impl SubstrateNode {
|
|||||||
self.logs_directory.as_path(),
|
self.logs_directory.as_path(),
|
||||||
self.node_binary.as_path(),
|
self.node_binary.as_path(),
|
||||||
|command, stdout_file, stderr_file| {
|
|command, stdout_file, stderr_file| {
|
||||||
command
|
let cmd = command
|
||||||
.arg("--dev")
|
.arg("--dev")
|
||||||
.arg("--chain")
|
.arg("--chain")
|
||||||
.arg(chainspec_path)
|
.arg(chainspec_path)
|
||||||
@@ -246,8 +249,6 @@ impl SubstrateNode {
|
|||||||
.arg("all")
|
.arg("all")
|
||||||
.arg("--rpc-max-connections")
|
.arg("--rpc-max-connections")
|
||||||
.arg(u32::MAX.to_string())
|
.arg(u32::MAX.to_string())
|
||||||
.arg("--consensus")
|
|
||||||
.arg("manual-seal-12000")
|
|
||||||
.arg("--pool-limit")
|
.arg("--pool-limit")
|
||||||
.arg(u32::MAX.to_string())
|
.arg(u32::MAX.to_string())
|
||||||
.arg("--pool-kbytes")
|
.arg("--pool-kbytes")
|
||||||
@@ -255,6 +256,9 @@ impl SubstrateNode {
|
|||||||
.env("RUST_LOG", Self::SUBSTRATE_LOG_ENV)
|
.env("RUST_LOG", Self::SUBSTRATE_LOG_ENV)
|
||||||
.stdout(stdout_file)
|
.stdout(stdout_file)
|
||||||
.stderr(stderr_file);
|
.stderr(stderr_file);
|
||||||
|
if let Some(consensus) = self.consensus.as_ref() {
|
||||||
|
cmd.arg("--consensus").arg(consensus.clone());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ProcessReadinessWaitBehavior::TimeBoundedWaitFunction {
|
ProcessReadinessWaitBehavior::TimeBoundedWaitFunction {
|
||||||
max_wait_duration: Duration::from_secs(30),
|
max_wait_duration: Duration::from_secs(30),
|
||||||
@@ -1186,6 +1190,7 @@ mod tests {
|
|||||||
let mut node = SubstrateNode::new(
|
let mut node = SubstrateNode::new(
|
||||||
context.kitchensink_configuration.path.clone(),
|
context.kitchensink_configuration.path.clone(),
|
||||||
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
None,
|
||||||
&context,
|
&context,
|
||||||
);
|
);
|
||||||
node.init(context.genesis_configuration.genesis().unwrap().clone())
|
node.init(context.genesis_configuration.genesis().unwrap().clone())
|
||||||
@@ -1251,6 +1256,7 @@ mod tests {
|
|||||||
let mut dummy_node = SubstrateNode::new(
|
let mut dummy_node = SubstrateNode::new(
|
||||||
context.kitchensink_configuration.path.clone(),
|
context.kitchensink_configuration.path.clone(),
|
||||||
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
None,
|
||||||
&context,
|
&context,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1303,6 +1309,7 @@ mod tests {
|
|||||||
let node = SubstrateNode::new(
|
let node = SubstrateNode::new(
|
||||||
context.kitchensink_configuration.path.clone(),
|
context.kitchensink_configuration.path.clone(),
|
||||||
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
SubstrateNode::KITCHENSINK_EXPORT_CHAINSPEC_COMMAND,
|
||||||
|
None,
|
||||||
&context,
|
&context,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,10 @@ impl ZombienetNode {
|
|||||||
.with_name("Collator")
|
.with_name("Collator")
|
||||||
.with_command(polkadot_parachain_path)
|
.with_command(polkadot_parachain_path)
|
||||||
.with_rpc_port(node_rpc_port)
|
.with_rpc_port(node_rpc_port)
|
||||||
|
.with_args(vec![
|
||||||
|
("--pool-limit", u32::MAX.to_string().as_str()).into(),
|
||||||
|
("--pool-kbytes", u32::MAX.to_string().as_str()).into(),
|
||||||
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
Reference in New Issue
Block a user