You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context
I have been working on decoding blockExtraData in the Avalanche C-Chain and encountered some issues. I noticed the decoder code in the "legacy" branch and have some questions regarding its functionality and location in the newer branches.
Location of blockExtraData Decoder
Why is the decoder code added to blockExtraData in AvalancheJS only present in the "legacy" branch (blockExtraDataDecoder.ts) and not in more recent branches/tags and master? Or is it located somewhere else? If so, where can it be found?
Decoding Errors
The code added in the thread seems not to decode all types of blockExtraData content. For example, for the hex code "0x000000000000000000010427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd652ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b0000000224c9b5a1cf43117c9386b7536f05205b2b160d02ed8b68c17a393b384341ca7f0000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000005000000001dcd65000000000100000000fee38848738edb70e5952e5bab6788228a8ff8fdcdbc511fc803ca779c4481aa0000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000005000000000bebc2000000000100000000000000029b6581f86a76f6816dd0b26e064362bf39365662000000000bebc20021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff9b6581f86a76f6816dd0b26e064362bf39365662000000001dcd650021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000020000000900000001c03d4cb185dc4cff1df5c3b1804c7949dd4fc6e68e9e59814f87a229ec6ffe837d1d864475e3bcd3c85ec762caa09047648c83e0fca73e9266df79e5bcee53e3010000000900000001c03d4cb185dc4cff1df5c3b1804c7949dd4fc6e68e9e59814f87a229ec6ffe837d1d864475e3bcd3c85ec762caa09047648c83e0fca73e9266df79e5bcee53e301" from C-Chain block number 31584, we encounter the error "RangeError: Trying to access beyond buffer length." Is there an open-source code that correctly decodes such transactions?
Mismatched Decoding Information
Another example comes from block number 40064885. For this block, the decoding returns only one output with the following content:
Therefore, I have the following questions:
a) Is it possible to obtain a txHash from blockExtraData on C-Chain similar to the one in AVASCAN?
b) Is it possible to obtain AVAX address IDs in the "c-avax..." format from blockExtraData on C-Chain?
c) How can we also decode a transaction of type pvm_export as shown in the above example?
I greatly appreciate your time and assistance in addressing these questions. Your expertise and guidance are invaluable. Thank you in advance for your support.
The text was updated successfully, but these errors were encountered:
Context
I have been working on decoding blockExtraData in the Avalanche C-Chain and encountered some issues. I noticed the decoder code in the "legacy" branch and have some questions regarding its functionality and location in the newer branches.
Location of blockExtraData Decoder
Why is the decoder code added to
blockExtraData
in AvalancheJS only present in the "legacy" branch (blockExtraDataDecoder.ts) and not in more recent branches/tags and master? Or is it located somewhere else? If so, where can it be found?Decoding Errors
The code added in the thread seems not to decode all types of
blockExtraData
content. For example, for the hex code "0x000000000000000000010427d4b22a2a78bcddd456742caf91b56badbff985ee19aef14573e7343fd652ed5f38341e436e5d46e2bb00b45d62ae97d1b050c64bc634ae10626739e35c4b0000000224c9b5a1cf43117c9386b7536f05205b2b160d02ed8b68c17a393b384341ca7f0000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000005000000001dcd65000000000100000000fee38848738edb70e5952e5bab6788228a8ff8fdcdbc511fc803ca779c4481aa0000000121e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff00000005000000000bebc2000000000100000000000000029b6581f86a76f6816dd0b26e064362bf39365662000000000bebc20021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff9b6581f86a76f6816dd0b26e064362bf39365662000000001dcd650021e67317cbc4be2aeb00677ad6462778a8f52274b9d605df2591b23027a87dff000000020000000900000001c03d4cb185dc4cff1df5c3b1804c7949dd4fc6e68e9e59814f87a229ec6ffe837d1d864475e3bcd3c85ec762caa09047648c83e0fca73e9266df79e5bcee53e3010000000900000001c03d4cb185dc4cff1df5c3b1804c7949dd4fc6e68e9e59814f87a229ec6ffe837d1d864475e3bcd3c85ec762caa09047648c83e0fca73e9266df79e5bcee53e301" from C-Chain block number 31584, we encounter the error "RangeError: Trying to access beyond buffer length." Is there an open-source code that correctly decodes such transactions?Mismatched Decoding Information
Another example comes from block number 40064885. For this block, the decoding returns only one output with the following content:
However, AVASCAN shows the following information for this block:
Therefore, I have the following questions:
a) Is it possible to obtain a
txHash
fromblockExtraData
on C-Chain similar to the one in AVASCAN?b) Is it possible to obtain AVAX address IDs in the "c-avax..." format from
blockExtraData
on C-Chain?c) How can we also decode a transaction of type
pvm_export
as shown in the above example?I greatly appreciate your time and assistance in addressing these questions. Your expertise and guidance are invaluable. Thank you in advance for your support.
The text was updated successfully, but these errors were encountered: