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

Only load blocks, events and transactions from after the fork block #5221

Merged
merged 1 commit into from
Feb 6, 2023
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
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