feat(nano): Improve Nano History HTTP API#1486
Conversation
|
|
||
| # Store events in transaction metadata | ||
| if events_list: | ||
| tx_meta.nc_events = [(event.nc_id, event.data) for event in events_list] |
There was a problem hiding this comment.
Should we add a limit to the number of stored events?
There was a problem hiding this comment.
I don't think this should be stored in metadata since it's completely useless for most full nodes, we could either store it in files just like the nc logs, or for quicker solution, just ignore events and require blueprint devs to write logs when they write events — that is, events would not be available though the APIs, only logs
There was a problem hiding this comment.
We can refactor this later.
There was a problem hiding this comment.
Should we add a limit to the number of stored events?
This is also not problematic while OCB is restricted, so we should review for unreasonably large event generation. We can also improve it after removing it from metadata.
9a9161b to
5d47cb3
Compare
|
| Branch | feat/nano/history-api-improvements |
| Testbed | ubuntu-22.04 |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result minutes (m) (Result Δ%) | Lower Boundary minutes (m) (Limit %) | Upper Boundary minutes (m) (Limit %) |
|---|---|---|---|---|
| sync-v2 (up to 20000 blocks) | 📈 view plot 🚷 view threshold | 1.68 m(-3.19%)Baseline: 1.73 m | 1.56 m (92.96%) | 2.08 m (80.68%) |
e45f9a5 to
b1562d0
Compare
c16bfee to
2ca0ba1
Compare
2722923 to
c2c02a9
Compare
e1ace41 to
6c2b8d7
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1486 +/- ##
==========================================
+ Coverage 86.10% 86.12% +0.02%
==========================================
Files 439 440 +1
Lines 33891 33993 +102
Branches 5296 5315 +19
==========================================
+ Hits 29183 29278 +95
+ Misses 3687 3685 -2
- Partials 1021 1030 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1f41408 to
02145cf
Compare
62f1052 to
7a4e722
Compare
7a4e722 to
1eca2c5
Compare
1eca2c5 to
e3fcf65
Compare
Motivation
These changes are commonly used by dApp developers.
Acceptance Criteria
TransactionMetadata.nc_events: list[tuple[bytes, bytes]].include_nc_logs: boolandinclude_nc_events: boolto the Nano History API.include_nc_logs: boolandinclude_nc_events: boolto the Transaction API.nc_args_decodedto the response in Nano History API.nc_args_decodedto the response in Transaction API.VertexHelperwith methodto_json(),.to_json_extended(), anddecode_nc_args().Checklist
master, confirm this code is production-ready and can be included in future releases as soon as it gets merged