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

Candidate for 5.0.19 release #2091

Merged
merged 36 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6b02f04
Make ergo-core, avldb compile to 2.13
ccellado Nov 29, 2023
461c53e
Make ergo-core, avldb compile to 2.13
ccellado Nov 29, 2023
69ae410
Make ergo-core, avldb compile to 2.13 and 2.11
ccellado Nov 30, 2023
4071ab5
Add release binaries workflow and scripts
ccellado Dec 13, 2023
a8c3eb8
Add release binaries workflow and scripts
ccellado Dec 13, 2023
a20a334
Add release binaries workflow and scripts
ccellado Dec 13, 2023
30e4df2
Add release binaries workflow and scripts
ccellado Dec 13, 2023
043b3ad
Add release binaries workflow and scripts
ccellado Dec 13, 2023
79f4e4a
Add release binaries workflow and scripts
ccellado Dec 13, 2023
7aedd43
Add release binaries workflow and scripts
ccellado Dec 13, 2023
7865dd4
Make ergo-core, avldb compile to 2.13
ccellado Nov 29, 2023
02a1b8d
Merge remote-tracking branch 'origin/ergo-core-213' into ergo-core-213
ccellado Dec 20, 2023
a212958
Cleanup
ccellado Dec 20, 2023
c1b3554
Add release binaries workflow and scripts
ccellado Dec 13, 2023
c9faf3b
Add release binaries workflow and scripts
ccellado Dec 13, 2023
a0feb3d
Add release binaries workflow and scripts
ccellado Dec 13, 2023
8eaf7c3
Add release binaries workflow and scripts
ccellado Dec 13, 2023
16a2e5f
Add release binaries workflow and scripts
ccellado Dec 13, 2023
f941614
Add release binaries workflow and scripts
ccellado Dec 13, 2023
0a0e4ad
Add release binaries workflow and scripts
ccellado Dec 13, 2023
85c8824
Merge remote-tracking branch 'origin/release-binaries' into release-b…
ccellado Dec 20, 2023
8be41ad
Fix compilation of ergo-core, avldb to 2.11 & 2.13
ccellado Dec 21, 2023
b8a8e08
Fix compilation of ergo-core, avldb to 2.11 & 2.13
ccellado Dec 21, 2023
9883c4d
Fix akka specific logging
ccellado Dec 21, 2023
3209fa3
5.0.19 version set
kushti Dec 22, 2023
de98585
Merge pull request #2082 from ccellado/release-binaries
kushti Dec 26, 2023
4ef746d
Fix ci
ccellado Dec 26, 2023
55d0c3e
Fix ci
ccellado Dec 26, 2023
7beafc0
Minor cleanup
ccellado Dec 26, 2023
c410aaa
Minor cleanup
ccellado Dec 26, 2023
373d460
Minor cleanup
ccellado Dec 26, 2023
0cd8b30
Merge pull request #2081 from ccellado/ergo-core-213
kushti Dec 28, 2023
65e948e
Fixed empty address bug in blockchain API
jellymlg Jan 8, 2024
4930017
Merge pull request #2094 from ergoplatform/extra-api-bugfix
kushti Jan 11, 2024
3ae2349
Merge pull request #2090 from ccellado/akka-logging-fix
kushti Jan 12, 2024
d099ed4
removed unused umports
kushti Jan 17, 2024
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
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-*"))
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)
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
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
25 changes: 15 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ logLevel := Level.Debug

// this values should be in sync with ergo-wallet/build.sbt
val scala211 = "2.11.12"
val scala212 = "2.12.10"
val scala213 = "2.13.8"
val scala212 = "2.12.18"
val scala213 = "2.13.12"

lazy val commonSettings = Seq(
organization := "org.ergoplatform",
Expand Down Expand Up @@ -44,16 +44,10 @@ val ficusVersion = "1.4.7"
val effectiveSigmaStateVersion = Option(System.getenv().get("SIGMASTATE_VERSION")).getOrElse(sigmaStateVersion)
val effectiveSigma = "org.scorexfoundation" %% "sigma-state" % effectiveSigmaStateVersion


libraryDependencies ++= Seq(
effectiveSigma.force()
.exclude("ch.qos.logback", "logback-classic")
.exclude("org.scorexfoundation", "scrypto"),

// api dependencies
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,

"ch.qos.logback" % "logback-classic" % "1.3.5",

Expand Down Expand Up @@ -208,14 +202,17 @@ scapegoatDisabledInspections := Seq("FinalModifierOnCaseClass")
Test / testOptions := Seq(Tests.Filter(s => !s.endsWith("Bench")))

lazy val avldb = (project in file("avldb"))
.disablePlugins(ScapegoatSbtPlugin) // not compatible with crossScalaVersions
.settings(
crossScalaVersions := Seq(scala213, scalaVersion.value, scala211),
commonSettings,
name := "avldb",
// 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 in(Compile, compile) ++= (if (scalaBinaryVersion.value == "2.11") Seq() else Seq("-release", "8")),
scalacOptions in(Compile, compile) --= scalacOpts,
javacOptions in(Compile, compile) ++= javacReleaseOption,
libraryDependencies ++= Seq(
// database dependencies
Expand Down Expand Up @@ -244,17 +241,19 @@ lazy val avldb_benchmarks = (project in file("avldb/benchmarks"))
.enablePlugins(JmhPlugin)

lazy val ergoCore = (project in file("ergo-core"))
.disablePlugins(ScapegoatSbtPlugin) // not compatible with crossScalaVersions
.dependsOn(avldb % "test->test;compile->compile")
.dependsOn(ergoWallet % "test->test;compile->compile")
.settings(
crossScalaVersions := Seq(scala213, scalaVersion.value, scala211),
commonSettings,
name := "ergo-core",
libraryDependencies ++= Seq(
"com.iheart" %% "ficus" % ficusVersion,
effectiveSigma,
(effectiveSigma % Test).classifier("tests")
),
scalacOptions in(Compile, compile) ++= Seq("-release", "8"),
scalacOptions in(Compile, compile) ++= (if (scalaBinaryVersion.value == "2.11") Seq() else Seq("-release", "8")),
scalacOptions in(Compile, compile) --= scalacOpts,
)

Expand Down Expand Up @@ -293,12 +292,18 @@ lazy val ergo = (project in file("."))
scalacOptions in(Compile, compile) ++= Seq("-release", "8"),
javacOptions in(Compile, compile) ++= javacReleaseOption,
libraryDependencies ++= Seq(
// api dependencies
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
// network dependencies
"com.typesafe.akka" %% "akka-stream" % akkaVersion, // required for akka-http to compile
"com.typesafe.akka" %% "akka-actor" % akkaVersion, // required for akka-http to compile
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-http-core" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-parsing" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,

"org.bitlet" % "weupnp" % "0.1.4",
// command line args parsing
"com.github.scopt" %% "scopt" % "4.0.1",
Expand Down
Binary file added ci/ergo.icns
Binary file not shown.
Loading
Loading