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

Commit

Permalink
Only load transactions, blocks, and events from after the fork block (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsmale90 authored Feb 6, 2023
1 parent 2b4e426 commit 940de3e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/integrations/ethereum/common/redux/blocks/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ export const clearBlocksInView = function() {
};

export const requestPage = function(startBlockNumber, endBlockNumber) {
endBlockNumber = endBlockNumber || 0;
return function(dispatch, getState) {
if (startBlockNumber == null) {
startBlockNumber = getState().core.latestBlock;
}
if (endBlockNumber == null) {
const state = getState();
endBlockNumber = state.config.settings.workspace.server.fork
? state.config.settings.workspace.server.fork_block_number + 1
: 0;
}

let earliestBlockToRequest = Math.max(
startBlockNumber - PAGE_SIZE,
Expand Down
8 changes: 7 additions & 1 deletion src/integrations/ethereum/common/redux/events/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ export const setSubscribedTopics = function(topics) {

export const SET_LOADING = `${prefix}/SET_LOADING`;
export const requestPage = function(startBlockNumber, endBlockNumber) {
endBlockNumber = endBlockNumber || 0;
return async function(dispatch, getState) {
if (startBlockNumber == null) {
startBlockNumber = getState().core.latestBlock;
}
if (endBlockNumber == null) {
const state = getState();
endBlockNumber = state.config.settings.workspace.server.fork
? state.config.settings.workspace.server.fork_block_number + 1
: 0;
}


let earliestBlockToRequest = Math.max(
startBlockNumber - PAGE_SIZE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ export const clearTransactionsInView = function() {

export const SET_LOADING = `${prefix}/SET_LOADING`;
export const requestPage = function(startBlockNumber, endBlockNumber) {
endBlockNumber = endBlockNumber || 0;
return function(dispatch, getState) {
if (startBlockNumber == null) {
startBlockNumber = getState().core.latestBlock;
}
if (endBlockNumber == null) {
const state = getState();
endBlockNumber = state.config.settings.workspace.server.fork
? state.config.settings.workspace.server.fork_block_number + 1
: 0;
}

let earliestBlockRequested = Math.max(
startBlockNumber - PAGE_SIZE,
Expand Down

0 comments on commit 940de3e

Please sign in to comment.