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

Full Sidechain Replay Memory Usage #18

Closed
inertia186 opened this issue Apr 24, 2019 · 0 comments
Closed

Full Sidechain Replay Memory Usage #18

inertia186 opened this issue Apr 24, 2019 · 0 comments

Comments

@inertia186
Copy link

As a private node operator, I would like to build the sidechain with my own local steemd node (without a third party blocks.log file), so that I can verify the sidechain.

The problem is that, by default, it will currently take about 60 hours to rebuild the sidechain using nothing but steemd as a source for transactions. This will only get longer over time.

This is complicated by the fact that we run out of memory after 24 hours, if we attempt to leave the node running that long. I believe there's a problem setting both of the following to 100 milliseconds ...

constructor(nodeUrl, currentBlock, antiForkBufferMaxSize = 2, pollingTime = 100) {

.
.
.
this.poller = setTimeout(() => {
this.stream(reject);
}, this.pollingTime);

blockPoller = setTimeout(() => getBlock(reject), 100);

The problem is, if libs/Streamer.js manages to get ahead of plugins/Streamer.js, it will take more and more memory until it runs out.

I agree with the intent of 775f20a to speed up streaming. But making the two equal introduces a complication.

One might think, there's no way they could get ahead of each other because they both wait 100 milliseconds. But if plugins/Streamer.js processing takes even 1 millisecond longer than libs/Streamer.js, libs/Streamer.js will start to retain more and more blocks in its queue, over time.

If we are only 10,000 blocks behind, that's no problem. But if we are 30,000,000 blocks behind, after 24 hours, the node will crash.

I propose that libs/Streamer.js polling time should always be twice as long as plugins/Streamer.js polling time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant