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

Input/Ordering Block Implementation #2055

Open
wants to merge 111 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
10362c9
WeakBlockAlgos
kushti Aug 22, 2023
76e2f60
Merge branch 'v5.0.15' of github.com:ergoplatform/ergo into weak-blocks
kushti Sep 12, 2023
c5d30d3
WeakBlockInfo, WeakBlockMessageSpec
kushti Sep 18, 2023
5c2eb29
impl steps
kushti Sep 28, 2023
d378942
Merge branch 'v5.0.16' of github.com:ergoplatform/ergo into weak-blocks
kushti Oct 25, 2023
8843114
initial weak blocks structures and algos
kushti Oct 30, 2023
5c4f9c2
compact block like messaging
kushti Oct 31, 2023
0dbfeb0
before structures
kushti Nov 1, 2023
1a68d0e
skeleton of processing algo
kushti Nov 4, 2023
1040926
weak blocks => sub blocks
kushti Nov 7, 2023
636f3d8
more weak=>sub renaming
kushti Nov 7, 2023
6293421
returning download plan
kushti Nov 7, 2023
23a5db0
better comments and todos, formatting
kushti Nov 9, 2023
2c5cf3c
motivation started in EIP, data structures refined
kushti Nov 10, 2023
4189783
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Nov 28, 2023
4962218
pow, superblocks
kushti Dec 1, 2023
514e6fb
subblocks section finished
kushti Dec 2, 2023
564ad05
propagation text started, prevSubBlockId made optional (comp fails)
kushti Dec 6, 2023
346e1a7
commitment
kushti Dec 21, 2023
a068545
styling fixes
kushti Dec 28, 2023
c0709f2
key spaces for sub-blocks and sidechains
kushti Dec 29, 2023
85de7a4
eip update
kushti Jan 3, 2024
a248ccf
dag note, new subsections added
kushti Jan 4, 2024
0a9fd56
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Feb 12, 2024
93bc6bc
merging w. master, accounting for optional prevSubBlockId
kushti Feb 12, 2024
02056c2
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Jul 17, 2024
92baed0
input/ordering blocks intro
kushti Jul 19, 2024
54c9971
script execution ctx started
kushti Jul 20, 2024
73d76f2
extending subblocks info
kushti Jul 24, 2024
69adf58
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Jul 30, 2024
bed12e6
SubsPerBlock* improved comments in SubBlockAlgos
kushti Jul 30, 2024
01da1a0
BlockKind, distnguishing fn
kushti Aug 3, 2024
e448fb8
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Aug 5, 2024
3e9f4d1
blockKind()
kushti Aug 6, 2024
1a8aaeb
unused reportModifierIsInvalid removed
kushti Aug 7, 2024
184996e
ProgressInfo.empty, removing implicit ScorexEncoder
kushti Aug 7, 2024
8bc72cc
MessageSpecInitial / MessageSpecSubBlock
kushti Aug 12, 2024
4192c61
merkle proof added to SubBlockInfo, serializer updated, SubBlockMessa…
kushti Aug 14, 2024
a044955
batch merkle proof usage and serialization
kushti Aug 29, 2024
613fc58
Merge branch 'jni-dep' of github.com:ergoplatform/ergo into weak-blocks
kushti Aug 29, 2024
c382a38
processSubblock started
kushti Sep 3, 2024
15ca997
subblock height check
kushti Sep 3, 2024
222c850
SubBlockTransactionsRequestSpec, completing processSubblock stub
kushti Sep 4, 2024
e6ee392
SubBlockTransactionsSpec
kushti Sep 5, 2024
fb98a2e
subblocks p2p logic stub
kushti Sep 8, 2024
95fb95e
LocallyGeneratedSubBlock
kushti Sep 13, 2024
5f66580
subblock keys, CandidateGenerator simplification
kushti Sep 13, 2024
f118879
more simplification in CandidateGenerator
kushti Sep 13, 2024
e8bcdfa
bestSubblock() stub. createCandidate #1
kushti Sep 13, 2024
647b6db
initial version of best subblock selection
kushti Sep 18, 2024
e93d333
merging w. 5.0.23
kushti Sep 19, 2024
e0feb83
input/ordering block distintcion in mining logic #1, input block gene…
kushti Sep 19, 2024
9ebe5db
subblocks generation
kushti Oct 1, 2024
5e623b4
fixing delivery of sub-blocks to processing
kushti Oct 1, 2024
c9de516
input block pow validation
kushti Oct 10, 2024
b908142
completeOrderingBlock / completeInputBlock
kushti Oct 10, 2024
08c52d6
sendInputToNodeView stub (pre-refactoring)
kushti Oct 15, 2024
ac824a4
LocallyGeneratedInputBlock / LocallyGeneratedOrderingBlock
kushti Oct 16, 2024
4fc43c5
reworked LocallyGeneratedInputBlock signature
kushti Oct 18, 2024
ef02664
forum post
kushti Oct 30, 2024
4011aa5
removing subblock field from Candidate
kushti Oct 30, 2024
e9811ce
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Dec 10, 2024
c81839d
papers/subblocks folder
kushti Dec 10, 2024
319f7a6
forming SubBlockInfo, SubBlockTransactionsData moved to completeInput…
kushti Dec 10, 2024
cac7cd1
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
kushti Dec 23, 2024
caf9f3f
subblock -> inputblock
kushti Dec 23, 2024
87a91d5
input blocks data pruning
kushti Dec 24, 2024
8e9d526
forming prevInputBlockId
kushti Dec 24, 2024
139d770
improving linking logic and code
kushti Dec 24, 2024
afb4ef4
refs, motivation rework
kushti Dec 28, 2024
8ed3749
EIP rework #1
kushti Dec 30, 2024
70c57c2
Transactions Handling
kushti Jan 1, 2025
d16aa23
Transactions Handling
kushti Jan 3, 2025
8d8afa5
propagation wip1
kushti Jan 3, 2025
3752b30
incentivization section
kushti Jan 4, 2025
e15dcd0
EIP alpha version
kushti Jan 4, 2025
7aae74a
update notes
kushti Jan 6, 2025
5d059f7
transactions handling section updatte
kushti Jan 7, 2025
7dfd05e
transactions handling update
kushti Jan 8, 2025
c5814df
input-block related extension fields
kushti Jan 9, 2025
251d097
generateCandidate comments
kushti Jan 10, 2025
7fd69ec
createCandidate refatoring
kushti Jan 10, 2025
b77765c
new extension fields stub
kushti Jan 10, 2025
7dcec20
forming prev input block id
kushti Jan 13, 2025
e34a181
comments for extension fields
kushti Jan 13, 2025
5773c17
reordering code before reworking forming transactions
kushti Jan 14, 2025
41f2d59
initial input/ordering txs split
kushti Jan 14, 2025
2245808
comments fix
kushti Jan 16, 2025
a4d892a
bestBlocks
kushti Jan 16, 2025
4633a5e
parentInputBlockIdOpt fix
kushti Jan 16, 2025
cebf363
transactionsCache
kushti Jan 16, 2025
8a4b690
input block id, prev link fix, accumulating ordering block transactions
kushti Jan 17, 2025
f687ca4
using previous ordering block transactions in orderingBlocktransactio…
kushti Jan 20, 2025
d0f7ca6
fixing subblocksPerBlock in checkNonces
kushti Jan 20, 2025
3288e61
checkInputBlockPoW & checkOrderingBlockPoW in AutolykosPowScheme
kushti Jan 20, 2025
879b50b
passing link to previous input block, clearing miner cache on input b…
kushti Jan 21, 2025
b689299
filtering out non-input transactions
kushti Jan 22, 2025
c77d30b
filtering out already included before collectTxs, id arg fix in apply…
kushti Jan 23, 2025
cac0278
real Merkle tree digests
kushti Jan 23, 2025
bca36db
NewBestInputBlock signal, /info field
kushti Jan 24, 2025
4988a6e
getInputBlock
kushti Jan 24, 2025
1aaa562
improving comments
kushti Jan 25, 2025
377d6c9
inputBlockParents stub
kushti Jan 27, 2025
c01a3d1
getBestInputBlocksChain
kushti Jan 27, 2025
9521425
bestInputBlock / bestInputChain
kushti Jan 28, 2025
49acb70
input blocks application tests plan
kushti Feb 4, 2025
be23a52
input blocks dag processing wip1
kushti Feb 4, 2025
d91fef6
check for best header for first subblock
kushti Feb 4, 2025
c19cc2e
handling missing parent wip1
kushti Feb 6, 2025
fa22cb8
first test in InputBlockProcessorSpecification, some fixes in ib appl…
kushti Feb 7, 2025
8e52469
chain of two input blocks and out of order application tests
kushti Feb 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge branch 'master' of github.com:ergoplatform/ergo into weak-blocks
  • Loading branch information
kushti committed Feb 12, 2024
commit 0a9fd56220f385e93bb9fd9edcfbed5ced8abd47
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.8, 2.12.10, 2.11.12]
scala: [2.13.12, 2.12.18, 2.11.12]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.10]
scala: [2.12.18]
java: [adopt@1.8]
runs-on: ${{ matrix.os }}
steps:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish release-binaries

on:
release:
types: [published]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
release-binaries:
name: Publish release binaries
runs-on: macos-latest
env:
ERGO_RELEASE_PLATFORM: macos-x64
ERGO_RELEASE_TAG: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Download ergo node jar
run: |
echo $GITHUB_REF
gh release download $ERGO_RELEASE_TAG -p "ergo*"
- name: Create release binary files
run: python ci/release-binaries.py
- name: Put binary files into release
run: gh release upload $ERGO_RELEASE_TAG $(echo $(find release -name "ergo-node-*"))
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ jobs:
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

- name: Publish release
- name: Publish ergo-wallet
run: sbt +ergoWallet/publishSigned sonatypeBundleRelease
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

- name: Publish ergo-core
run: sbt +ergoCore/publishSigned sonatypeBundleRelease
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ COPY build.sbt findbugs-exclude.xml ./
COPY project/ project/
COPY avldb/build.sbt avldb/build.sbt
COPY avldb/project/ avldb/project/
COPY ergo-core/build.sbt ergo-core/build.sbt
COPY ergo-core/project/ ergo-core/project/
COPY ergo-wallet/build.sbt ergo-wallet/build.sbt
COPY ergo-wallet/project/ ergo-wallet/project/
COPY benchmarks/build.sbt benchmarks/build.sbt
RUN sbt update
COPY . ./
RUN sbt assembly
Expand Down
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The details of the Ergo emission schedule and monetary supply can be found in th
* Telegram: https://t.me/ergoplatform

* Ecosystem: https://sigmaverse.io
*

* Github: https://github.com/ergoplatform/ergo

* Documents: https://ergoplatform.org/en/documents/
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Ergo utilizes three types of tests:

1) Unit and property tests: These can be run using the `sbt test` command.
2) Integration tests: These tests require Docker to be installed. Run them with the `sudo sbt it:test` command.
3) Bootstrapping tests: These tests are time-consuming as they verify that the node is syncing with the main network in various regimes. Docker is also required for these tests. Run them with the `sudo sbt it2:test` command.
3) Bootstrapping tests: These tests are time-consuming as they verify that the node is syncing with the main network in various modes. Docker is also required for these tests. Run them with the `sudo sbt it2:test` command.

## Setting up the Project in an IDE

Expand All @@ -86,9 +86,17 @@ Ensure that the project can be built with sbt before opening it in an IDE. You m

To open the project in IntelliJ IDEA, select File / Open and navigate to the project folder. This will initiate the Project Import Wizard, which uses the SBT configuration (build.sbt file) to generate the project configuration files for IDEA. You can view the project configuration in the `File / Project Structure...` dialog. If the import is successful, you should be able to compile the project in the IDE.

## Modules

This repository has modular structure, so only parts which are needed for an application could be used:

* [avldb](avldb/README.md) - implementation of authenticated AVL+ tree used in Ergo, with persistence
* [ergo-core](ergo-core/README.md) - functionality needed for an SPV client (P2P messages, block section stuctures, PoW, NiPoPoW)
* ergo-wallet - Java and Scala functionalities to sign and verify transactions

## Contributing to Ergo

