Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2fb971c
put tree version into Ergo tree in /script/p2s
kushti Oct 26, 2025
91aa805
testnet60 settings
kushti Nov 16, 2025
e6a6b57
Tests synthetic network type
kushti Nov 17, 2025
1a09fb4
Added new route to create mining candidate with transactions under a …
K-Singh Nov 22, 2025
d9794df
Fixed small bugs related to GenerateCandidate params
K-Singh Dec 15, 2025
2f58743
6.0.3 version set
kushti Jan 22, 2026
b1739cb
jdk in dockerfile updated
kushti Jan 28, 2026
8529c67
Merge pull request #2294 from ergoplatform/ittest
kushti Jan 28, 2026
1a10daa
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into testnet60
kushti Feb 2, 2026
dc41142
removing outdated test on mining after v2activationheight (which is w…
kushti Feb 4, 2026
9dc5145
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into p2stv
kushti Feb 4, 2026
b0a5f61
Merge pull request #2287 from Lithos-Protocol/master
kushti Feb 26, 2026
2ebaddf
Merge pull request #2252 from ergoplatform/testnet60
kushti Feb 26, 2026
39f8011
Merge pull request #2247 from ergoplatform/p2stv
kushti Feb 26, 2026
d935117
Do not try to mine when the blockchain is not synced - initial approach
kushti Mar 4, 2026
a6c2955
Merge branch 'master' of github.com:ergoplatform/ergo into v6.0.3
kushti Mar 4, 2026
dfe6903
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into v6.0.3
kushti Mar 4, 2026
247cfeb
new tests
kushti Mar 4, 2026
ca358f6
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into i2238
kushti Mar 28, 2026
4cfe14e
persistentProver.synchronized in proofsForTransactions
kushti Mar 28, 2026
47b4464
logging tx parsing failure reason
kushti Mar 28, 2026
be984aa
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into i2238
kushti Mar 28, 2026
124f61e
6 blocks diff, nicer log messages
kushti Apr 3, 2026
b494c23
more candidate generation tests
kushti Apr 7, 2026
1c90af8
remove outdated test
kushti Apr 9, 2026
af0f343
Merge pull request #2295 from ergoplatform/i2238
kushti Apr 9, 2026
591634e
outdated test removed
kushti Apr 10, 2026
e334bc9
Merge branch 'v6.0.3' of github.com:ergoplatform/ergo into v6.0.3
kushti Apr 10, 2026
844027d
sigmastate dependency update
kushti Apr 15, 2026
3b22769
testing logic in CandidateGeneratorSpec improved
kushti Apr 17, 2026
a21ece6
duplicate ids fix
kushti Apr 22, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ devnet
.ensime_cache/
scorex.yaml

# LLM reports on code analysis etc
llm_generated

# scala build folders
target

Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val circeVersion = "0.13.0"
val akkaVersion = "2.6.10"
val akkaHttpVersion = "10.2.4"

val sigmaStateVersion = "6.0.2"
val sigmaStateVersion = "6.0.3"
val ficusVersion = "1.4.7"

// for testing current sigmastate build (see sigmastate-ergo-it jenkins job)
Expand Down Expand Up @@ -185,7 +185,7 @@ docker / dockerfile := {
val configMainNet = (IntegrationTest / resourceDirectory).value / "mainnetTemplate.conf"

new Dockerfile {
from("openjdk:11-jre-slim")
from("eclipse-temurin:11-jre-jammy")
label("ergo-integration-tests", "ergo-integration-tests")
add(assembly.value, "/opt/ergo/ergo.jar")
add(Seq(configDevNet), "/opt/ergo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object MainnetLaunchParameters extends Parameters(height = 0,
* Parameters corresponding to the genesis block in the public testnet
*/
object TestnetLaunchParameters extends Parameters(height = 0,
parametersTable = Parameters.DefaultParameters,
proposedUpdate = ErgoValidationSettingsUpdate.empty)
parametersTable = Parameters.DefaultParameters.updated(Parameters.BlockVersion, Header.Interpreter60Version),
proposedUpdate = ErgoValidationSettingsUpdate(Seq(215, 409), Seq.empty))

/**
* Initial parameters corresponding to a devnet which is starting with 5.0 activated
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package org.ergoplatform.settings

import org.ergoplatform.modifiers.history.header.Header
import org.ergoplatform.utils.ErgoCorePropertyTest

class LaunchParametersSpec extends ErgoCorePropertyTest {

property("MainnetLaunchParameters should have default block version") {
MainnetLaunchParameters.blockVersion shouldBe Parameters.DefaultParameters(Parameters.BlockVersion)
}

property("MainnetLaunchParameters should have empty validation settings update") {
MainnetLaunchParameters.proposedUpdate shouldBe ErgoValidationSettingsUpdate.empty
}

property("MainnetLaunchParameters should have height 0") {
MainnetLaunchParameters.height shouldBe 0
}

property("TestnetLaunchParameters should have block version set to Interpreter60Version") {
TestnetLaunchParameters.blockVersion shouldBe Header.Interpreter60Version
}

property("TestnetLaunchParameters should have validation settings update with rules 215 and 409") {
TestnetLaunchParameters.proposedUpdate.rulesToDisable should contain theSameElementsAs Seq(215, 409)
}

property("TestnetLaunchParameters should have empty status updates") {
TestnetLaunchParameters.proposedUpdate.statusUpdates shouldBe empty
}

property("TestnetLaunchParameters should have height 0") {
TestnetLaunchParameters.height shouldBe 0
}

property("DevnetLaunchParameters should have block version set to Interpreter50Version") {
DevnetLaunchParameters.blockVersion shouldBe Header.Interpreter50Version
}

property("DevnetLaunchParameters should have empty validation settings update") {
DevnetLaunchParameters.proposedUpdate shouldBe ErgoValidationSettingsUpdate.empty
}

property("DevnetLaunchParameters should have height 0") {
DevnetLaunchParameters.height shouldBe 0
}

property("Devnet60LaunchParameters should have block version set to Interpreter60Version") {
Devnet60LaunchParameters.blockVersion shouldBe Header.Interpreter60Version
}

property("Devnet60LaunchParameters should have empty validation settings update") {
Devnet60LaunchParameters.proposedUpdate shouldBe ErgoValidationSettingsUpdate.empty
}

property("Devnet60LaunchParameters should have height 0") {
Devnet60LaunchParameters.height shouldBe 0
}

property("all launch parameters should have valid height") {
Seq(
MainnetLaunchParameters,
TestnetLaunchParameters,
DevnetLaunchParameters,
Devnet60LaunchParameters
).foreach(_.height shouldBe 0)
}

property("TestnetLaunchParameters should differ from MainnetLaunchParameters") {
TestnetLaunchParameters.blockVersion should not be MainnetLaunchParameters.blockVersion
TestnetLaunchParameters.proposedUpdate should not be MainnetLaunchParameters.proposedUpdate
}

property("Devnet60LaunchParameters should have same block version as TestnetLaunchParameters") {
Devnet60LaunchParameters.blockVersion shouldBe TestnetLaunchParameters.blockVersion
}

property("DevnetLaunchParameters should have different block version than Devnet60LaunchParameters") {
DevnetLaunchParameters.blockVersion should not be Devnet60LaunchParameters.blockVersion
}

property("parameters table should contain BlockVersion for all launch parameters") {
Seq(
MainnetLaunchParameters,
TestnetLaunchParameters,
DevnetLaunchParameters,
Devnet60LaunchParameters
).foreach { params =>
params.parametersTable should contain key Parameters.BlockVersion
}
}

}
9 changes: 4 additions & 5 deletions src/it/scala/org/ergoplatform/it/container/Docker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.typesafe.config.{Config, ConfigFactory, ConfigRenderOptions}
import net.ceedubs.ficus.Ficus._
import org.apache.commons.io.FileUtils
import org.asynchttpclient.Dsl.{config, _}
import org.ergoplatform.settings.NetworkType.{DevNet, DevNet60, MainNet, TestNet}
import org.ergoplatform.settings.NetworkType.{DevNet, DevNet60, MainNet, TestNet, Tests}
import org.ergoplatform.settings.{ErgoSettings, ErgoSettingsReader, NetworkType}
import scorex.util.ScorexLogging

Expand Down Expand Up @@ -145,7 +145,7 @@ class Docker(
val networkPort = initialSettings.scorexSettings.network.bindAddress.getPort

val nodeConfig: Config =
enrichNodeConfig(networkType, nodeSpecificConfig, extraConfig, ip, networkPort)
enrichNodeConfig(networkType, nodeSpecificConfig, extraConfig)
val settings: ErgoSettings = buildErgoSettings(networkType, nodeConfig)
val containerBuilder: CreateContainerCmd =
buildPeerContainerCmd(networkType, nodeConfig, settings, ip, specialVolumeOpt)
Expand Down Expand Up @@ -219,9 +219,7 @@ class Docker(
private def enrichNodeConfig(
networkType: NetworkType,
nodeConfig: Config,
extraConfig: ExtraConfig,
ip: String,
port: Int
extraConfig: ExtraConfig
) = {
val publicPeerConfig = nodeConfig //.withFallback(declaredAddressConfig(ip, port))
val withPeerConfig = nodeRepository.headOption.fold(publicPeerConfig) { node =>
Expand Down Expand Up @@ -296,6 +294,7 @@ class Docker(
val networkTypeCmdOption = networkType match {
case MainNet => "--mainnet"
case TestNet => "--testnet"
case Tests => "--testnet"
case DevNet => ""
case DevNet60 => ""
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/api/openapi-ai.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.2"

info:
version: "6.0.2"
version: "6.0.3"
title: Ergo Node API
description: Specification of Ergo Node API for ChatGPT plugin.
The following endpoints supported
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/api/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.2"

info:
version: "6.0.2"
version: "6.0.3"
title: Ergo Node API
description: API docs for Ergo Node. Models are shared between all Ergo products
contact:
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ ergo {
activationEpochs = 32

# Activation height for protocol version 2 (client version 4.0.0 hard-fork)
# Relevant for the mainnet only atm
version2ActivationHeight = 417792

# Difficulty for Autolykos version 2 activation (corresponding to ~ 1 TH/s hashrate)
Expand Down Expand Up @@ -445,7 +446,7 @@ scorex {
nodeName = "ergo-node"

# Network protocol version to be sent in handshakes
appVersion = 6.0.2
appVersion = 6.0.3

# Network agent name. May contain information about client code
# stack, starting from core code-base up to the end graphical interface.
Expand Down
36 changes: 13 additions & 23 deletions src/main/resources/testnet.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ ergo {

# Dump ADProofs only for the suffix given during bootstrapping
adProofsSuffixLength = 114688 // 112k

# As some v.3 blocks in the PaiNet are violating monotonic creation height rule (due to 5.0 being activated before
# the monotonic introduced), this checkpoint is mandatory
checkpoint = {
height = 91320
blockId = "fd06abdf0e6558ebaaf524b654c922a1cb42e542ae49d1c4a79397a077209278"
}
}
}

chain {
protocolVersion = 4 # 6.0 soft-fork
Expand Down Expand Up @@ -57,51 +50,48 @@ ergo {

# Voting epochs to activate a soft-fork after acceptance
activationEpochs = 32

# Activation height for testnet protocol version 2 (client version 4.0.0 hard-fork)
version2ActivationHeight = 128

version2ActivationDifficultyHex = "20"
}

reemission {
checkReemissionRules = false

emissionNftId = "06f29034fb69b23d519f84c4811a19694b8cdc2ce076147aaa050276f0b840f4"
# emissionNftId = "06f29034fb69b23d519f84c4811a19694b8cdc2ce076147aaa050276f0b840f4"

reemissionTokenId = "01345f0ed87b74008d1c46aefd3e7ad6ee5909a2324f2899031cdfee3cc1e022"
# reemissionTokenId = "01345f0ed87b74008d1c46aefd3e7ad6ee5909a2324f2899031cdfee3cc1e022"

reemissionNftId = "06f2c3adfe52304543f7b623cc3fccddc0174a7db52452fef8e589adacdfdfee"
# reemissionNftId = "06f2c3adfe52304543f7b623cc3fccddc0174a7db52452fef8e589adacdfdfee"

# no re-emission
activationHeight = 100000001

reemissionStartHeight = 1860400

injectionBoxBytesEncoded = "a0f9e1b5fb011003040005808098f4e9b5ca6a0402d1ed91c1b2a4730000730193c5a7c5b2a4730200f6ac0b0201345f0ed87b74008d1c46aefd3e7ad6ee5909a2324f2899031cdfee3cc1e02280808cfaf49aa53506f29034fb69b23d519f84c4811a19694b8cdc2ce076147aaa050276f0b840f40100325c3679e7e0e2f683e4a382aa74c2c1cb989bb6ad6a1d4b1c5a021d7b410d0f00"
# injectionBoxBytesEncoded = "a0f9e1b5fb011003040005808098f4e9b5ca6a0402d1ed91c1b2a4730000730193c5a7c5b2a4730200f6ac0b0201345f0ed87b74008d1c46aefd3e7ad6ee5909a2324f2899031cdfee3cc1e02280808cfaf49aa53506f29034fb69b23d519f84c4811a19694b8cdc2ce076147aaa050276f0b840f40100325c3679e7e0e2f683e4a382aa74c2c1cb989bb6ad6a1d4b1c5a021d7b410d0f00"
}

# Base16 representation of genesis state roothash
genesisStateDigestHex = "cb63aa99a3060f341781d8662b58bf18b9ad258db4fe88d09f8f71cb668cad4502"
}

voting {
120 = 1 // vote for 5.0 soft-fork, the vote will not be given before block 4,096
# 120 = 1 // vote for a soft-fork
}

wallet.secretStorage.secretDir = ${ergo.directory}"/wallet/keystore"
}

scorex {
network {
magicBytes = [2, 0, 2, 3]
bindAddress = "0.0.0.0:9022"
magicBytes = [2, 3, 2, 3]
bindAddress = "0.0.0.0:9023"
nodeName = "ergo-testnet-"${scorex.network.appVersion}
nodeName = ${?NODENAME}
knownPeers = [
"213.239.193.208:9022",
"168.138.185.215:9022",
"192.234.196.165:9022"
"213.239.193.208:9023",
"168.138.185.215:9023",
"192.234.196.165:9023"
]
penaltyScoreThreshold = 500000
}
restApi {
# Hex-encoded Blake2b256 hash of an API key. Should be 64-chars long Base16 string.
Expand Down
22 changes: 21 additions & 1 deletion src/main/scala/org/ergoplatform/http/api/MiningApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import akka.actor.{ActorRef, ActorRefFactory}
import akka.http.scaladsl.server.Route
import akka.pattern.ask
import io.circe.syntax._
import io.circe.{Encoder, Json}
import io.circe.Encoder
import io.circe.Json
import org.bouncycastle.util.encoders.Hex
import org.ergoplatform.http.api.requests.MiningRequest
import org.ergoplatform.mining.CandidateGenerator.Candidate
import org.ergoplatform.mining.{AutolykosSolution, CandidateGenerator, ErgoMiner}
import org.ergoplatform.modifiers.mempool.ErgoTransaction
Expand All @@ -13,8 +16,10 @@ import org.ergoplatform.settings.{ErgoSettings, RESTApiSettings}
import org.ergoplatform.{ErgoAddress, ErgoTreePredef, Pay2SAddress}
import scorex.core.api.http.ApiResponse
import sigma.data.ProveDlog
import sigma.serialization.GroupElementSerializer

import scala.concurrent.Future
import scala.util.{Failure, Success, Try}

case class MiningApiRoute(miner: ActorRef,
ergoSettings: ErgoSettings)
Expand All @@ -27,6 +32,7 @@ case class MiningApiRoute(miner: ActorRef,
override val route: Route = pathPrefix("mining") {
candidateR ~
candidateWithTxsR ~
candidateWithTxsAndPkR ~
solutionR ~
rewardAddressR ~
rewardPublicKeyR
Expand All @@ -53,6 +59,20 @@ case class MiningApiRoute(miner: ActorRef,
ApiResponse(candidateF)
}

def candidateWithTxsAndPkR: Route = (path("candidateWithTxsAndPk")
& post & entity(as[MiningRequest]) & withAuth) { txsAndPk =>
val tryPk = Try(GroupElementSerializer.fromBytes(Hex.decode(txsAndPk.pk)))
val result = tryPk match {
case Failure(_) =>
Future.failed(new Exception("Could not decode hexadecimal string for given public key"))
case Success(pk) =>
val prepareCmd = CandidateGenerator.GenerateCandidate(txsAndPk.txs, reply = true,
forced = false, Some(ProveDlog.apply(pk)))
miner.askWithStatus(prepareCmd).mapTo[Candidate].map(_.externalVersion)
}
ApiResponse(result)
}

def solutionR: Route = (path("solution") & post & entity(as[AutolykosSolution])) { solution =>
val result = if (ergoSettings.nodeSettings.useExternalMiner) {
miner.askWithStatus(solution).mapTo[Unit]
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/org/ergoplatform/http/api/ScriptApiRoute.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ case class ScriptApiRoute(readersHolder: ActorRef, ergoSettings: ErgoSettings)
keys.zipWithIndex.map { case (pk, i) => s"myPubKey_$i" -> pk }.toMap
}

private def compileSource(source: String, env: Map[String, Any], treeVersion: Byte = 0): Try[ErgoTree] = {
private def compileSource(source: String, env: Map[String, Any], treeVersion: Byte): Try[ErgoTree] = {
val compiler = new SigmaCompiler(ergoSettings.chainSettings.addressPrefix)
val ergoTreeHeader = ErgoTree.defaultHeaderWithVersion(treeVersion.toByte)
val ergoTreeHeader = ErgoTree.defaultHeaderWithVersion(treeVersion)
Try(compiler.compile(env, source)(new CompiletimeIRContext)).flatMap {
case CompilerResult(_, _, _, script: Value[SSigmaProp.type@unchecked]) if script.tpe == SSigmaProp =>
Success(ErgoTree.fromProposition(ergoTreeHeader, script))
Expand All @@ -77,7 +77,7 @@ case class ScriptApiRoute(readersHolder: ActorRef, ergoSettings: ErgoSettings)
val scriptVersion = Header.scriptFromBlockVersion(bv)
val treeVersion = compileRequest.treeVersion
VersionContext.withVersions(scriptVersion, treeVersion) {
compileSource(compileRequest.source, keysToEnv(addrs.map(_.pubkey))).map(Pay2SAddress.apply).fold(
compileSource(compileRequest.source, keysToEnv(addrs.map(_.pubkey)), treeVersion).map(Pay2SAddress.apply).fold(
e => BadRequest(e.getMessage),
address => ApiResponse(addressResponse(address))
)
Expand All @@ -93,7 +93,7 @@ case class ScriptApiRoute(readersHolder: ActorRef, ergoSettings: ErgoSettings)
val scriptVersion = Header.scriptFromBlockVersion(bv)
val treeVersion = compileRequest.treeVersion
VersionContext.withVersions(scriptVersion, treeVersion) {
compileSource(compileRequest.source, keysToEnv(addrs.map(_.pubkey))).map(Pay2SHAddress.apply).fold(
compileSource(compileRequest.source, keysToEnv(addrs.map(_.pubkey)), treeVersion).map(Pay2SHAddress.apply).fold(
e => BadRequest(e.getMessage),
address => ApiResponse(addressResponse(address))
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.ergoplatform.http.api.requests

import io.circe.Decoder
import io.circe.Encoder
import io.circe.syntax._
import io.circe.Json
import org.ergoplatform.modifiers.mempool.ErgoTransaction

/**
* Represents a request to generate a candidate with the given transactions and miner public key.
*
* @param txs Transactions to include in the block candidate
* @param pk String Hexadecimal representation of public key to use as minerPk
*/
case class MiningRequest(txs: Seq[ErgoTransaction], pk: String)

object MiningRequest {
implicit val miningRequestEncoder: Encoder[MiningRequest] = { request =>
Json.obj(
"txs" -> request.txs.asJson,
"pk" -> Json.fromString(request.pk)
)
}

implicit val miningRequestDecoder: Decoder[MiningRequest] = { cursor =>
for {
txs <- cursor.downField("txs").as[Seq[ErgoTransaction]]
pk <- cursor.downField("pk").as[String]
} yield MiningRequest(txs, pk)
}
}
Loading
Loading