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

Update feature/array-map-inlining (atree inlining feature branch) #428

Merged

Conversation

fxamacker
Copy link
Member

@fxamacker fxamacker commented Jul 25, 2024

Merge main into feature/array-map-inlining

Conflict resolution
commit 691b753e2bf3cf558fbed962b3d9661d76bbb159
Merge: 0db5873 cd3b153
Author: Faye Amacker <[email protected]>
Date:   Thu Jul 25 10:03:57 2024 -0500

    Merge branch 'main' into fxamacker/update-array-map-inlining

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
remerge CONFLICT (content): Merge conflict in .github/workflows/ci.yml
index 2a58a74..081dca1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -30,13 +30,8 @@ jobs:
 
     strategy:
       matrix:
-<<<<<<< 0db5873 (Merge pull request #415 from onflow/fxamacker/update-copyright)
         os: [ubuntu-latest]
         go-version: ['1.20', 1.21]
-=======
-        os: [macos-latest, ubuntu-latest]
-        go-version: [1.19, '1.20']
->>>>>>> cd3b153 (Merge pull request #426 from onflow/dependabot/github_actions/github/codeql-action-3.25.13)
 
     steps:
     - name: Install Go
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
remerge CONFLICT (content): Merge conflict in .github/workflows/coverage.yml
index 22096fa..37d77fa 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -22,10 +22,6 @@ jobs:
 
       - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
         with:
-<<<<<<< 0db5873 (Merge pull request #415 from onflow/fxamacker/update-copyright)
-          go-version: '1.20'
-=======
->>>>>>> cd3b153 (Merge pull request #426 from onflow/dependabot/github_actions/github/codeql-action-3.25.13)
           check-latest: true
 
       - name: Get dependencies
diff --git a/cmd/main/main.go b/cmd/main/main.go
deleted file mode 100644
remerge CONFLICT (modify/delete): cmd/main/main.go deleted in 0db5873 (Merge pull request #415 from onflow/fxamacker/update-copyright) and modified in cd3b153 (Merge pull request #426 from onflow/dependabot/github_actions/github/codeql-action-3.25.13).  Version cd3b153 (Merge pull request #426 from onflow/dependabot/github_actions/github/codeql-action-3.25.13) of cmd/main/main.go left in tree.
index 3f3aa1c..0000000
--- a/cmd/main/main.go
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Atree - Scalable Arrays and Ordered Maps
- *
- * Copyright Flow Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package main
-
-import (
-	"flag"
-	"fmt"
-
-	"github.com/onflow/atree"
-
-	"github.com/fxamacker/cbor/v2"
-)
-
-const cborTagUInt64Value = 164
-
-type Uint64Value uint64
-
-var _ atree.Value = Uint64Value(0)
-var _ atree.Storable = Uint64Value(0)
-
-func (v Uint64Value) ChildStorables() []atree.Storable {
-	return nil
-}
-
-func (v Uint64Value) StoredValue(_ atree.SlabStorage) (atree.Value, error) {
-	return v, nil
-}
-
-func (v Uint64Value) Storable(_ atree.SlabStorage, _ atree.Address, _ uint64) (atree.Storable, error) {
-	return v, nil
-}
-
-// Encode encodes UInt64Value as
-//
-//	cbor.Tag{
-//			Number:  cborTagUInt64Value,
-//			Content: uint64(v),
-//	}
-func (v Uint64Value) Encode(enc *atree.Encoder) error {
-	err := enc.CBOR.EncodeRawBytes([]byte{
-		// tag number
-		0xd8, cborTagUInt64Value,
-	})
-	if err != nil {
-		return err
-	}
-	return enc.CBOR.EncodeUint64(uint64(v))
-}
-
-// TODO: cache size
-func (v Uint64Value) ByteSize() uint32 {
-	// tag number (2 bytes) + encoded content
-	return 2 + atree.GetUintCBORSize(uint64(v))
-}
-
-func (v Uint64Value) String() string {
-	return fmt.Sprintf("%d", uint64(v))
-}
-
-type testTypeInfo struct{}
-
-var _ atree.TypeInfo = testTypeInfo{}
-
-func (testTypeInfo) Encode(e *cbor.StreamEncoder) error {
-	return e.EncodeUint8(42)
-}
-
-func (i testTypeInfo) Equal(other atree.TypeInfo) bool {
-	_, ok := other.(testTypeInfo)
-	return ok
-}
-
-func decodeStorable(dec *cbor.StreamDecoder, _ atree.SlabID) (atree.Storable, error) {
-	tagNumber, err := dec.DecodeTagNumber()
-	if err != nil {
-		return nil, err
-	}
-
-	switch tagNumber {
-	case atree.CBORTagSlabID:
-		return atree.DecodeSlabIDStorable(dec)
-
-	case cborTagUInt64Value:
-		n, err := dec.DecodeUint64()
-		if err != nil {
-			return nil, err
-		}
-		return Uint64Value(n), nil
-
-	default:
-		return nil, fmt.Errorf("invalid tag number %d", tagNumber)
-	}
-}
-
-// TODO: implement different slab size for metadata slab and data slab.
-func main() {
-	var slabSize uint64
-	var numElements uint64
-	var verbose bool
-
-	flag.Uint64Var(&slabSize, "size", 1024, "slab size in bytes")
-	flag.Uint64Var(&numElements, "count", 500, "number of elements in array")
-	flag.BoolVar(&verbose, "verbose", false, "verbose output")
-
-	flag.Parse()
-
-	minThreshold, maxThreshold, _, _ := atree.SetThreshold(slabSize)
-
-	fmt.Printf(
-		"Inserting %d elements (uint64) into array with slab size %d, min size %d, and max size %d ...\n",
-		numElements,
-		slabSize,
-		minThreshold,
-		maxThreshold,
-	)
-
-	encMode, err := cbor.EncOptions{}.EncMode()
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-
-	decMode, err := cbor.DecOptions{}.DecMode()
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-
-	storage := atree.NewBasicSlabStorage(encMode, decMode, decodeStorable, decodeTypeInfo)
-
-	typeInfo := testTypeInfo{}
-
-	address := atree.Address{1, 2, 3, 4, 5, 6, 7, 8}
-
-	array, err := atree.NewArray(storage, address, typeInfo)
-
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-
-	for i := uint64(0); i < numElements; i++ {
-		err := array.Append(Uint64Value(i))
-		if err != nil {
-			fmt.Println(err)
-			return
-		}
-	}
-
-	stats, err := atree.GetArrayStats(array)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-
-	fmt.Printf("%+v\n", stats)
-
-	if verbose {
-		fmt.Printf("\n\n=========== array layout ===========\n")
-		atree.PrintArray(array)
-	}
-}
-
-func decodeTypeInfo(_ *cbor.StreamDecoder) (atree.TypeInfo, error) {
-	return testTypeInfo{}, nil
-}
______
  • Targeted PR against main branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

fxamacker and others added 30 commits December 20, 2023 11:03
Bump actions/checkout from v3 to v4.1.1 and pin it.
Pin actions/setup and bump Go from 1.19 to 1.20.
Pinned:

codeql-action/init@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5

codeql-action/autobuild@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5

codeql-action/analyze@7e187e1c529d80bac7b87a16e7a792427f65cf02 # v2.15.5
Pin dependencies:
- actions/checkout
- actions/setup-go
- codecov/codecov-action

Use default Go version instead of specifying go-1.19
because ubuntu-latest will bump go-1.19 to 1.21 this month.
Pin dependencies:
- actions/setup-go
- actions/checkout

Bump go versions tested to go-1.19 and go-1.20.
Fix Go version 1.20 being interpreted as 1.2 by using quotes.
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 4.0.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v3.1.4...v4.0.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
…/codecov-action-4.0.2

Bump codecov/codecov-action from 3.1.4 to 4.0.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.4 to 1.9.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.8.4...v1.9.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…stretchr/testify-1.9.0

Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.6 to 3.24.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@8a470fd...05963f4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.24.8

Bump github/codeql-action from 3.24.6 to 3.24.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.8 to 3.24.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@05963f4...1b1aada)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.24.9

Bump github/codeql-action from 3.24.8 to 3.24.9
Bumps [lukechampine.com/blake3](https://github.com/lukechampine/blake3) from 1.2.1 to 1.2.2.
- [Commits](lukechampine/blake3@v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: lukechampine.com/blake3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.9 to 3.24.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@1b1aada...4355270)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.0.1 to 4.2.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@e0b68c6...7afa10e)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.24.10

Bump github/codeql-action from 3.24.9 to 3.24.10
…/codecov-action-4.2.0

Bump codecov/codecov-action from 4.0.1 to 4.2.0
…e.com/blake3-1.2.2

Bump lukechampine.com/blake3 from 1.2.1 to 1.2.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@4355270...df5a14d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@7afa10e...8450866)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.0

Bump github/codeql-action from 3.24.10 to 3.25.0
dependabot bot and others added 24 commits May 27, 2024 14:31
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.5 to 3.25.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@b7cec75...9fdb3e4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.6

Bump github/codeql-action from 3.25.5 to 3.25.6
…e.com/blake3-1.3.0

Bump lukechampine.com/blake3 from 1.2.2 to 1.3.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.6 to 3.25.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@9fdb3e4...f079b84)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.7

Bump github/codeql-action from 3.25.6 to 3.25.7
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.7 to 3.25.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@f079b84...2e230e8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.8

Bump github/codeql-action from 3.25.7 to 3.25.8
Update copyright notice to Flow Foundation (in main branch)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@125fc84...e28ff12)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.8 to 3.25.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@2e230e8...23acc5c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.10

Bump github/codeql-action from 3.25.8 to 3.25.10
…/codecov-action-4.5.0

Bump codecov/codecov-action from 4.4.1 to 4.5.0
Bump golangci-lint to 1.56.2.
Bump go to 1.22.

This workflow is copied from fxamacker/cbor and these versions are also the same currently used by large open source projects.
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@23acc5c...b611370)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.11

Bump github/codeql-action from 3.25.10 to 3.25.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.11 to 3.25.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@b611370...4fa2a79)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…codeql-action-3.25.12

Bump github/codeql-action from 3.25.11 to 3.25.12
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4.1.1...692973e)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.12 to 3.25.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@4fa2a79...2d79040)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…/checkout-4.1.7

Bump actions/checkout from 4.1.1 to 4.1.7
…codeql-action-3.25.13

Bump github/codeql-action from 3.25.12 to 3.25.13
@fxamacker fxamacker merged commit caf04d2 into feature/array-map-inlining Jul 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants