Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

perf: cache requests to the underlying fork provider #584

Closed
wants to merge 8 commits into from

Conversation

davidmurdoch
Copy link
Member

Based off #581

Copy link
Contributor

@nicholasjpaterno nicholasjpaterno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

this.forkBlockNumber = options.fork_block_number;
this.forkCacheSize = parseInt(options.fork_cache_size == null ? 10000 : options.fork_cache_size);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we default to 10000? I wonder if this should be opt in, though I don't suspect this will interfere with any current tests.

test/forking.js Outdated
provider.send(tx, (_, result) => {
const result2 = Object.assign({}, result, { id: null });
assert.deepStrictEqual(result2, result1);
assert.strictEqual(callCount, 1, "cache didn't work");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@coveralls
Copy link

coveralls commented Jun 17, 2020

Coverage Status

Coverage increased (+0.2%) to 82.358% when pulling 97d5711 on fubhy-develop into 94fdc56 on develop.

@davidmurdoch davidmurdoch changed the title Cache requests to the underlying fork provider perf: cache requests to the underlying fork provider Jun 19, 2020
@davidmurdoch davidmurdoch deleted the fubhy-develop branch September 30, 2020 16:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants