Skip to content

Conversation

ucwong
Copy link
Member

@ucwong ucwong commented May 21, 2021

No description provided.

ucwong and others added 22 commits May 17, 2021 13:10
* forkid: added failing test

* forkid: fixed off-by-one bug
This changes the definitions of Ping and Pong, adding an optional field
for the sequence number. This field was previously encoded/decoded using
the "tail" struct tag, but using "optional" is much nicer.
This commit makes various cleanup changes to rlp.Stream.

* rlp: shrink Stream struct

This removes a lot of unused padding space in Stream by reordering the
fields. The size of Stream changes from 120 bytes to 88 bytes. Stream
instances are internally cached and reused using sync.Pool, so this does
not improve performance.

* rlp: simplify list stack

The list stack kept track of the size of the current list context as
well as the current offset into it. The size had to be stored in the
stack in order to subtract it from the remaining bytes of any enclosing
list in ListEnd. It seems that this can be implemented in a simpler
way: just subtract the size from the enclosing list context in List instead.
This changes the definitions of Ping and Pong, adding an optional field
for the sequence number. This field was previously encoded/decoded using
the "tail" struct tag, but using "optional" is much nicer.
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #958 (5b7057d) into master (137aee9) will increase coverage by 0.10%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #958      +/-   ##
==========================================
+ Coverage   49.03%   49.13%   +0.10%     
==========================================
  Files         422      422              
  Lines       47281    47202      -79     
==========================================
+ Hits        23185    23194       +9     
+ Misses      22074    21989      -85     
+ Partials     2022     2019       -3     
Impacted Files Coverage Δ
cmd/utils/flags.go 1.92% <ø> (ø)
core/asm/asm.go 54.34% <0.00%> (-6.99%) ⬇️
core/asm/compiler.go 58.77% <ø> (+58.77%) ⬆️
ctxc/metrics.go 0.00% <0.00%> (ø)
ctxc/protocol.go 60.86% <ø> (ø)
rlp/iterator.go 70.58% <ø> (ø)
ctxc/handler.go 33.97% <33.33%> (ø)
ctxc/peer.go 63.75% <40.90%> (ø)
rlp/encode.go 95.70% <89.47%> (-0.43%) ⬇️
rlp/decode.go 95.04% <90.90%> (+0.87%) ⬆️
... and 22 more

@ucwong ucwong merged commit cbcffbd into master May 22, 2021
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

Successfully merging this pull request may close these issues.

5 participants