algorand / algorand/go-algorand

Perf: txn decoding - reuse encoded txn

未關閉
#4,548 0 則留言 0 個 reaction 已指派 1 人 已被 @cce 認領 在 GitHub 檢視
Performance Team Carbon-11
主要語言
Go
星號
1.4k
分支
537
平均合併
1 天 6 小時
30 天內合併 PR
17

描述

Re-use encoded txn objects to reduce redundant txn encoding.

### Context
When nodes receive gossipped txns, they decode them, perform checks (signature validation etc), and then re-encode them before forwarding them onwards. Currently, nodes re-encode transactions multiple times (calculating txn ID, encoding the txn to forward in gossip, etc), wasting resources.

To boost node performance, we can reduce the number of times they encode txns.

Unknowns:
1. How much time is spent encoding txns (can check txn profiler)
2. List of areas we duplicate txn encoding

Raw txn groups and block proposals both contain encoded txns, so we can save re-encoding effort for txns and proposals.
Goal: zero allocation for `Transaction` objects while evaluating it.

### Acceptance Criteria
1. Possibly: measure time spent encoding txn (via txn profiler) to gauge opportunity
2. Identify areas of duplicate encoding
3. Implementation
- For block proposals:
- Introduce `RawPayset []msgp.Raw` to Block in order to use it as needed.
- In `Eval` iterate `RawPayset` and decode as needed instead of pre-decoding the Payset.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。