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

Json dump for Dao state refactoring #5608

Closed

Conversation

chimp1984
Copy link
Contributor

  • Write chainHeight
  • Write on new blocks or on parse complete from last persisted block height
  • Do not delete json dirs at start
  • Write txs and txos from block/s to write
  • Add reorg handling to json dump
  • Do not load daostate in case the DAO is disabled (not related to json dump aspect)

In case of a reorg we pass the block height of the last persisted snapshot
and delete all blocks and related tx/txos from that block height on.
In case we dont have a snapshot we delete the whole json dir.

It is not tested much yet.
Will require adoption for the explorer nodes by @softsimon - should be either deployed to a branch or waited for merge to master until @softsimon signals readiness.

- Write chainHeight
- Write on new blocks or on parse complete from last persisted block height
- Do not delete json dirs at start
- Write txs and txos from block/s to write

Not supporting cleanups in case of reorgs yet
In case of a reorg we pass the block height of the last persisted snapshot
and delete all blocks and related tx/txos from that block height on.
In case we dont have a snapshot we delete the whole json dir.
@ripcurlx ripcurlx added this to the v1.7.3 milestone Jul 16, 2021
@stale
Copy link

stale bot commented Aug 21, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Aug 21, 2021
@ripcurlx ripcurlx modified the milestones: v1.7.3, v1.7.4 Aug 23, 2021
@ripcurlx
Copy link
Contributor

ripcurlx commented Sep 6, 2021

@softsimon Are you aware about this open change?

@ripcurlx ripcurlx modified the milestones: v1.7.4, v1.7.5 Sep 21, 2021
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Copy link
Member

@ghubstan ghubstan Sep 22, 2021

Choose a reason for hiding this comment

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

Shouldn't line 96 be log.error(e.toString()); if not a thrown exception? Stack traces printed to std.err can be out of sync with the logger's buffer flushing -- it can make the timing of the stack trace in the bisq.log file a bit confusing.


Futures.addCallback(future, Utilities.failureCallback(throwable -> {
log.error(throwable.toString());
throwable.printStackTrace();
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this t.printStackTrace() redundant? You just logged the error, with stack trace.

@ghubstan
Copy link
Member

I verified json dumps are happening while offers are being created in the api test harness.
Pending file conflict resolution, a pseudo Tested ACK from me.

Stepped through json dump dirs created: OK
Tested chainHeight.json is updated/incremented: OK
Tested block/<blk-#>_hash.json is created: OK
Tested tx/.json is created: OK
Tested txo/.json is created: OK

Json file contents look OK to me.

@ripcurlx ripcurlx modified the milestones: v1.7.5, v1.8.0 Oct 19, 2021
@chimp1984
Copy link
Contributor Author

Close as totally outdated...

@chimp1984 chimp1984 closed this Nov 9, 2021
@chimp1984 chimp1984 deleted the dao-state-refactoring branch November 18, 2021 00:55
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

Successfully merging this pull request may close these issues.

3 participants