Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions rusk/src/lib/builder/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,14 @@ impl RuskNodeBuilder {
let archive = Archive::create_or_open(self.db_path.clone()).await;

let min_gas_limit = self.min_gas_limit.unwrap_or(DEFAULT_MIN_GAS_LIMIT);
let finality_activation = self
.vm_config
.feature(crate::node::FEATURE_ABI_PUBLIC_SENDER)
.unwrap_or(u64::MAX);
let chain_id = self.kadcast.kadcast_id.unwrap_or_default();

// New diff finality has been activated on mainnet from block 355_000
let finality_activation = if chain_id == 1 { 355_000 } else { 0 };

let rusk = Rusk::new(
self.state_dir,
self.kadcast.kadcast_id.unwrap_or_default(),
chain_id,
self.vm_config,
min_gas_limit,
self.feeder_call_gas,
Expand Down
1 change: 0 additions & 1 deletion rusk/src/lib/node/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use node_data::bls::PublicKey;
use node_data::ledger::{Block, Slash, SpentTransaction, Transaction};

use super::Rusk;
pub use config::feature::*;
pub use config::Config as RuskVmConfig;

impl VMExecution for Rusk {
Expand Down
11 changes: 1 addition & 10 deletions rusk/src/lib/node/vm/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ impl Default for Config {
}
}

pub(crate) mod feature {
pub const FEATURE_ABI_PUBLIC_SENDER: &str = "ABI_PUBLIC_SENDER";
}

impl Config {
pub fn new() -> Self {
Self {
Expand Down Expand Up @@ -118,16 +114,11 @@ impl Config {
}

/// Create a new `Config` with the given parameters.
pub fn to_execution_config(&self, block_height: u64) -> ExecutionConfig {
let with_public_sender: bool = self
.feature(feature::FEATURE_ABI_PUBLIC_SENDER)
.map(|activation| block_height >= activation)
.unwrap_or_default();
pub fn to_execution_config(&self, _block_height: u64) -> ExecutionConfig {
ExecutionConfig {
gas_per_deploy_byte: self.gas_per_deploy_byte,
min_deploy_points: self.min_deploy_points,
min_deploy_gas_price: self.min_deployment_gas_price,
with_public_sender,
}
}

Expand Down
15 changes: 7 additions & 8 deletions vm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ pub fn execute(
// with gas limit smaller than deploy charge.
deploy_check(tx, config)?;

if config.with_public_sender {
let _ = session
.set_meta(Metadata::PUBLIC_SENDER, tx.moonlight_sender().copied());
}
inject_session(session, config);

// Spend the inputs and execute the call. If this errors the transaction is
// unspendable.
Expand Down Expand Up @@ -115,10 +112,12 @@ pub fn execute(
Ok(receipt)
}

fn clear_session(session: &mut Session, config: &Config) {
if config.with_public_sender {
let _ = session.remove_meta(Metadata::PUBLIC_SENDER);
}
fn inject_session(session: &mut Session, _config: &Config) {
let _ = session.remove_meta(Metadata::PUBLIC_SENDER);
}

fn clear_session(session: &mut Session, _config: &Config) {
let _ = session.remove_meta(Metadata::PUBLIC_SENDER);
}

fn deploy_check(tx: &Transaction, config: &Config) -> Result<(), Error> {
Expand Down
5 changes: 0 additions & 5 deletions vm/src/execute/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ pub struct Config {
pub min_deploy_points: u64,
/// The minimum gas price set for a contract deployment
pub min_deploy_gas_price: u64,
/// Enable the public sender metadata in the transaction.
///
/// This field may be deprecated after the feature rollout.
pub with_public_sender: bool,
}

impl Default for Config {
Expand All @@ -32,6 +28,5 @@ impl Config {
gas_per_deploy_byte: 0,
min_deploy_points: 0,
min_deploy_gas_price: 0,
with_public_sender: false,
};
}
Loading