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

Make staterootinheader a proper block version 1 #3566

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roman-khimov
Copy link
Member

Very dirty, but works for the single node already:

{
   "result" : {
      "confirmations" : 16,
      "previousblockhash" : "0xdd97476a5dce63960db4165e4319e5bce4bd46387bcb4a98ef5ce0b5b18c0299",
      "nextconsensus" : "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP",
      "hash" : "0xd5495b7248d3fc32f75413d025898a0c4ee9c082fdf6b21515bd673f1c916f97",
      "nextblockhash" : "0x7c4f827b6aba86b00e2bd92dc05fcb1f816d6563afb0f5a72615152ff70b6b08",
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000",
      "time" : 1724964529883,
      "tx" : [],
      "primary" : 0,
      "witnesses" : [
         {
            "verification" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6",
            "invocation" : "DEDmlzUi0ZN7nhsuNWYVhjBNZPL0zk/8FY99YkO3eL7Q7RVoPrg7TCx1VsIxesj8vOZqDE4ejOd+McS+BHpD6mod"
         }
      ],
      "nonce" : "4D4E17967877AA30",
      "version" : 0,
      "index" : 49,
      "size" : 221
   },
   "jsonrpc" : "2.0",
   "id" : 5
}
{
   "jsonrpc" : "2.0",
   "result" : {
      "hash" : "0x7c4f827b6aba86b00e2bd92dc05fcb1f816d6563afb0f5a72615152ff70b6b08",
      "previousstateroot" : "0xc0914ad1c206e4c042c803402d098d68a81a01360caa79413cd849f028c6e3e9",
      "witnesses" : [
         {
            "invocation" : "DECx6jaOO88kfn9enecBGNoWSOQMkLY71J6Nq0phyUzSy1MTGWGGTem8/0q2QDZEsa39CUPklh4fpP/ZheyGp8aq",
            "verification" : "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6"
         }
      ],
      "nextblockhash" : "0x2eca391026670b32532a39a677b1e194faf805ed1d28e0b35fd42f5bf0049399",
      "tx" : [],
      "primary" : 0,
      "confirmations" : 22,
      "index" : 50,
      "nextconsensus" : "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP",
      "version" : 1,
      "nonce" : "AE8146B4A0BFEE37",
      "previousblockhash" : "0xd5495b7248d3fc32f75413d025898a0c4ee9c082fdf6b21515bd673f1c916f97",
      "size" : 253,
      "time" : 1724964530884,
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000"
   },
   "id" : 5
}

@roman-khimov
Copy link
Member Author

Work for 4-node network as well:

{
   "jsonrpc" : "2.0",
   "id" : 5,
   "result" : {
      "primary" : 1,
      "version" : 0,
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000",
      "witnesses" : [
         {
            "invocation" : "DEDBml8w5/9idaDbihP3mKBmaGliOkbDFvWcOhGVCP5YOUlLb1ka4+VVAwdxGs3FOXM6QXokO9TAY+7VsC6G9JAjDEBHFrqZN/rJ3HeXWMGkDf6eVDKYrewUQ+09fm21aoRcfUghAQsfKRD8guJh7demST3km0NV8aTZJBRDVUPRtYXpDEC27z2ik6auxppMEVKFjdaTde8BUqVNrSTobqo8GX8BhsbM9/81xAND0iTzPTMr/N2hxOEsCsaGWUH/layWctHt",
            "verification" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEGe0Nw6"
         }
      ],
      "nextblockhash" : "0x7bc27638b069002f78fece8a723a5af2ef5533a2cf6d64d2ad7aee2d221cf252",
      "size" : 458,
      "previousblockhash" : "0x0f833e56d34a374459a7105ff8fd1a18a8d8935c50be03dbfe24b46e2dc38cde",
      "confirmations" : 4,
      "nonce" : "F7DFBF70A61CE69F",
      "hash" : "0x4c1dfa6739fefeae12a3dab84cf416f750495f648480bb09b9e379cb271142bb",
      "time" : 1724997563173,
      "index" : 9,
      "nextconsensus" : "NVTiAjNgagDkTr5HTzDmQP9kPwPHN5BgVq",
      "tx" : []
   }
}
{
   "result" : {
      "time" : 1724997578178,
      "previousblockhash" : "0x4c1dfa6739fefeae12a3dab84cf416f750495f648480bb09b9e379cb271142bb",
      "nextconsensus" : "NVTiAjNgagDkTr5HTzDmQP9kPwPHN5BgVq",
      "nextblockhash" : "0x20e24491cf6d62de4b278bcfa0be445954f8b4d1d54fef146bed85e9806f45f6",
      "index" : 10,
      "nonce" : "4A9F3B9298800A5E",
      "previousstateroot" : "0xaa74b9978b3cf10a69438e2a31e1a663fcca2bbf50a30a35ecf9a4a4048f12be",
      "merkleroot" : "0x0000000000000000000000000000000000000000000000000000000000000000",
      "primary" : 2,
      "tx" : [],
      "hash" : "0x7bc27638b069002f78fece8a723a5af2ef5533a2cf6d64d2ad7aee2d221cf252",
      "witnesses" : [
         {
            "verification" : "EwwhAhA6f33QFlWFl/eWDSfFFqQ5T9loueZRVetLAT5AQEBuDCECp7xV/oaE4BGXaNEEujB5W9zIZhnoZK3SYVZyPtGFzWIMIQKzYiv0AXvf4xfFiu1fTHU/IGt9uJYEb6fXdLvEv3+NwgwhA9kMB99j5pDOd5EuEKtRrMlEtmhgI3tgjE+PgwnnHuaZFEGe0Nw6",
            "invocation" : "DEB2OOHvyzJBbXr7d7UbfDw4IxtlFUhF/gnjx8XNTRQdR3twVEGZZNpBIfGVVoEty7PN7UVn4EyK2HLVANHXs5rJDEARqbjKb3C6Mqex9spnNutO7NClwYj7jKmd/woY5w16rN9O8gM9lhq+Ny+06xEtqvjGGvELgPk37VdKozfeg32LDECq2n4vY6k9nyl5FN5rjsPRSXTB12q4nDI2Q34Mf7SCvPDpL0z+d/NRIGmM0taMk7jV92BC40Np14mgR/DiRZn4"
         }
      ],
      "size" : 490,
      "version" : 1,
      "confirmations" : 3
   },
   "jsonrpc" : "2.0",
   "id" : 5
}

@roman-khimov
Copy link
Member Author

Logic related to expectedHeaderSizeWithEmptyWitness might require some additional care since it's different between versions 0 and 1.

@roman-khimov roman-khimov added the blocked Can't be done because of something label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Can't be done because of something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant