-
Notifications
You must be signed in to change notification settings - Fork 807
Interval tree syncing integration #2855
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
Merged
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
c5b7aa9
Implement interval tree for syncing
StephenButtolph 63efd3b
Persist intervals
StephenButtolph 2454c46
rename
StephenButtolph 0efa5eb
Add block execution
StephenButtolph 6a65a2a
Add length + TODOs
StephenButtolph f2234bd
nit
StephenButtolph 1f63238
error rather than panic
StephenButtolph 6947876
Refactor database passing
StephenButtolph 28207f4
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph be64296
Add interval tests
StephenButtolph 884f39c
Fix too frequent iterator releases and batch writes
StephenButtolph e4e92cc
nit + support cancellation
StephenButtolph 72314d1
Add invariant comment + tests
StephenButtolph e494033
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph a64b863
wip
StephenButtolph 782a02c
wip
StephenButtolph 8851470
Merge branch 'master' into interval-tree-syncing
StephenButtolph 2b07179
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph 5358587
support cancellation
StephenButtolph 9d24b20
save
StephenButtolph 0de6142
remove test code
StephenButtolph e658404
keep acceptor callback
StephenButtolph 03f60c6
lint
StephenButtolph 30ac2fb
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph f81281a
fix test
StephenButtolph 410db8c
Merge branch 'interval-tree-syncing-integration' of github.com:ava-la…
StephenButtolph 984849c
remove incorrect db cleanup
StephenButtolph f4a724a
nits
StephenButtolph f01b6a3
allow specifying the log level
StephenButtolph 9d7383f
merged
StephenButtolph 0021f3e
cleanup metrics
StephenButtolph f1933d6
lint
StephenButtolph dd4a57f
add error information
StephenButtolph d5da1e9
upstream
StephenButtolph 7373a89
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph 25e2801
cleanup
StephenButtolph 5ca206b
reduce copied code
StephenButtolph cd90ef1
Merge branch 'interval-tree-syncing-integration' of github.com:ava-la…
StephenButtolph d9a7f8a
nit cleanup
StephenButtolph bd2b2d2
nit cleanup
StephenButtolph f0c5c10
Merge branch 'master' into interval-tree-syncing
StephenButtolph 68ea448
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph b6d6ba9
Merge branch 'master' into interval-tree-syncing
StephenButtolph 281dc8d
merged
StephenButtolph 06fd656
Merge branch 'master' into interval-tree-syncing
StephenButtolph 672c23f
merged
StephenButtolph 175ab8e
nit
StephenButtolph c89d24d
Remove redundent interface
StephenButtolph 249819c
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph a736e6c
nit
StephenButtolph faa5329
nit
StephenButtolph bc3fedf
nit
StephenButtolph 8134e16
nit
StephenButtolph 9991e39
Move GetMissingBlockIDs and Execute out of the interval package
StephenButtolph 2877502
Merge branch 'master' into interval-tree-syncing
StephenButtolph 50754ad
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph a7e2458
wip
StephenButtolph f1dd0a6
nit
StephenButtolph bf29d86
remove storage
StephenButtolph 0626129
merged
StephenButtolph 5a8fadc
nit
StephenButtolph 69ed897
nit
StephenButtolph 9815047
nit
StephenButtolph 5bf4899
nit
StephenButtolph 9da3bc1
nit
StephenButtolph 93aac21
Merge branch 'interval-tree-syncing' into interval-tree-syncing-integ…
StephenButtolph bd5687a
nit
StephenButtolph b6e3ee1
merged
StephenButtolph c376df2
add process test
StephenButtolph 53bdb78
nit
StephenButtolph 7310832
nit
StephenButtolph 7de5499
wip
StephenButtolph 4f88827
wip
StephenButtolph 21d1fd1
remove duplicate code
StephenButtolph dd98c10
nit
StephenButtolph 81f4b67
nit fix log check
StephenButtolph 03a22b8
nit
StephenButtolph d753cb5
nit
StephenButtolph aa8d248
Remove haltableContext
StephenButtolph 5d67d98
merged
StephenButtolph ef09bd2
nit
StephenButtolph fe23a59
Merge branch 'master' into interval-tree-syncing-integration
StephenButtolph db1c8af
Cleanup getMissingBlockIDs tests
StephenButtolph 8d6f491
refactor process
StephenButtolph 699fae3
nit
StephenButtolph e5e8dff
cleanup
StephenButtolph 0c2b01a
fix test
StephenButtolph 8ce7bfb
Remove fetch eta metric
StephenButtolph 3b32eec
cleanup execution test
StephenButtolph 673318e
Merge branch 'master' into interval-tree-syncing-integration
StephenButtolph f4b6127
nits
StephenButtolph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package bootstrap | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
|
||
"github.com/ava-labs/avalanchego/snow" | ||
"github.com/ava-labs/avalanchego/snow/consensus/snowman" | ||
"github.com/ava-labs/avalanchego/snow/engine/snowman/block" | ||
) | ||
|
||
var ( | ||
_ block.Parser = (*parseAcceptor)(nil) | ||
_ snowman.Block = (*blockAcceptor)(nil) | ||
) | ||
|
||
type parseAcceptor struct { | ||
parser block.Parser | ||
ctx *snow.ConsensusContext | ||
numAccepted prometheus.Counter | ||
} | ||
|
||
func (p *parseAcceptor) ParseBlock(ctx context.Context, bytes []byte) (snowman.Block, error) { | ||
blk, err := p.parser.ParseBlock(ctx, bytes) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &blockAcceptor{ | ||
Block: blk, | ||
ctx: p.ctx, | ||
numAccepted: p.numAccepted, | ||
}, nil | ||
} | ||
|
||
type blockAcceptor struct { | ||
snowman.Block | ||
|
||
ctx *snow.ConsensusContext | ||
numAccepted prometheus.Counter | ||
} | ||
|
||
func (b *blockAcceptor) Accept(ctx context.Context) error { | ||
if err := b.ctx.BlockAcceptor.Accept(b.ctx, b.ID(), b.Bytes()); err != nil { | ||
return err | ||
} | ||
err := b.Block.Accept(ctx) | ||
b.numAccepted.Inc() | ||
return err | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.