diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml new file mode 100644 index 00000000000..fe45d91b49f --- /dev/null +++ b/.github/workflows/stale-issues.yml @@ -0,0 +1,27 @@ +name: Close inactive issues +on: + schedule: + - cron: "30 1 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + contents: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 180 + days-before-issue-close: 14 + stale-issue-label: "stale" + stale-issue-message: "This issue is stale because it has been open for 6 months with no activity." + close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." + days-before-pr-stale: 30 + days-before-pr-close: 14 + stale-pr-message: "This pr is stale because it has been open for 30 days with no activity." + close-pr-message: "This pr was closed because it has been inactive for 14 days since being marked as stale." + remove-issue-stale-when-updated: true + remove-pr-stale-when-updated: true + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java index a76a3e6dcb5..fc2a7d372ea 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/ThreadBesuNodeRunner.java @@ -494,6 +494,7 @@ public BesuPluginContextImpl providePluginContext( final RpcEndpointServiceImpl rpcEndpointServiceImpl, final BesuConfiguration commonPluginConfiguration, final PermissioningServiceImpl permissioningService, + final MetricsConfiguration metricsConfiguration, final MetricCategoryRegistryImpl metricCategoryRegistry, final MetricsSystem metricsSystem, final @Named("ExtraCLIOptions") List extraCLIOptions, @@ -512,6 +513,7 @@ public BesuPluginContextImpl providePluginContext( TransactionSimulationService.class, transactionSimulationServiceImpl); besuPluginContext.addService(BlockchainService.class, blockchainServiceImpl); besuPluginContext.addService(BesuConfiguration.class, commonPluginConfiguration); + metricCategoryRegistry.setMetricsConfiguration(metricsConfiguration); besuPluginContext.addService(MetricCategoryRegistry.class, metricCategoryRegistry); besuPluginContext.addService(MetricsSystem.class, metricsSystem); diff --git a/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java index 19840fb73da..edb55a11265 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/CliqueBesuControllerBuilder.java @@ -132,6 +132,7 @@ protected ProtocolSchedule createProtocolSchedule() { genesisConfigOptions, forksSchedule, nodeKey, + privacyParameters, isRevertReasonEnabled, evmConfiguration, miningConfiguration, diff --git a/config/src/main/java/org/hyperledger/besu/config/GenesisReader.java b/config/src/main/java/org/hyperledger/besu/config/GenesisReader.java index 6b42c3c2edf..4ee99f0bd83 100644 --- a/config/src/main/java/org/hyperledger/besu/config/GenesisReader.java +++ b/config/src/main/java/org/hyperledger/besu/config/GenesisReader.java @@ -80,7 +80,9 @@ public Stream streamAllocations() { final var on = normalizeKeys((ObjectNode) entry.getValue()); return new GenesisAccount( Address.fromHexString(entry.getKey()), - JsonUtil.getString(on, "nonce").map(ParserUtils::parseUnsignedLong).orElse(0L), + JsonUtil.getValueAsString(on, "nonce") + .map(ParserUtils::parseUnsignedLong) + .orElse(0L), JsonUtil.getString(on, "balance") .map(ParserUtils::parseBalance) .orElse(Wei.ZERO), diff --git a/config/src/test/java/org/hyperledger/besu/config/GenesisReaderTest.java b/config/src/test/java/org/hyperledger/besu/config/GenesisReaderTest.java index f8327174a33..eab6dfac734 100644 --- a/config/src/test/java/org/hyperledger/besu/config/GenesisReaderTest.java +++ b/config/src/test/java/org/hyperledger/besu/config/GenesisReaderTest.java @@ -17,6 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.config.GenesisReader.ALLOCATION_FIELD; import static org.hyperledger.besu.config.GenesisReader.CONFIG_FIELD; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Wei; @@ -27,6 +28,7 @@ import java.util.Map; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -111,4 +113,17 @@ private ObjectNode generateAllocation(final Wei balance) { entry.put("balance", balance.toShortHexString()); return entry; } + + @Test + void testNonceHandlingAsStringAndInteger() { + ObjectNode accountNode = JsonNodeFactory.instance.objectNode(); + + accountNode.put("nonce", 10); + String nonceAsStringFromInt = JsonUtil.getValueAsString(accountNode, "nonce").orElse(""); + assertEquals("10", nonceAsStringFromInt, "Nonce should convert integer to string correctly"); + + accountNode.put("nonce", "20"); + String nonceAsStringDirect = JsonUtil.getValueAsString(accountNode, "nonce").orElse(""); + assertEquals("20", nonceAsStringDirect, "Nonce should keep string as string correctly"); + } } diff --git a/platform/build.gradle b/platform/build.gradle index 5b02eb0beeb..d614603f17f 100644 --- a/platform/build.gradle +++ b/platform/build.gradle @@ -43,8 +43,14 @@ dependencies { api project(':acceptance-tests:dsl') api project(':besu') api project(':config') + api project(':consensus:clique') + api project(':consensus:common') + api project(':consensus:ibft') + api project(':consensus:merge') + api project(':consensus:qbft') api project(':crypto:algorithms') api project(':crypto:services') + api project(':datatypes') api project(':ethereum:api') api project(':ethereum:blockcreation') api project(':ethereum:core') @@ -53,9 +59,12 @@ dependencies { api project(':ethereum:permissioning') api project(':ethereum:referencetests') api project(':ethereum:rlp') + api project(':ethereum:trie') api project(':evm') - api project(':datatypes') + api project(':metrics:core') api project(':plugin-api') + api project(':testutil') + api project(':util') api 'com.github.ben-manes.caffeine:caffeine:3.1.8'