Ergo is an open-source project and we welcome contributions from developers and testers! Join the discussion on [Ergo Discord](https://discord.gg/kj7s7nb) in the #development channel and check out our [Contributing documentation](https://docs.ergoplatform.com/contribute/).
Ergo is an open-source project and we welcome contributions from developers and testers! Join the discussion over [Ergo Discord](https://discord.gg/kj7s7nb) in #development channel, or Telegram: https://t.me/ErgoDevelopers. Please also check out our [Contributing documentation](https://docs.ergoplatform.com/contribute/).

## Frequently Asked Questions

Expand Down
33 changes: 21 additions & 12 deletions avldb/build.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
import sbt.Keys.testFrameworks

val scala211 = "2.11.12"
val scala212 = "2.12.18"
val scala213 = "2.13.12"

name := "avldb"

val Versions = new {

val spire = (scalaVersion: String) =>
if (scalaVersion == scala213) "0.17.0"
else "0.14.1"

val scalameter = (scalaVersion: String) =>
if (scalaVersion == scala213) "0.19"
else "0.9"
}

libraryDependencies ++= Seq(
"javax.xml.bind" % "jaxb-api" % "2.4.0-b180830.0359",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"com.google.guava" % "guava" % "23.0",
"org.scorexfoundation" %% "scrypto" % "2.3.0"
)

libraryDependencies ++= Seq(
"org.scorexfoundation" %% "scrypto" % "2.3.0",
"org.scalatest" %% "scalatest" % "3.1.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.3" % "test",
"org.scalatestplus" %% "scalatestplus-scalacheck" % "3.1.0.0-RC2" % Test,
"com.storm-enroute" %% "scalameter" % "0.9" % "test"
)

libraryDependencies ++= Seq(
"com.storm-enroute" %% "scalameter" % Versions.scalameter(scalaVersion.value) % "test",
"org.ethereum" % "leveldbjni-all" % "1.18.3",
"org.typelevel" %% "spire" % "0.14.1"
"org.typelevel" %% "spire" % Versions.spire(scalaVersion.value)
)

testOptions in Test := Seq(Tests.Filter(t => !t.matches(".*Benchmark$")))
Expand All @@ -38,13 +47,13 @@ publishTo := {

pomIncludeRepository := { _ => false }

scalacOptions ++= Seq("-Xfatal-warnings", "-feature", "-deprecation")
scalacOptions ++= Seq("-feature", "-deprecation")

// set bytecode version to 8 to fix NoSuchMethodError for various ByteBuffer methods
// see https://github.com/eclipse/jetty.project/issues/3244
// these options applied only in "compile" task since scalac crashes on scaladoc compilation with "-release 8"
// see https://github.com/scala/community-builds/issues/796#issuecomment-423395500
scalacOptions in(Compile, compile) ++= Seq("-release", "8")
scalacOptions --= Seq("-Ywarn-numeric-widen", "-Ywarn-value-discard")
scalacOptions in(Compile, compile) ++= (if (scalaBinaryVersion.value == "2.11") Seq() else Seq("-release", "8"))
scalacOptions --= Seq("-Ywarn-numeric-widen", "-Ywarn-value-discard", "-Ywarn-unused:params", "-Xfatal-warnings")

enablePlugins(ReproducibleBuildsPlugin)
2 changes: 1 addition & 1 deletion avldb/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.1
sbt.version=1.2.8
2 changes: 0 additions & 2 deletions avldb/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ logLevel := Level.Warn

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")

addSbtPlugin("com.github.tkawachi" % "sbt-lock" % "0.4.0")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scorex.core.serialization
package org.ergoplatform.serialization

import java.nio.ByteBuffer
import scorex.util.ByteArrayBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scorex.core.serialization
package org.ergoplatform.serialization

import scorex.crypto.authds.avltree.batch.Constants.DigestType
import scorex.crypto.authds.avltree.batch.serialization.{BatchAVLProverManifest, ProxyInternalNode}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scorex.core.serialization
package org.ergoplatform.serialization

import scorex.crypto.authds.avltree.batch.Constants.DigestType
import scorex.crypto.authds.avltree.batch.{InternalProverNode, ProverLeaf, ProverNodes, VersionedLDBAVLStorage}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package scorex.crypto.authds.avltree.batch

import com.google.common.primitives.Ints
import scorex.core.serialization.ErgoSerializer
import org.ergoplatform.serialization.ErgoSerializer
import scorex.crypto.authds.{ADKey, ADValue, Balance}
import scorex.crypto.authds.avltree.batch.Constants.{DigestType, hashFn}
import scorex.crypto.authds.avltree.batch.serialization.ProxyInternalNode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class VersionedLDBAVLStorage(store: LDBVersionedStore)
}

def dumpSubtree(sid: DigestType): Try[Unit] = {
val builder = mutable.ArrayBuilder.make[Byte]()
val builder = new mutable.ArrayBuilder.ofByte
builder.sizeHint(200000)
subtreeLoop(sid, builder)
dumpStorage.insert(sid, builder.result())
Expand All @@ -141,7 +141,7 @@ class VersionedLDBAVLStorage(store: LDBVersionedStore)

require(rootNodeLabel.sameElements(expectedRootHash), "Root node hash changed")

val manifestBuilder = mutable.ArrayBuilder.make[Byte]()
val manifestBuilder = new mutable.ArrayBuilder.ofByte
manifestBuilder.sizeHint(200000)
manifestBuilder += rootNodeHeight
manifestBuilder += manifestDepth
Expand Down
12 changes: 6 additions & 6 deletions avldb/src/main/scala/scorex/db/ByteArrayUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package scorex.db

object ByteArrayUtils {

import java.util.Comparator

// Java comparator
val BYTE_ARRAY_COMPARATOR: Comparator[Array[Byte]] = (o1: Array[Byte], o2: Array[Byte]) => compare(o1, o2)

object BYTE_ARRAY_COMPARATOR extends Ordering[Array[Byte]] {
def compare(o1: Array[Byte], o2: Array[Byte]) = compare(o1, o2)
}
// Scala comparator
implicit val ByteArrayOrdering: Ordering[Array[Byte]] =
(o1: Array[Byte], o2: Array[Byte]) => ByteArrayUtils.compare(o1, o2)
implicit object ByteArrayOrdering extends Ordering[Array[Byte]] {
def compare(o1: Array[Byte], o2: Array[Byte]) = ByteArrayUtils.compare(o1, o2)
}

def compare(o1: Array[Byte], o2: Array[Byte]): Int = {
val len = Math.min(o1.length, o2.length)
Expand Down
2 changes: 1 addition & 1 deletion avldb/src/main/scala/scorex/db/LDBKVStore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class LDBKVStore(protected val db: DB) extends KVStoreReader with ScorexLogging
breakable {
while (i.hasNext) {
val key = i.next().getKey
if (ByteArrayUtils.compare(key, last) <= 0) res = Some(key) else break
if (ByteArrayUtils.compare(key, last) <= 0) res = Some(key) else break()
}
}
res
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.scalatest.Assertion
import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scorex.core.serialization.{ManifestSerializer, SubtreeSerializer}
import org.ergoplatform.serialization.{ManifestSerializer, SubtreeSerializer}
import scorex.crypto.authds.avltree.batch.helpers.TestHelper
import scorex.crypto.authds.{ADDigest, ADKey, ADValue, SerializedAdProof}
import scorex.util.encode.Base16
Expand Down
11 changes: 7 additions & 4 deletions avldb/src/test/scala/scorex/db/ByteArrayUtilsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.propspec.AnyPropSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks

import scala.math.Ordering.Implicits._

class ByteArrayUtilsSpec extends AnyPropSpec with ScalaCheckPropertyChecks with Matchers {

lazy val nonEmptyBytesGen: Gen[Array[Byte]] = Gen.nonEmptyListOf(Arbitrary.arbitrary[Byte])
.map(_.toArray).suchThat(_.length > 0)

property("compare works properly") {

//Simple and inefficient way to order byte arrays, based on
// https://stackoverflow.com/questions/7109943/how-to-define-orderingarraybyte
// but we compare unsigned bytes
val ordering: Ordering[Array[Byte]] = Ordering.by((_: Array[Byte]).toIterable.map(_ & 0xFF))
val ordering: Ordering[Array[Byte]] =
new Ordering[Array[Byte]] {
override def compare(o1: Array[Byte], o2: Array[Byte]): Int =
implicitly[Ordering[Seq[Int]]].compare(o1.toSeq.map(_ & 0xFF), o2.toSeq.map(_ & 0xFF))
}

forAll(nonEmptyBytesGen, nonEmptyBytesGen) { case (bs1, bs2) =>
val efficientOrdering = Seq(bs1, bs2).sorted(ByteArrayUtils.ByteArrayOrdering)
Expand Down
11 changes: 0 additions & 11 deletions benchmarks/Jenkinsfile

This file was deleted.

6 changes: 0 additions & 6 deletions benchmarks/build.sbt

This file was deleted.

27 changes: 0 additions & 27 deletions benchmarks/src/test/resources/logback-bench.xml

This file was deleted.

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.