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

Fix incorrect stateproof representation #855

Open
jasonpaulos opened this issue Jan 29, 2024 · 0 comments
Open

Fix incorrect stateproof representation #855

jasonpaulos opened this issue Jan 29, 2024 · 0 comments

Comments

@jasonpaulos
Copy link
Member

jasonpaulos commented Jan 29, 2024

Currently the stateproof transaction fields are incorrect:

stateProofType?: number | bigint;
stateProof?: Uint8Array;
stateProofMessage?: Uint8Array;

stateProof and stateProofMessage are not byte arrays, the are objects.

Additionally, the block header type contains an invalid representation of state proof tracking info:

spt: Map<number, Uint8Array>;

It is not possible to decode a Map object from JSON or msgpack, and the value type should be an object, not a byte array.

It remains to be seen whether the best approach is to fully type stateproof objects, or reference then generically, but something must be done to improve this.

Additionally, the stateproof types use integers as map keys, so it will be difficult to get these to encode and decode properly.

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

No branches or pull requests

1 participant