Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable receipt prefetching by default #7661

Merged
merged 2 commits into from
Sep 23, 2022
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
* A `[path, data]` JSON RPC query format has been removed. It has been
deprecated for over two years and not documented anywhere. Use proper
structured queries with `rquest_type` set instead.
* Enable receipt prefetching by default. This feature makes receipt processing
faster by parallelizing IO requests, which has been introduced in
[#7590](https://github.com/near/nearcore/pull/7590) and enabled by default
with [#7661](https://github.com/near/nearcore/pull/7661).
Configurable in `config.json` using `store.enable_receipt_prefetching`.

## 1.28.0 [2022-07-27]

Expand Down
2 changes: 1 addition & 1 deletion core/store/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Default for StoreConfig {
block_size: bytesize::ByteSize::kib(16),

trie_cache_capacities: vec![(ShardUId { version: 1, shard_id: 3 }, 45_000_000)],
enable_receipt_prefetching: false,
enable_receipt_prefetching: true,
jakmeier marked this conversation as resolved.
Show resolved Hide resolved
sweat_prefetch_receivers: vec![
"token.sweat".to_owned(),
"vfinal.token.sweat.testnet".to_owned(),
Expand Down
12 changes: 11 additions & 1 deletion runtime/runtime-params-estimator/src/testbed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ impl RuntimeTestbed {
StateDump::from_dir(dump_dir, workdir.path(), in_memory_db);
// Ensure decent RocksDB SST file layout.
store.compact().expect("compaction failed");
let tries = ShardTries::test(store, 1);

// Create ShardTries with relevant settings adjusted for estimator.
let shard_uids = [ShardUId { shard_id: 0, version: 0 }];
let mut trie_config = near_store::TrieConfig::default();
trie_config.enable_receipt_prefetching = true;
let tries = ShardTries::new(
store.clone(),
trie_config,
&shard_uids,
near_store::flat_state::FlatStateFactory::new(store.clone()),
);

assert!(roots.len() <= 1, "Parameter estimation works with one shard only.");
assert!(!roots.is_empty(), "No state roots found.");
Expand Down