-
- Downloads
Feat: added a prefix (radix) trie to compress hashes in votes
To be able to make the vote packages smaller, we have introduced a hash compression mechanism. While hashes can usually not be "compressed" due to limits in information theory, nodes in the IOTA network already know about relevant hashes upfront. We therefore only need to be able to exchange which hash we mean, when we exchange votes. This commit introduces a novel data structure, that uses radix trie like mechanisms, to create a very compact representation of a tx hash that can be understood by others. It allows us to compress the hashes from 49 bytes to 2-3 bytes which is a 94% compression rate.
Showing
- go.mod 1 addition, 1 deletiongo.mod
- go.sum 0 additions, 2 deletionsgo.sum
- packages/ca/heartbeat/serialization_test.go 2 additions, 2 deletionspackages/ca/heartbeat/serialization_test.go
- packages/datastructure/prefix_trie.go 188 additions, 0 deletionspackages/datastructure/prefix_trie.go
- packages/datastructure/prefix_trie_test.go 142 additions, 0 deletionspackages/datastructure/prefix_trie_test.go
- packages/model/approvers/approvers_test.go 1 addition, 1 deletionpackages/model/approvers/approvers_test.go
- packages/model/bundle/bundle_test.go 1 addition, 1 deletionpackages/model/bundle/bundle_test.go
- packages/model/meta_transaction/meta_transaction_test.go 1 addition, 1 deletionpackages/model/meta_transaction/meta_transaction_test.go
- packages/model/value_transaction/value_transaction_test.go 1 addition, 1 deletionpackages/model/value_transaction/value_transaction_test.go
- plugins/autopeering/types/peer/peer_test.go 1 addition, 1 deletionplugins/autopeering/types/peer/peer_test.go
- plugins/bundleprocessor/bundleprocessor_test.go 1 addition, 1 deletionplugins/bundleprocessor/bundleprocessor_test.go
... | ... | @@ -14,10 +14,10 @@ require ( |
github.com/kr/pretty v0.1.0 // indirect | ||
github.com/labstack/echo v3.3.10+incompatible | ||
github.com/labstack/gommon v0.2.9 // indirect | ||
github.com/magiconair/properties v1.8.1 | ||
github.com/pkg/errors v0.8.1 | ||
github.com/rivo/tview v0.0.0-20190721135419-23dc8a0944e4 | ||
github.com/rivo/uniseg v0.1.0 // indirect | ||
github.com/stretchr/testify v1.3.0 | ||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 | ||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 | ||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e // indirect | ||
... | ... |
... | ... | @@ -63,8 +63,6 @@ github.com/labstack/gommon v0.2.9/go.mod h1:E8ZTmW9vw5az5/ZyHWCp0Lw4OH2ecsaBP1C/ |
github.com/lucasb-eyer/go-colorful v1.0.2 h1:mCMFu6PgSozg9tDNMMK3g18oJBX7oYGrC09mS6CXfO4= | ||
github.com/lucasb-eyer/go-colorful v1.0.2/go.mod h1:0MS4r+7BZKSJ5mw4/S5MPN+qHFF1fYclkSPilDOKW0s= | ||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= | ||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= | ||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= | ||
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= | ||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | ||
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= | ||
... | ... |
packages/datastructure/prefix_trie.go
0 → 100644
packages/datastructure/prefix_trie_test.go
0 → 100644
Please register or sign in to comment