Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prototype: compact blocks #1191

Draft
wants to merge 75 commits into
base: v0.34.x-celestia
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
bf6edc0
implement prototype for compact blocks
cmwaters Jan 20, 2024
211694b
add compact block messages to the reactor
cmwaters Jan 24, 2024
567cf3f
checkpoint
cmwaters Jan 24, 2024
22639ab
checkpoint
cmwaters Jan 25, 2024
d4f62fd
fix e2e tests
cmwaters Jan 25, 2024
27a6fe3
add has compact block message
cmwaters Jan 26, 2024
f0e972e
use go 1.19
cmwaters Jan 26, 2024
1cb6666
fix tests
cmwaters Jan 27, 2024
4874e77
fix consensus tests
cmwaters Jan 27, 2024
187d26c
fix test I just broke
cmwaters Jan 27, 2024
0f529f6
linting
cmwaters Jan 27, 2024
64d3f6d
lint
cmwaters Jan 27, 2024
c530d1e
fix data race
cmwaters Jan 27, 2024
3e6c075
go fmt
cmwaters Jan 27, 2024
507f3d2
Merge remote-tracking branch 'origin/v0.34.x-celestia' into callum/co…
cmwaters Jul 19, 2024
9ab18d4
gofmt
cmwaters Jul 19, 2024
8f63838
save metrics
cmwaters Jul 19, 2024
71b752e
enable metrics
cmwaters Jul 19, 2024
c2e6331
shift where we measure compact blocks
cmwaters Jul 19, 2024
1cbd361
fix: panic in prometheus
cmwaters Jul 24, 2024
1fe8522
add the square size to the constructed data
cmwaters Jul 29, 2024
1846523
add more metrics for compact blocks
cmwaters Jul 30, 2024
1c4f76e
fix usage of metrics
cmwaters Jul 30, 2024
9ad05ed
fix error handling in cat pool and consensus
cmwaters Jul 30, 2024
93774a7
checkpoint
cmwaters Jul 31, 2024
6f8f70a
print out account sequence
cmwaters Jul 31, 2024
82a8958
track if we see missing transcations which are invalid
cmwaters Aug 8, 2024
d1b3c4d
add more logs around the mempool
cmwaters Aug 9, 2024
8a5d797
remove jitter
cmwaters Aug 9, 2024
e937057
add inclusion delay
cmwaters Aug 9, 2024
74cac47
jump to 3 second delay
cmwaters Aug 9, 2024
dfa4382
improve logs
cmwaters Aug 9, 2024
a56bbb7
checkpoint
cmwaters Aug 9, 2024
905ba36
Revert "checkpoint"
cmwaters Aug 12, 2024
2273f83
update logger
cmwaters Aug 12, 2024
513949c
checkpoint
cmwaters Aug 13, 2024
567a281
checkpoint
cmwaters Aug 13, 2024
dcea04c
add more tracing data
cmwaters Aug 13, 2024
c5fd230
return some logs to debug
cmwaters Aug 13, 2024
b4ebb57
checkpoint
cmwaters Aug 14, 2024
33004a3
sneaky fix
cmwaters Aug 14, 2024
1bb12bf
fix
cmwaters Aug 14, 2024
b1086d2
checkpoint
cmwaters Aug 15, 2024
aab522a
fix nil pointer dereference
cmwaters Aug 15, 2024
d46ad2d
fix pruning and resetting
cmwaters Aug 16, 2024
5aefb63
define a send queue capacity
cmwaters Aug 16, 2024
178f81a
add more tracing data
cmwaters Aug 20, 2024
aaf89cf
register mempool recovery table
cmwaters Aug 23, 2024
c42c673
allow the fetching of compact blocks to last the entire round
cmwaters Aug 26, 2024
9ff3319
repropose the valid block if it exists
cmwaters Aug 26, 2024
7578e10
use updateRoundStep to track consensus state changes
cmwaters Aug 27, 2024
34774cd
add compact hash to the proposal type
cmwaters Aug 27, 2024
955714f
chore: remove maverick directory
cmwaters Aug 27, 2024
5ab5034
use compact hash
cmwaters Aug 27, 2024
ec3335c
remove cases in e2e test
cmwaters Aug 27, 2024
bc72dc4
cover up a few other missing cases
cmwaters Aug 27, 2024
5b25a7c
fix the fallback mechanism
cmwaters Aug 28, 2024
cf354c5
don't evict transcactions that have been proposed
cmwaters Aug 30, 2024
dddd61e
mark peer as having sent compact proposal
cmwaters Aug 30, 2024
92e20de
don't evict transactions in a proposal
cmwaters Aug 30, 2024
0a5adc0
make sure the lock is correctly used
cmwaters Aug 30, 2024
99b4727
play around with p2p settings
cmwaters Sep 2, 2024
7218a79
add a channel and modify some of the vote gossiping logic
cmwaters Sep 3, 2024
bc85fc2
implement priority based broadcast system
cmwaters Sep 5, 2024
79947c6
remove print statement
cmwaters Sep 5, 2024
a801fa3
checkpoint
cmwaters Sep 6, 2024
9f48af6
increase the send queue capacity
cmwaters Sep 6, 2024
594e303
make modifications to the consensus reactor
cmwaters Sep 6, 2024
7b76868
fix panic
cmwaters Sep 6, 2024
caeb9ef
checkpoint
cmwaters Sep 6, 2024
91f1703
Merge branch 'v0.34.x-celestia' into callum/compact-blocks
cmwaters Oct 28, 2024
a55e1c9
fix test
cmwaters Oct 28, 2024
77db525
revert some modifications to the consensus reactor logic
cmwaters Oct 28, 2024
f170aad
repurpose listen only in the mempool
cmwaters Oct 28, 2024
a31a8fe
lint
cmwaters Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix consensus tests
cmwaters committed Jan 27, 2024
commit 4874e7703ad2b7a48717be87fcabf9516ff9b54e
10 changes: 1 addition & 9 deletions consensus/reactor.go
Original file line number Diff line number Diff line change
@@ -986,7 +986,7 @@ func (conR *Reactor) peerStatsRoutine() {
if numVotes := ps.RecordVote(); numVotes%votesToContributeToBecomeGoodPeer == 0 {
conR.Switch.MarkPeerAsGood(peer)
}
case *BlockPartMessage:
case *BlockPartMessage, *CompactBlockMessage:
if numParts := ps.RecordBlockPart(); numParts%blocksToContributeToBecomeGoodPeer == 0 {
conR.Switch.MarkPeerAsGood(peer)
}
@@ -1368,14 +1368,6 @@ func (ps *PeerState) BlockPartsSent() int {
return ps.Stats.BlockParts
}

// HasBlock returns true if the peer has received a valid block for the current round
func (ps *PeerState) HasBlock() bool {
ps.mtx.Lock()
defer ps.mtx.Unlock()

return ps.PRS.Block
}

// SetHasVote sets the given vote as known by the peer
func (ps *PeerState) SetHasVote(vote *types.Vote) {
ps.mtx.Lock()
2 changes: 1 addition & 1 deletion consensus/reactor_test.go
Original file line number Diff line number Diff line change
@@ -367,7 +367,7 @@ func TestReactorRecordsVotesAndBlockParts(t *testing.T) {
ps := peer.Get(types.PeerStateKey).(*PeerState)

assert.Equal(t, true, ps.VotesSent() > 0, "number of votes sent should have increased")
assert.Equal(t, true, ps.HasBlock(), "should have block")
assert.Equal(t, true, ps.BlockPartsSent(), "should have block")
}

//-------------------------------------------------------------