Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion application/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestAuthenticationSelectsCallerRootAndVerifiesBeforeReturning(t *testing.T)
t.Fatal(err)
}
value := []byte("a/b")
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: value, Target: cid.MustParse("bafkqaaa")}}}
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: value, Target: cid.MustParse("bafkqaaa")}}}
candidate, err := app.Store(t.Context(), state, cid.Undef)
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion application/backup/plan_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (s *PlanService) Backup(ctx context.Context, message string) (backupResult
backend := maltcid.BackendKindUnknown
if baseCID.Defined() {
descriptor, _, parseErr := maltcid.ParseRoot(baseCID)
if parseErr != nil || descriptor.Layout != maltcid.Prefix || descriptor.DerivationProfile != uint8(derivation.SHA256) {
if parseErr != nil || descriptor.Layout != maltcid.Map || descriptor.DerivationProfile != uint8(derivation.SHA256) {
return nil, fmt.Errorf("backup plan base is not a supported Prefix Root with byte-label inputs")
}
profile, profileErr := maltcid.Profile(descriptor.Profile)
Expand Down
8 changes: 4 additions & 4 deletions application/backup/plan_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type inspectingPlanFilesystem struct {
}

func newInspectingPlanFilesystem(order *[]string) *inspectingPlanFilesystem {
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -669,7 +669,7 @@ func TestPlanBackupRetryRestoresExactDurableCandidateBeforeRemoteWork(t *testing
}
workspace := bucketsyncWorkspaceInitialized(t)
base := cid.MustParse(workspace.Base.Root)
candidate, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, append([]byte{1}, make([]byte, maltcid.KZGCommitmentSize-1)...))
candidate, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, append([]byte{1}, make([]byte, maltcid.KZGCommitmentSize-1)...))
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -751,7 +751,7 @@ func TestPlanBackupRejectsConflictAndUnacceptedBaseBeforeSnapshotPublication(t *
policy: func(t *testing.T, _ bucketsync.Workspace) PlanRootPolicy {
commitment := make([]byte, maltcid.KZGCommitmentSize)
commitment[0] = 1
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, commitment)
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, commitment)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -987,7 +987,7 @@ func TestRestoredBaselinePreventsUnchangedRepublish(t *testing.T) {

func bucketsyncWorkspaceInitialized(t *testing.T) bucketsync.Workspace {
t.Helper()
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion application/writeback/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func newWritebackFixture(t *testing.T) *writebackFixture {
oldPayload := writebackRawCID(t, []byte("old"))
newBody := []byte("new")
newPayload := writebackRawCID(t, newBody)
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, Entries: []engine.Entry{{Label: []byte("payload"), Target: oldPayload}}}
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, Entries: []engine.Entry{{Label: []byte("payload"), Target: oldPayload}}}
base, err := authentication.Prepare(t.Context(), e, state)
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/malt/content_trust_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestExplicitCIDContentCommandsDoNotOpenBrokenTrustStore(t *testing.T) {
catCmd.SetContext(t.Context())
rmCmd.SetContext(t.Context())

selected, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, 48))
selected, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, 48))
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/malt/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestVerifyCommandBindsTypedResultToSelectedRequest(t *testing.T) {
}
e := engine.New(profiles)
nodes := memory.NewNodes()
root, err := e.Build(t.Context(), engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: []byte("docs/file"), Target: cid.MustParse("bafkqaaa")}}}, nodes)
root, err := e.Build(t.Context(), engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: []byte("docs/file"), Target: cid.MustParse("bafkqaaa")}}}, nodes)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/runtime-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ not a current build contract. The original plan is available in

The runtime's Go module namespace remains `github.com/dewebprotocol/malt-client`
until its separately governed module migration. The module pins published Core
`v0.0.11-rc.2` by its exact release version and module checksums. This dependency
`v0.0.11-rc.4` by its exact release version and module checksums. This dependency
update does not publish a runtime release or change frozen evaluator baselines.

## Preserved behavior
Expand Down
10 changes: 8 additions & 2 deletions docs/typed-authentication-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ new versioned measurement fields. Source workspace validation is not release
publication. The runtime module namespace/tag gate and exact downstream
release pins remain separate from this source migration.

