Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Conversation

lucac-zilliqa
Copy link
Contributor

@lucac-zilliqa lucac-zilliqa commented Aug 22, 2023

This pull request will add the functionality of debug_accountRange which will return a pagination style response of addresses in the network.

The idea is to implement a cache (an array) which will contain address hexes (still to be determined) which can then be indexed into a slice of the array returned (or also include the corresponding account information).

Potential Discussions:

  • What data will be stored in the cache: hex address as a byte array (currently implemented) or a vector of bits, an Address reference or Account reference?
  • How the data will be returned: return a series of hex addresses and have the client then make individual requests for the individual Account data or return the data associated with the address as well in the response of the debug_accountRange call?

@github-actions github-actions bot changed the title ZIL-5332-debug_accountRange [master] ZIL-5332-debug_accountRange Aug 22, 2023
}

void AccountStore::PrintAddressCache(){
for (const std::array<unsigned char, 40>& entry : m_cache) {
Copy link
Contributor

Choose a reason for hiding this comment

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

PrintAddressCache should probably lock the mutex as it may be possible for another thread to change the cache and invalidate the iterator, if there is only one thread then it possibly does not need a mutex.

Copy link
Contributor

@Steve-White-UK Steve-White-UK left a comment

Choose a reason for hiding this comment

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

If you can add a test to the EvmAcceptanceTests we can take it on board and this test will be executed via ci.

Need to make sure it only looks for short durations and that it doesn't use excessive memory, apart from that it should be OK.

If you provide a test we will test it out as part of our current schedule.

@lucac-zilliqa lucac-zilliqa force-pushed the ZIL-5332-debug_accountRange branch from 9392d3d to c51f10c Compare August 29, 2023 17:20
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.

2 participants