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

Use stacks block timestamp for block ingestion #2021

Closed
zone117x opened this issue Jun 24, 2024 · 1 comment
Closed

Use stacks block timestamp for block ingestion #2021

zone117x opened this issue Jun 24, 2024 · 1 comment
Assignees
Labels

Comments

@zone117x
Copy link
Member

Stacks block timestamps have been added to Nakamoto blocks in stacks-network/stacks-core#4846

API code currently takes Date.now() during block ingestion for this value:

if (!blockData.block_time) {
// TODO: if the core node can give use the stacks-block count/index for the current tenure/burn_block then we should
// increment this by that value so that timestampts increase monotonically.
const stacksBlockReceiptDate = db.isEventReplay
? msg.burn_block_time
: Math.round(Date.now() / 1000);
blockData.block_time = stacksBlockReceiptDate;
}

  • Needs to be adjusted to use the value from the core node event
  • Core node /new_block event may need modified to include this new value
@zone117x
Copy link
Member Author

Confirmed this is working as expected with latest stacks-core develop 🎉

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

No branches or pull requests

1 participant