Skip to content

Commit 11dfceb

Browse files
committed
Merge remote-tracking branch 'pha/master' into frontier
2 parents 1038129 + e4dac85 commit 11dfceb

File tree

9 files changed

+34
-56
lines changed

9 files changed

+34
-56
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/src/fullstack.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ const quickMode = process.env.QUICK == '1';
3232
let keyring;
3333

3434
const CENTS = 10_000_000_000;
35-
const blockInterval = quickMode ? 100 : 1000;
35+
const blockInterval = quickMode ? 100 : 300; // ms
36+
const gossipDuration = 20; // ms
3637

3738
console.log(`Testing in ${inSgx ? "SGX Hardware" : "Software"} mode`);
3839

@@ -1369,8 +1370,6 @@ class Cluster {
13691370
await this._reservePorts();
13701371
this._createProcesses();
13711372
await this._launchAndWait();
1372-
await this._createApi();
1373-
await this._transferPherryGasFree();
13741373
}
13751374

13761375
async kill() {
@@ -1498,6 +1497,8 @@ class Cluster {
14981497
waitNodeOutput(this.processNode),
14991498
...this.workers.map(w => waitPRuntimeOutput(w.processPRuntime)),
15001499
]);
1500+
await this._createApi();
1501+
await this._transferPherryGasFree();
15011502
// Launch relayers
15021503
await Promise.all(this.workers.map(w => waitRelayerOutput(w.processRelayer)));
15031504
}
@@ -1542,6 +1543,7 @@ function newNode(rpcPort, tmpPath, name = 'node') {
15421543
pathNode, [
15431544
'--dev',
15441545
`--block-millisecs=${blockInterval}`,
1546+
`--gossip-duration-millisecs=${gossipDuration}`,
15451547
'--base-path=' + path.resolve(tmpPath, 'phala-node'),
15461548
`--rpc-port=${rpcPort}`,
15471549
'--rpc-methods=Unsafe',

standalone/node/src/chain_spec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ pub(crate) mod tests {
597597
sync,
598598
transaction_pool,
599599
..
600-
} = new_full_base(config, Default::default(), false)?;
600+
} = new_full_base(config, Default::default(), false, None)?;
601601
Ok(sc_service_test::TestNetComponents::new(
602602
task_manager,
603603
client,

standalone/node/src/cli.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ pub struct Cli {
4343
#[arg(long)]
4444
pub block_millisecs: Option<u64>,
4545

46+
/// Custom gossip duration in milliseconds.
47+
#[arg(long)]
48+
pub gossip_duration_millisecs: Option<u64>,
49+
4650
/// Ethereum RPC configuration.
4751
#[command(flatten)]
4852
pub eth: EthConfiguration,

standalone/node/src/command.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,14 @@ pub fn run() -> sc_cli::Result<()> {
9393
None => {
9494
let runner = cli.create_runner(&cli.run)?;
9595
runner.run_node_until_exit(|config| async move {
96-
service::new_full(config, &cli.eth, cli.no_hardware_benchmarks)
97-
.await
98-
.map_err(sc_cli::Error::Service)
96+
service::new_full(
97+
config,
98+
&cli.eth,
99+
cli.no_hardware_benchmarks,
100+
cli.gossip_duration_millisecs,
101+
)
102+
.await
103+
.map_err(sc_cli::Error::Service)
99104
})
100105
}
101106
Some(Subcommand::Inspect(cmd)) => {

standalone/node/src/service.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ pub async fn new_full_base(
341341
config: Configuration,
342342
eth_config: &EthConfiguration,
343343
disable_hardware_benchmarks: bool,
344+
gossip_duration_millis: Option<u64>,
344345
) -> Result<NewFullBase, ServiceError> {
345346
let hwbench = if !disable_hardware_benchmarks {
346347
config.database.path().map(|database_path| {
@@ -660,7 +661,7 @@ pub async fn new_full_base(
660661

661662
let grandpa_config = grandpa::Config {
662663
// FIXME #1578 make this available through chainspec
663-
gossip_duration: std::time::Duration::from_millis(333),
664+
gossip_duration: std::time::Duration::from_millis(gossip_duration_millis.unwrap_or(333)),
664665
justification_generation_period: 1, // https://github.com/paritytech/substrate/pull/14423#issuecomment-1633837906
665666
name: Some(name),
666667
observer_enabled: false,
@@ -736,10 +737,16 @@ pub async fn new_full(
736737
config: Configuration,
737738
eth_config: &EthConfiguration,
738739
disable_hardware_benchmarks: bool,
740+
gossip_duration_millis: Option<u64>,
739741
) -> Result<TaskManager, ServiceError> {
740-
new_full_base(config, eth_config, disable_hardware_benchmarks)
741-
.await
742-
.map(|NewFullBase { task_manager, .. }| task_manager)
742+
new_full_base(
743+
config,
744+
eth_config,
745+
disable_hardware_benchmarks,
746+
gossip_duration_millis,
747+
)
748+
.await
749+
.map(|NewFullBase { task_manager, .. }| task_manager)
743750
}
744751

745752
/// Build the import queue for the runtime (babe + grandpa).

standalone/prouter/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone/pruntime/Cargo.lock

Lines changed: 1 addition & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone/runtime/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ impl OnUnbalanced<NegativeImbalance> for DealWithServiceFee {
15741574

15751575
parameter_types! {
15761576
pub EIP712Name: Vec<u8> = b"PhalaNetwork".to_vec();
1577-
pub EIP712Version: Vec<u8> = b"1".to_vec();
1577+
pub EIP712Version: Vec<u8> = b"2".to_vec();
15781578
pub EIP712ChainID: pallet_evm_account_mapping::EIP712ChainID = sp_core::U256::from(0);
15791579
pub EIP712VerifyingContractAddress: pallet_evm_account_mapping::EIP712VerifyingContractAddress = sp_core::H160::from([0u8; 20]);
15801580
}
@@ -1583,6 +1583,7 @@ impl pallet_evm_account_mapping::Config for Runtime {
15831583
type RuntimeEvent = RuntimeEvent;
15841584
type RuntimeCall = RuntimeCall;
15851585
type Currency = Balances;
1586+
type AddressConverter = pallet_evm_account_mapping::EvmTransparentConverter;
15861587
type ServiceFee = ConstU128<10000000000>; // 0.01 PHA
15871588
type OnUnbalancedForServiceFee = DealWithServiceFee;
15881589
type CallFilter = frame_support::traits::Everything;

0 commit comments

Comments
 (0)