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

Populate BlockTemplate fields using a new state request #5455

Closed
Tracked by #5235 ...
oxarbitrage opened this issue Oct 21, 2022 · 5 comments · Fixed by #5751
Closed
Tracked by #5235 ...

Populate BlockTemplate fields using a new state request #5455

oxarbitrage opened this issue Oct 21, 2022 · 5 comments · Fixed by #5751
Assignees

Comments

@oxarbitrage
Copy link
Contributor

oxarbitrage commented Oct 21, 2022

Motivation

Whatever is not fixed values(#5452), coinbase transaction(#5453) or mempool transaction(#5454) will be state or Rust API values.

Tasks

Return state values in the getblocktemplate RPC method response:

  • previousblockhash
  • height
  • defaultroots
    • chainhistoryroot
  • target (same as bits, but in a different format)
  • mintime

These values should come from a new state request based on recent best blocks. We want to use a single state request for performance.

Return local node clock value in the getblocktemplate RPC method response:

  • curtime - using the same standard library time function as the time field consensus rule check

Related Tickets

Depend on #5451
Can depend on #5452 for identification

@teor2345
Copy link
Contributor

@oxarbitrage I think the fields we need here are:

New state request based on recent best blocks:

  • previousblockhash
  • height
  • defaultroots
    • chainhistoryroot
  • target (same as bits, but in a different format)
  • mintime

Standard library time function:

  • curtime

Can I edit the ticket, or did you want to?

@oxarbitrage
Copy link
Contributor Author

Please feel free to edit any of the getblocktemplate tickets. I did some some work already in the first one but none in the rest of them.

@teor2345 teor2345 changed the title 3- Populate BlockTemplate fields with functional values 3- Populate BlockTemplate fields using a new state request Oct 24, 2022
@mpguerra
Copy link
Contributor

@mpguerra mpguerra changed the title 3- Populate BlockTemplate fields using a new state request Populate BlockTemplate fields using a new state request Oct 26, 2022
@teor2345
Copy link
Contributor

PR #5659 populates all of these fields except defaultroots.chainhistoryroot (and the 5 fields that are copies of it).

@mpguerra @oxarbitrage did you want to split that out into a separate ticket?

@mpguerra
Copy link
Contributor

I think @oxarbitrage is working on them in a separate PR so I think it's ok to just keep it in this ticket.

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