Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab37149
enable target_a and _b syncing for sidechain mode and prepare new dem…
brenzi Nov 23, 2023
2ae982d
add shard vault proxy account on target A/B as well. derivation is de…
brenzi Nov 23, 2023
d62b26d
prepare event listener on target A and fix demoscript
brenzi Nov 23, 2023
d9bff04
remove old enclave_bridge unshield call from trusted_call
brenzi Nov 23, 2023
e9c408c
abstracting parentchain effect opaque_calls. stf can send to any pare…
brenzi Nov 23, 2023
ff686b6
sending stf extrinsics to all parentchains now
brenzi Nov 24, 2023
ec5918e
WIP: triggering block import of target_a and b upon sidechain on_slot
brenzi Nov 24, 2023
42b10e7
refactored aura to trigger target_a and target_b import
brenzi Nov 25, 2023
2f12d4b
shielding from target_a worked
brenzi Nov 25, 2023
a62dc20
demo passes first and second rungit add -u!
brenzi Nov 25, 2023
3c5cafc
log cosmetics
brenzi Nov 26, 2023
72f2849
generic event display (fails). log cosmetics
brenzi Nov 27, 2023
30c1ef5
hack the fees. and more pimps
brenzi Nov 27, 2023
c46c67b
recorded demo with this
brenzi Nov 27, 2023
90cb372
fixed cargo test
brenzi Nov 28, 2023
6d97c2a
clippy
brenzi Nov 28, 2023
c47a9c5
fixed enclave tests
brenzi Nov 28, 2023
6eacfd7
cleanup
brenzi Nov 28, 2023
886af3b
Merge branch 'master' into ab/target-a-shielding-unshielding-sidechai…
brenzi Nov 28, 2023
b16439c
fix CI
brenzi Nov 28, 2023
2ea0472
CI: introduce fee tolerance when assering balances
brenzi Nov 28, 2023
13c20f3
fix evm tests
brenzi Nov 28, 2023
20b7468
fix
brenzi Nov 28, 2023
83ee1aa
clippy with test flag
brenzi Nov 28, 2023
39a3147
fix demo_sidechain with fee tolerance
brenzi Nov 28, 2023
a70685d
CI fixes
brenzi Nov 28, 2023
b75036e
review remarks fixed
brenzi Nov 29, 2023
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
Prev Previous commit
Next Next commit
CI fixes
  • Loading branch information
brenzi committed Nov 28, 2023
commit a70685dcc13c869bb1df6d12a3506a75fd9e39de
1 change: 0 additions & 1 deletion cli/demo_sidechain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ ALICE_EXPECTED_BALANCE=$(( 1 * UNIT ))
BOB_EXPECTED_BALANCE=$(( 4 * UNIT ))

echo "* Verifying Alice's balance"
if [ "$ALICE_BALANCE" -ne "$ALICE_EXPECTED_BALANCE" ]; then
if (( ALICE_BALANCE >= ALICE_EXPECTED_BALANCE ? ALICE_BALANCE - ALICE_EXPECTED_BALANCE > FEE_TOLERANCE : ALICE_EXPECTED_BALANCE - ALICE_BALANCE > FEE_TOLERANCE)); then
echo "Alice's balance is wrong (expected: $ALICE_EXPECTED_BALANCE, actual: $ALICE_BALANCE), tolerance = $FEE_TOLERANCE"
exit 1
Expand Down
11 changes: 5 additions & 6 deletions cli/src/benchmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{
};
use codec::Decode;
use hdrhistogram::Histogram;
use ita_stf::{Getter, Index, TrustedCall, TrustedCallSigned, TrustedGetter};
use ita_stf::{Getter, Index, TrustedCall, TrustedCallSigned, TrustedGetter, STF_TX_FEE};
use itc_rpc_client::direct_client::{DirectApi, DirectClient};
use itp_stf_primitives::{
traits::TrustedCallSigning,
Expand Down Expand Up @@ -66,7 +66,7 @@ pub struct BenchmarkCommand {

/// The number of iterations to execute for each client
#[clap(default_value_t = 30)]
number_iterations: u32,
number_iterations: u128,

/// Adds a random wait before each transaction. This is the lower bound for the interval in ms.
#[clap(default_value_t = 0)]
Expand Down Expand Up @@ -138,16 +138,15 @@ impl BenchmarkCommand {
println!("Nonce for account {}: {}", self.funding_account, nonce_start);

let mut accounts = Vec::new();

let initial_balance = (self.number_iterations + 1) * (STF_TX_FEE + EXISTENTIAL_DEPOSIT);
// Setup new accounts and initialize them with money from Alice.
for i in 0..self.number_clients {
let nonce = i + nonce_start;
println!("Initializing account {}", i);
println!("Initializing account {} with initial amount {:?}", i, initial_balance);

// Create new account to use.
let a = LocalKeystore::sr25519_generate_new(&store, SR25519_KEY_TYPE, None).unwrap();
let account = get_pair_from_str(trusted_args, a.to_string().as_str());
let initial_balance = 10000000;

// Transfer amount from Alice to new account.
let top: TrustedOperation<TrustedCallSigned, Getter> = TrustedCall::balance_transfer(
Expand Down Expand Up @@ -233,7 +232,7 @@ impl BenchmarkCommand {
output.push(result);

// FIXME: We probably should re-fund the account in this case.
if client.current_balance <= EXISTENTIAL_DEPOSIT {
if client.current_balance <= EXISTENTIAL_DEPOSIT + STF_TX_FEE {
error!("Account {:?} does not have enough balance anymore. Finishing benchmark early", client.account.public());
break;
}
Expand Down
1 change: 1 addition & 0 deletions cli/src/trusted_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,6 @@ fn connection_can_be_closed(top_status: TrustedOperationStatus) -> bool {
| TrustedOperationStatus::Future
| TrustedOperationStatus::Ready
| TrustedOperationStatus::Broadcast
| TrustedOperationStatus::Invalid
)
}