-
Notifications
You must be signed in to change notification settings - Fork 953
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
WIP: Shwap prototype #3184
WIP: Shwap prototype #3184
Conversation
…ation method for ids
share/shwap/row_id.go
Outdated
"github.com/celestiaorg/celestia-node/share/store/file" | ||
) | ||
|
||
// TODO(@walldiss): maybe move into separate subpkg? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
share/shwap/row_id.go
Outdated
// enough size. Otherwise Caller might not see the changes. | ||
data = binary.BigEndian.AppendUint64(data, rid.Height) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be fixed tho
type Getter struct { | ||
// TODO(@walldiss): why not blockservice? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't need to cache on disk in most cases
share/shwap/getter/getter.go
Outdated
if ctx.Err() != nil { | ||
return nil, ctx.Err() | ||
} | ||
return nil, fmt.Errorf("not all shares were found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocks, because now its generalized
share/shwap/getter/getter.go
Outdated
datas[idx] = d | ||
return nil | ||
if data.RowIndex < uint16(from) || data.RowIndex >= uint16(to) { | ||
// should never happen, because rows should be verified against root by the time they are returned |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need if then, if its never happens?
share/shwap/getter/getter.go
Outdated
if len(blks) != sqrLn/2 { | ||
if ctx.Err() != nil { | ||
return nil, ctx.Err() | ||
} | ||
return nil, fmt.Errorf("not all rows were found") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicates logic in getBlocks so can be removed
share/shwap/sample_id.go
Outdated
func (sid SampleID) Release() { | ||
sampleVerifiers.Delete(sid) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little reminder to godoc this
This PR introduces `full` and `bridge` node pruning via the `--experimental-pruning` flag. Support is included for nodes that start from scratch with pruning enabled and also for `archival` (nodes retaining all historical blocks) that enable the `--experimental-pruning` flag. _Note that this PR does not support the conversion of a pruned node into an archival one explicitly (it would not support re-syncing deleted blocks)._ With pruning enabled, `full` and `bridge` nodes' block stores can be expected not to exceed ~4TB (as the upper bound). In follow-up PRs (hardening), the following features can be expected: - [x] discovery for archival nodes for archival sync - [ ] inverted_index / light node pruning - [ ] include more metrics for errors TODO: - [x] clean up some TODOs - [x] fix one flakey unit test - [x] change values back to the actual (GC cycle, sampling window, pruning window, etc). - [x] figure out whether to store error in pruner checkpoint - [x] fix issue with pruning genesis block via findPruneableHeaders - [x] metrics for failed prunes - [x] set a sane default for max pruneable / consider removing `MaxPruneablePerGC` as now context timeouts are on a per block basis - [ ] dedup findPruneableHeader test utility - [x] badger dep --------- Co-authored-by: Ryan <ryanford@poluglottos.com>
nodebuilder/share/config.go
Outdated
@@ -18,6 +18,7 @@ type Config struct { | |||
EDSStoreParams *store.Parameters | |||
|
|||
UseShareExchange bool | |||
UseShareSwap bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better keep it Shwap and rename the above one ot shrex, so there is less confusions around namings
# Conflicts: # core/listener_test.go # go.mod # go.sum # nodebuilder/core/module.go # nodebuilder/share/module.go # share/availability/light/availability.go # share/availability/light/availability_test.go # share/availability/light/testing.go # share/eds/byzantine/byzantine.go # share/eds/inverted_index.go # share/eds/metrics.go # share/eds/retriever_test.go # share/eds/store_test.go # share/getters/getter_test.go # share/getters/shrex.go # share/getters/shrex_test.go # share/ipld/corrupted_data_test.go # share/store/store_options.go
allow id marshallers to not depend on size of provided data container fix id types to have both pointer and value receivers R
We merged #3675, so can close this one |
Prototype for shwap protocol and storage. Contain all changes required for shwap implementation. This PR is not meant for merge. All changes will be extracted from prototype into smaller and nicer PRs.
Based on: #2675
Tracking issue: #2971