Native builds pin published Core `v0.0.11-rc.2`, commit
`a8b0f9260ff025e834a803f87161685914604d11`, for independent module builds. This source
Native builds pin published Core `v0.0.11-rc.4`, commit
`595f1e05aa86b0339addaa0f0e2ac6672faa8e00`, for independent module builds. This source
integration is not a runtime or browser release.
Prefix layout 4 authenticates original label bytes and targets. Coordinates
route the tree lookup; distinct labels at the same full coordinate return an
Expand All @@ -66,3 +66,9 @@ conversion path. Existing Prefix trees must be rebuilt from their original
labels and targets, including parent roots that reference rebuilt children.
New roots use the remote's advertised backend as an
untrusted creation hint; updates preserve the existing Root descriptor.

Core rc.4 names the authentication layouts Map (4) and List (3). It includes
rc.3's empty-cell scalar-zero encoding: roots and proofs built with rc.2 or
earlier must be regenerated from original inputs, including parents that refer
to changed children. There is no compatibility reader or automatic migration.
Runtime application layout names and Root V=0 remain unchanged.
4 changes: 2 additions & 2 deletions filesystem/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestSelectedRootMismatchAndClosedHandleFailClosed(t *testing.T) {
func testView(t *testing.T) View {
t.Helper()
root, err := maltcid.NewRoot(maltcid.RootDescriptor{
Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256,
Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256,
}, make([]byte, maltcid.IPACommitmentSize))
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -423,7 +423,7 @@ func authenticatedFileResolution(t *testing.T, view *View, path string, payload
}
e := engine.New(profiles)
nodes := memory.NewNodes()
root, err := e.Build(t.Context(), engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: []byte(path), Target: payload}}}, nodes)
root, err := e.Build(t.Context(), engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, Entries: []engine.Entry{{Label: []byte(path), Target: payload}}}, nodes)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.26.8
require (
github.com/Microsoft/go-winio v0.6.2
github.com/crackcomm/go-gitignore v0.0.0-20241020182519-7843d2ba8fdf
github.com/dewebprotocol/malt-core v0.0.11-rc.2
github.com/dewebprotocol/malt-core v0.0.11-rc.4
github.com/hanwen/go-fuse/v2 v2.11.0
github.com/ipfs/boxo v0.41.0
github.com/ipfs/go-block-format v0.2.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 h1:5RVFMOWjMyRy8cARdy79nAmgYw3hK/4HUq48LQ6Wwqo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40=
github.com/dewebprotocol/malt-core v0.0.11-rc.2 h1:n1znvAKDKeH+vlrZ7o1nvinro2CGb1LoBtf0O3WOPzQ=
github.com/dewebprotocol/malt-core v0.0.11-rc.2/go.mod h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA=
github.com/dewebprotocol/malt-core v0.0.11-rc.4 h1:txnIBdjlVnQkPMUs6xxNwIEOoZxpQdJbmPDXkZbzgvM=
github.com/dewebprotocol/malt-core v0.0.11-rc.4/go.mod h1:uAbiKECccmR8MlDotFWLdAgp+JFStdSn2SqA6ILEXhA=
github.com/filecoin-project/go-clock v0.1.0 h1:SFbYIM75M8NnFm1yMHhN9Ahy3W5bEZV9gd6MPfXbKVU=
github.com/filecoin-project/go-clock v0.1.0/go.mod h1:4uB/O4PvOjlx1VCMdZ9MyDZXRm//gkj1ELEbxfI1AZs=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
Expand Down
4 changes: 2 additions & 2 deletions internal/runtime/writeback.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func newGatewayWritableBinding(ctx context.Context, opts gatewayWritableBindingO
return nil, fmt.Errorf("Gateway writable binding Spec and View do not match")
}
descriptor, _, err := maltcid.ParseRoot(opts.View.Root)
if err != nil || descriptor.Layout != maltcid.Prefix {
if err != nil || descriptor.Layout != maltcid.Map {
return nil, fmt.Errorf("Gateway writable binding requires an authenticated Prefix Root")
}
if nilInterface(opts.Base) || nilInterface(opts.Remote) || nilInterface(opts.Roots) || nilInterface(opts.WriterFactory) {
Expand Down Expand Up @@ -440,7 +440,7 @@ func validCandidateRoot(base, candidate cid.Cid) bool {
return false
}
next, _, err := maltcid.ParseRoot(candidate)
if err != nil || next.Layout != maltcid.Prefix {
if err != nil || next.Layout != maltcid.Map {
return false
}
old, _, err := maltcid.ParseRoot(base)
Expand Down
2 changes: 1 addition & 1 deletion internal/runtime/writeback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ func runtimeMALTMapRoot(t *testing.T, backend maltcid.BackendKind, marker byte)
if backend == maltcid.BackendKindIPA {
profile = maltcid.IPA256
}
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: profile}, commitment)
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: profile}, commitment)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions nodeapi/nodetest/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func RunAuthentication(t *testing.T, factory AuthenticationFactory) {
prepare := func(t *testing.T, label string) protocol.AuthenticationCandidate {
t.Helper()
state := engine.State{Descriptor: maltcid.RootDescriptor{
Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256,
Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256,
}, Entries: []engine.Entry{{Label: []byte(label), Target: cid.MustParse("bafkqaaa")}}}
candidate, err := sdk.Prepare(t.Context(), e, state)
if err != nil {
Expand Down Expand Up @@ -122,7 +122,7 @@ func RunAuthentication(t *testing.T, factory AuthenticationFactory) {
s := factory(t)
c := prepare(t, "unwritten")
bad := c
bad.State.Descriptor.Layout = maltcid.Positional
bad.State.Descriptor.Layout = maltcid.List
if _, err := s.MaterializeAuthentication(t.Context(), bad); err == nil {
t.Fatal("accepted mismatched Root/state descriptor")
}
Expand Down
2 changes: 1 addition & 1 deletion nodeapi/nodetest/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func RunDataset(t *testing.T, factory DatasetFactory) {
t.Fatal(err)
}
candidate, err := sdk.Prepare(t.Context(), e, engine.State{
Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256},
Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256},
Entries: []engine.Entry{{Label: []byte("file"), Target: target}},
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion transport/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

func TestAuthenticationTransportPreservesUint64AndRejectsChangedReceipt(t *testing.T) {
descriptor := maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.Positional, Profile: maltcid.IPA256}
descriptor := maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.List, Profile: maltcid.IPA256}
root, err := maltcid.NewRoot(descriptor, make([]byte, 32))
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion transport/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (a *recordingAuthorizer) Authorize(request *http.Request) error {

func testAuthenticationRoot(t *testing.T) cid.Cid {
t.Helper()
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, make([]byte, 32))
root, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.IPA256}, make([]byte, 32))
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions unixfs/authentication_adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func NewAuthenticationAdapter(layout LayoutKind, remote nodeapi.AuthenticationWr
}
func (a *AuthenticationAdapter) UpdateStagedRoot(ctx context.Context, previous cid.Cid, bindings map[string]string) (cid.Cid, error) {
rule := uint8(derivation.SHA256)
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: rule, Profile: a.profile}, Entries: []engine.Entry{}}
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: rule, Profile: a.profile}, Entries: []engine.Entry{}}
names := make([]string, 0, len(bindings))
for name := range bindings {
names = append(names, name)
Expand Down Expand Up @@ -125,7 +125,7 @@ func (a *AuthenticationAdapter) materialize(ctx context.Context, previous cid.Ci
return expected, nil
}
func (a *AuthenticationAdapter) CreatePositionalPayload(ctx context.Context, chunks []cid.Cid, payload cid.Cid) (cid.Cid, error) {
state := engine.State{Descriptor: maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.Positional, Profile: a.profile}, PayloadCID: payload, Entries: make([]engine.Entry, len(chunks))}
state := engine.State{Descriptor: maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.List, Profile: a.profile}, PayloadCID: payload, Entries: make([]engine.Entry, len(chunks))}
for i, target := range chunks {
state.Entries[i] = engine.Entry{Label: coordinate.EncodeIndex(uint64(i)), Target: target}
}
Expand Down
2 changes: 1 addition & 1 deletion unixfs/chunked_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ func WriteChunkedFile(ctx context.Context, blocks FileBlockStore, roots nodeapi.
if expected, err := nodeapi.CIDForBlock(nodeapi.Block{Data: metadata, Codec: cid.Raw}); err != nil || !expected.Equals(payload) {
return cid.Undef, nodeapi.ErrCorruptedBlock
}
return roots.BuildAuthentication(ctx, engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Positional, DerivationProfile: uint8(derivation.Direct), Profile: profile}, PayloadCID: payload, Entries: entries})
return roots.BuildAuthentication(ctx, engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.List, DerivationProfile: uint8(derivation.Direct), Profile: profile}, PayloadCID: payload, Entries: entries})
}
6 changes: 3 additions & 3 deletions unixfs/encrypted/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ func (r *profileRemote) MaterializeAuthentication(ctx context.Context, candidate
if err := authentication.Materialize(ctx, r.engine, candidate, r.nodes); err != nil {
return cid.Undef, err
}
if candidate.State.Descriptor.Layout == maltcid.Prefix {
if candidate.State.Descriptor.Layout == maltcid.Map {
bindings := make(map[string]string)
for _, entry := range candidate.State.Entries {
label := string(entry.Label)
Expand All @@ -883,11 +883,11 @@ func (g *substitutingGraph) MaterializeAuthentication(ctx context.Context, candi
if err != nil {
return cid.Undef, err
}
if candidate.State.Descriptor.Layout == maltcid.Prefix && g.substituteMap {
if candidate.State.Descriptor.Layout == maltcid.Map && g.substituteMap {
g.substituteMap = false
return cid.MustParse("bafkqaaa"), nil
}
if candidate.State.Descriptor.Layout == maltcid.Positional && g.substituteList {
if candidate.State.Descriptor.Layout == maltcid.List && g.substituteList {
g.substituteList = false
return cid.MustParse("bafkqaaa"), nil
}
Expand Down
4 changes: 2 additions & 2 deletions unixfs/encrypted/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ type CandidatePublisher interface {
}

func (g *recordingGraph) CreateStagedRoot(ctx context.Context, bindings map[string]string) (cid.Cid, error) {
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: g.profile}}
state := engine.State{Descriptor: maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: g.profile}}
names := make([]string, 0, len(bindings))
for name := range bindings {
names = append(names, name)
Expand All @@ -218,7 +218,7 @@ func (g *recordingGraph) CreateStagedRoot(ctx context.Context, bindings map[stri
return g.record(ctx, state)
}
func (g *recordingGraph) CreatePositionalPayload(ctx context.Context, chunks []cid.Cid, payload cid.Cid) (cid.Cid, error) {
state := engine.State{Descriptor: maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.Positional, Profile: g.profile}, PayloadCID: payload}
state := engine.State{Descriptor: maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.List, Profile: g.profile}, PayloadCID: payload}
for i, target := range chunks {
state.Entries = append(state.Entries, engine.Entry{Label: coordinate.EncodeIndex(uint64(i)), Target: target})
}
Expand Down
4 changes: 2 additions & 2 deletions unixfs/model/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func StorageKindFromCID(c cid.Cid) string {
return ""
}
switch descriptor.Layout {
case maltcid.Prefix:
case maltcid.Map:
return "prefix"
case maltcid.Positional:
case maltcid.List:
return "positional"
default:
return ""
Expand Down
4 changes: 2 additions & 2 deletions unixfs/model/storage_format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
)

func TestStorageKindFromCIDUsesTypedLayout(t *testing.T) {
mapRoot, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Prefix, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
mapRoot, err := maltcid.NewRoot(maltcid.RootDescriptor{Layout: maltcid.Map, DerivationProfile: uint8(derivation.SHA256), Profile: maltcid.KZG4096}, make([]byte, maltcid.KZGCommitmentSize))
if err != nil {
t.Fatal(err)
}
listRoot, err := maltcid.NewRoot(maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.Positional, Profile: maltcid.IPA256}, make([]byte, maltcid.IPACommitmentSize))
listRoot, err := maltcid.NewRoot(maltcid.RootDescriptor{DerivationProfile: uint8(derivation.Direct), Layout: maltcid.List, Profile: maltcid.IPA256}, make([]byte, maltcid.IPACommitmentSize))
if err != nil {
t.Fatal(err)
}
Expand Down
Loading
Loading