Skip to content

Commit 8177874

Browse files
committed
fix:fix release
Signed-off-by: Chen Kai <[email protected]>
1 parent 426b489 commit 8177874

File tree

5 files changed

+81
-24
lines changed

5 files changed

+81
-24
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: GraalVM Native Image
22

33
on:
4-
push:
5-
tags:
6-
- '*'
7-
paths-ignore:
8-
- LICENSE
9-
- '*.md'
4+
release:
5+
types: [created]
106

117
defaults:
128
run:
@@ -31,7 +27,6 @@ jobs:
3127
strategy:
3228
fail-fast: false
3329
matrix:
34-
version: [ '22.3.2' ]
3530
java-version: [ '21' ]
3631
os: [ macos-latest ]
3732

@@ -47,7 +42,6 @@ jobs:
4742
- name: ☕ Setup GraalVM Build
4843
uses: graalvm/setup-graalvm@v1
4944
with:
50-
version: ${{ matrix.version }}
5145
java-version: ${{ matrix.java-version }}
5246
github-token: ${{ secrets.GITHUB_TOKEN }}
5347
distribution: 'graalvm'
@@ -58,8 +52,6 @@ jobs:
5852
- name: 🏗️ Native Image Build & Test
5953
id: native-build
6054
run: |
61-
echo $JAVA_HOME
62-
echo $GRAALVM_HOME
6355
./gradlew buildBinary
6456
mv hildr-node/build/binary/hildr-node hildr-node/build/binary/hildr-node-osx
6557
ls -ltrh hildr-node/build/binary/hildr-node-osx
@@ -78,7 +70,6 @@ jobs:
7870
strategy:
7971
fail-fast: false
8072
matrix:
81-
version: [ '22.3.2' ]
8273
java-version: [ '21' ]
8374
os: [ windows-latest ]
8475

@@ -94,7 +85,6 @@ jobs:
9485
- name: ☕ Setup GraalVM Build
9586
uses: graalvm/setup-graalvm@v1
9687
with:
97-
version: ${{ matrix.version }}
9888
java-version: ${{ matrix.java-version }}
9989
github-token: ${{ secrets.GITHUB_TOKEN }}
10090
distribution: 'graalvm'
@@ -105,7 +95,7 @@ jobs:
10595
- name: 🏗️ Native Image Build & Test
10696
id: native-build
10797
run: |
108-
./gradlew buildBinary
98+
./gradlew buildBinaryOnWindows
10999
ls -ltrh hildr-node/build/binary/hildr-node.exe
110100
111101
- name: 📤 Upload ${{ matrix.os }} native image
@@ -122,7 +112,6 @@ jobs:
122112
strategy:
123113
fail-fast: false
124114
matrix:
125-
version: [ '22.3.2' ]
126115
java-version: [ '21' ]
127116
os: [ ubuntu-latest ]
128117

@@ -138,7 +127,6 @@ jobs:
138127
- name: ☕ Setup GraalVM Build
139128
uses: graalvm/setup-graalvm@v1
140129
with:
141-
version: ${{ matrix.version }}
142130
java-version: ${{ matrix.java-version }}
143131
github-token: ${{ secrets.GITHUB_TOKEN }}
144132
distribution: 'graalvm'
@@ -174,7 +162,6 @@ jobs:
174162
- name: ☕ Setup GraalVM Build
175163
uses: graalvm/setup-graalvm@v1
176164
with:
177-
version: '22.3.2'
178165
java-version: '21'
179166
distribution: 'graalvm'
180167
github-token: ${{ secrets.GITHUB_TOKEN }}

hildr-node/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
}
2424

2525
group 'me.grapebaba'
26-
version '0.2.2'
26+
version '0.2.1'
2727

2828
repositories {
2929
// Use Maven Central for resolving dependencies.
@@ -360,6 +360,21 @@ task buildBinary {
360360
println(out.toString())
361361
}
362362

363+
task buildBinaryOnWindows{
364+
dependsOn copyJarToBinaryDir
365+
def buildBinaryDir = "build/binary"
366+
def out = new ByteArrayOutputStream()
367+
doLast {
368+
exec {
369+
workingDir buildBinaryDir
370+
executable "cmd"
371+
args "/c", "native-image -jar ${project.name}.jar --no-fallback --enable-http --enable-https --enable-preview -H:EnableURLProtocols=http,https --initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback.core.CoreConstants,ch.qos.logback.core.util.Loader,ch.qos.logback.core.util.StatusPrinter,ch.qos.logback.core.status.InfoStatus,ch.qos.logback.classic.Logger,ch.qos.logback.core.rolling.helper.FileNamePattern,ch.qos.logback.classic.Level,ch.qos.logback.core.status.StatusBase,io.opentelemetry.api.trace.ArrayBasedTraceStateBuilder,io.opentelemetry.context.LazyStorage,ch.qos.logback.core.util.FileSize,ch.qos.logback.core.rolling.helper.RollingCalendar,io.opentelemetry.api.internal.ImmutableSpanContext,io.opentelemetry.api.internal.OtelEncodingUtils,ch.qos.logback.classic.PatternLayout,io.opentelemetry.context.ThreadLocalContextStorage,io.opentelemetry.api.trace.PropagatedSpan,io.opentelemetry.context.ContextStorageWrappers,ch.qos.logback.core.rolling.helper.Compressor\$1,io.opentelemetry.api.trace.ImmutableTraceFlags,ch.qos.logback.core.rolling.helper.RollingCalendar\$1,ch.qos.logback.classic.model.ConfigurationModel,ch.qos.logback.core.model.processor.DefaultProcessor\$1,ch.qos.logback.core.model.processor.ImplicitModelHandler\$1,ch.qos.logback.core.subst.Token,ch.qos.logback.core.pattern.parser.Parser,ch.qos.logback.core.subst.Parser\$1,ch.qos.logback.core.util.Duration,ch.qos.logback.core.model.processor.ChainedModelFilter\$1,ch.qos.logback.classic.model.processor.ConfigurationModelHandler,ch.qos.logback.classic.model.processor.LogbackClassicDefaultNestedComponentRules,ch.qos.logback.core.subst.NodeToStringTransformer\$1,ch.qos.logback.core.pattern.parser.TokenStream\$1,ch.qos.logback.core.subst.Tokenizer\$1 --initialize-at-run-time=io.netty.channel.AbstractChannel,io.netty.channel.socket.nio.SelectorProviderUtil,io.netty.util.concurrent.DefaultPromise,io.netty,org.slf4j.MDC,org.github.gestalt.config ${project.name}"
372+
standardOutput out
373+
}
374+
}
375+
println(out.toString())
376+
}
377+
363378
task buildBinaryStaticNoG1GC {
364379
dependsOn copyJarToBinaryDir
365380
def buildBinaryDir = "build/binary"

hildr-node/src/main/java/io/optimism/cli/Cli.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ private Config toConfig() {
174174
case "optimism-sepolia" -> Config.ChainConfig.optimismSepolia();
175175
case "base" -> Config.ChainConfig.base();
176176
case "base-goerli" -> Config.ChainConfig.baseGoerli();
177+
case "base-sepolia" -> Config.ChainConfig.baseSepolia();
177178
default -> {
178179
if (network.endsWith(".json")) {
179180
yield Config.ChainConfig.fromJson(network);

hildr-node/src/main/java/io/optimism/config/Config.java

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public static ChainConfig optimism() {
267267
BigInteger.valueOf(3600L),
268268
BigInteger.valueOf(600L),
269269
BigInteger.ZERO,
270-
BigInteger.valueOf(-1L),
270+
BigInteger.valueOf(1704992401L),
271271
BigInteger.valueOf(2L),
272272
"0x4200000000000000000000000000000000000016");
273273
}
@@ -305,7 +305,7 @@ public static ChainConfig base() {
305305
BigInteger.valueOf(3600L),
306306
BigInteger.valueOf(600L),
307307
BigInteger.ZERO,
308-
BigInteger.valueOf(-1L),
308+
BigInteger.valueOf(1704992401L),
309309
BigInteger.valueOf(2L),
310310
"0x4200000000000000000000000000000000000016");
311311
}
@@ -408,18 +408,51 @@ public static ChainConfig baseGoerli() {
408408
new SystemConfig(
409409
"0x2d679b567db6187c0c8323fa982cfb88b74dbcc7",
410410
BigInteger.valueOf(25_000_000L),
411-
BigInteger.valueOf(2100),
412-
BigInteger.valueOf(1000000),
411+
BigInteger.valueOf(2100L),
412+
BigInteger.valueOf(1000000L),
413413
"0x32a4e99A72c11E9DD3dC159909a2D7BD86C1Bc51"),
414414
"0x8453100000000000000000000000000000000000",
415415
"0xe93c8cd0d409341205a592f8c4ac1a5fe5585cfa",
416416
"0xb15eea247ece011c68a614e4a77ad648ff495bc1",
417417
BigInteger.valueOf(100_000_000L),
418-
BigInteger.valueOf(100L),
418+
BigInteger.valueOf(300L),
419419
BigInteger.valueOf(3600L),
420420
BigInteger.valueOf(600L),
421421
BigInteger.valueOf(1683219600L),
422-
BigInteger.valueOf(-1L),
422+
BigInteger.valueOf(1699981200L),
423+
BigInteger.valueOf(2L),
424+
"0x4200000000000000000000000000000000000016");
425+
}
426+
427+
public static ChainConfig baseSepolia() {
428+
return new ChainConfig(
429+
"base-sepolia",
430+
BigInteger.valueOf(11155111L),
431+
BigInteger.valueOf(84532L),
432+
new Epoch(
433+
BigInteger.valueOf(4370868L),
434+
"0xcac9a83291d4dec146d6f7f69ab2304f23f5be87b1789119a0c5b1e4482444ed",
435+
BigInteger.valueOf(1695768288L)),
436+
new BlockInfo(
437+
"0x0dcc9e089e30b90ddfc55be9a37dd15bc551aeee999d2e2b51414c54eaf934e4",
438+
BigInteger.valueOf(0L),
439+
Numeric.toHexString(new byte[32]),
440+
BigInteger.valueOf(1695768288L)),
441+
new SystemConfig(
442+
"0x6cdebe940bc0f26850285caca097c11c33103e47",
443+
BigInteger.valueOf(25_000_000L),
444+
BigInteger.valueOf(2100L),
445+
BigInteger.valueOf(1000000L),
446+
"0xb830b99c95Ea32300039624Cb567d324D4b1D83C"),
447+
"0xff00000000000000000000000000000000084532",
448+
"0x49f53e41452C74589E85cA1677426Ba426459e85",
449+
"0xf272670eb55e895584501d564AfEB048bEd26194",
450+
BigInteger.valueOf(100_000_000L),
451+
BigInteger.valueOf(300L),
452+
BigInteger.valueOf(3600L),
453+
BigInteger.valueOf(600L),
454+
BigInteger.ZERO,
455+
BigInteger.valueOf(1699981200L),
423456
BigInteger.valueOf(2L),
424457
"0x4200000000000000000000000000000000000016");
425458
}
@@ -472,7 +505,7 @@ public static ChainConfig fromExternal(ExternalChainConfig external) {
472505
external.seqWindowSize,
473506
external.maxSequencerDrift,
474507
external.regolithTime,
475-
external.canyonTime,
508+
external.canyonTime == null ? BigInteger.valueOf(-1L) : external.canyonTime,
476509
external.blockTime,
477510
"0x4200000000000000000000000000000000000016");
478511
}

hildr-node/src/test/java/io/optimism/config/ConfigTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,24 @@ void create() {
102102
assertEquals(BigInteger.valueOf(2L), config.chainConfig().blockTime());
103103
}
104104

105+
/**
106+
* Base goerli.
107+
*/
105108
@Test
106109
void baseGoerli() {
107110
ChainConfig chainConfig = ChainConfig.baseGoerli();
108111
assertEquals(chainConfig.regolithTime(), BigInteger.valueOf(1683219600L));
109112
}
110113

114+
/**
115+
* Base sepolia.
116+
*/
117+
@Test
118+
void baseSepolia() {
119+
ChainConfig chainConfig = ChainConfig.baseSepolia();
120+
assertEquals(chainConfig.canyonTime(), BigInteger.valueOf(1699981200L));
121+
}
122+
111123
/**
112124
* Base goerli.
113125
*/
@@ -117,6 +129,12 @@ void optimismGoerli() {
117129
assertEquals(chainConfig.regolithTime(), new BigInteger("1679079600"));
118130
}
119131

132+
@Test
133+
void optimismSepolia() {
134+
ChainConfig chainConfig = ChainConfig.optimismSepolia();
135+
assertEquals(chainConfig.canyonTime(), BigInteger.valueOf(1699981200L));
136+
}
137+
120138
/**
121139
* Batch hash.
122140
*/
@@ -132,6 +150,9 @@ void batchHash() {
132150
assertTrue(systemConfig.batcherHash().contains(Numeric.cleanHexPrefix(systemConfig.batchSender())));
133151
}
134152

153+
/**
154+
* Read external chain from json.
155+
*/
135156
@Test
136157
void readExternalChainFromJson() {
137158
var devnetJson = "{\n"

0 commit comments

Comments
 (0)