algorand / algorand/go-algorand

Error in block header serialization using msg pack

オープン
#6,395 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Go
スター
1.4k
フォーク
537
平均マージ
1日 6時間
マージ済み PR(30日)
17

説明

### Subject of the issue

I am trying to download a block using msgpack encoding, however decoding fails.

### Your environment

4.1.2 algod from Urtho

### Steps to reproduce

1. Download block 52243617, format msg pack, headers only

### Expected behaviour

I expect json keys to be string not uints.

spt is map[bigint,sptobject], and should be encoded in the msgpack as map[bigint.ToString(),sptobject]

```
Expected: "...8A0B9D14BE64AF887B4A373707481A13081A16ECE031D2D00A27463CEB..."
But was: "...8A0B9D14BE64AF887B4A3737074810081A16ECE031D2D00A27463CEBB6..."
-------------------------------------------^
```

`00` is raw 0, `A130` is string "0"

I expect the algod follow the standards for encoding.

📚 References:
1. JSON Specification (RFC 8259)
"An object is an unordered collection of name/value pairs... A name is a string."
📌 Source: RFC 8259 – [The JavaScript Object Notation (JSON) Data Interchange Format](https://datatracker.ietf.org/doc/html/rfc8259#section-4)

2. MessagePack Specification
"Map format family stores a key-value pair elements... A key and a value can be any types."
📌 Source: [MessagePack Spec – Map format](https://github.com/msgpack/msgpack/blob/master/spec.md#map-format-family)

However, it also notes:

"If you want to convert MessagePack to JSON, keys must be strings."

3. MessagePack for C# (MessagePack-CSharp) Documentation
"Map keys should be string for compatibility with JSON."
📌 Source: [MessagePack-CSharp GitHub Wiki](https://github.com/neuecc/MessagePack-CSharp/wiki)

### Actual behaviour

I am receiving

81A5626C6F636BDE0014A26269CE008FA891A46561726ECE000354B0A26663CD9858A466656573C420C7FCCDB258F0D4189C2BF8B6D68EE697508642B0AD001F31FCB918C354BA859AA466726163CF000000019A73D62AA367656EAC6D61696E6E65742D76312E30A26768C420C061C4D8FC1DBDDED2D7604BE4568E3F6D041987AC37BDE4B620B5AB39248ADFA27070CE008FF4BDA470726576C4208C32ECE62209FFE1D36921D7FBA4116F29955B18ED53BDD67F636697A0DE2EB4A570726F746FD95968747470733A2F2F6769746875622E636F6D2F616C676F72616E64666F756E646174696F6E2F73706563732F747265652F32333664636331386339633530376437393438313361623736386534363765613432643162346439A3707270C4207E7F342D4DB54C9982C5FE241C0CF3E724DF3609B9D1DEB8664DCD73983EE04FA3726E64CE031D2CA1A6727763616C72CE03211620A3727764C420FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA473656564C4204EDE16B5C5C7E39F092F20659004E61C39462FD74AD488A0B9D14BE64AF887B4A3737074810081A16ECE031D2D00A27463CEBB651B7EA27473CE6888A6EFA374786EC420542FACDE15685204D8FF2FD140EFCCE0537E18C5E8909CDD224130E5D40EDCA2A674786E323536C420931F4E8F27F1AE024641CD3E4AA10E58B116B9A2815F9BA3C9AC499A247231C2

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。