Skip to content

Commit

Permalink
revert: stalehash extension (#2184)
Browse files Browse the repository at this point in the history
# Goal
The goal of this PR is <!-- insert goal here -->

Closes #2183 

Reverting #2137 


# Checklist
- [x] e2e Tests updated
- [X] Benchmarks updated
- [X] Spec version incremented?
  • Loading branch information
aramikm authored Oct 11, 2024
1 parent 37b9cdb commit 3931f20
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 324 deletions.
9 changes: 5 additions & 4 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions e2e/stateful-pallet-storage/handleItemized.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ describe('📗 Stateful Pallet Storage', function () {
add_actions,
0
);
await assert.rejects(itemized_add_result_1.signAndSend('current'), {
name: 'RpcError',
message: /1010: Invalid Transaction: Custom error: 9/,
});
await assert.rejects(itemized_add_result_1.fundAndSend(fundingSource), { name: 'StalePageState' });
});
});

Expand Down Expand Up @@ -288,10 +285,7 @@ describe('📗 Stateful Pallet Storage', function () {
};
const remove_actions = [remove_action];
const op = ExtrinsicHelper.applyItemActions(providerKeys, schemaId_deletable, msa_id, remove_actions, 0);
await assert.rejects(op.signAndSend('current'), {
name: 'RpcError',
message: /1010: Invalid Transaction: Custom error: 9/,
});
await assert.rejects(op.fundAndSend(fundingSource), { name: 'StalePageState' });
});
});

Expand Down
20 changes: 2 additions & 18 deletions e2e/stateful-pallet-storage/handlePaginated.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ describe('📗 Stateful Pallet Storage', function () {

const paginated_add_result_1 = ExtrinsicHelper.upsertPage(providerKeys, schemaId, msa_id, page_id, payload_1, 0);
await assert.rejects(paginated_add_result_1.signAndSend('current'), {
name: 'RpcError',
message: /1010: Invalid Transaction: Custom error: 9/,
message: 'Target page hash does not match current page hash',
name: 'StalePageState',
});
});
});
Expand Down Expand Up @@ -232,22 +232,6 @@ describe('📗 Stateful Pallet Storage', function () {
section: 'statefulStorage',
});
});

it('🛑 should fail call to remove page for un-delegated attempts', async function () {
const paginated_add_result_1 = ExtrinsicHelper.removePage(providerKeys, schemaId, badMsaId, 0, 0);
await assert.rejects(paginated_add_result_1.fundAndSend(fundingSource), {
name: 'UnauthorizedDelegate',
section: 'statefulStorage',
});
});

it('🛑 should fail call to remove page with stale target hash', async function () {
const paginated_add_result_1 = ExtrinsicHelper.removePage(providerKeys, schemaId, msa_id, 0, 1000);
await assert.rejects(paginated_add_result_1.signAndSend('current'), {
name: 'RpcError',
message: /1010: Invalid Transaction: Custom error: 9/,
});
});
});

describe('Paginated Storage RPC Tests', function () {
Expand Down
3 changes: 0 additions & 3 deletions node/cli/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use sp_core::{Encode, Pair};
use sp_keyring::Sr25519Keyring;
use sp_runtime::{OpaqueExtrinsic, SaturatedConversion};

use frequency_runtime::StaleHashCheckExtension;
use pallet_balances::Call as BalancesCall;
use pallet_msa;
use sp_inherents::InherentDataProvider;
Expand Down Expand Up @@ -133,7 +132,6 @@ pub fn create_benchmark_extrinsic(
pallet_frequency_tx_payment::ChargeFrqTransactionPayment::<runtime::Runtime>::from(0),
pallet_msa::CheckFreeExtrinsicUse::<runtime::Runtime>::new(),
pallet_handles::handles_signed_extension::HandlesSignedExtension::<runtime::Runtime>::new(),
StaleHashCheckExtension,
frame_metadata_hash_extension::CheckMetadataHash::<runtime::Runtime>::new(false),
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::<runtime::Runtime>::new(),
);
Expand All @@ -151,7 +149,6 @@ pub fn create_benchmark_extrinsic(
(),
(),
(),
(),
None,
(),
),
Expand Down
Loading

0 comments on commit 3931f20

Please sign in to comment.