Skip to content

Commit

Permalink
fix: read abi resource file and image tags
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkAfCod authored and GrapeBaBa committed Dec 18, 2023
1 parent 8bbbdfc commit 2a31892
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=semver,pattern={{raw}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
Expand All @@ -214,14 +216,38 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

push_native_image_to_github:
name: Push Docker image to Github
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=semver,pattern={{raw}}-native
type=raw,value=latest,enable=false
type=raw,value=latest-native
- name: Build and push graalvm native Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}-native
labels: ${{ steps.meta.outputs.labels }}-native
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


release:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@

package io.optimism.common;

import java.io.IOException;
import java.math.BigInteger;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import net.osslabz.evm.abi.decoder.AbiDecoder;
import net.osslabz.evm.abi.decoder.DecodedFunctionCall;
Expand Down Expand Up @@ -52,13 +48,7 @@ public record AttributesDepositedCall(
private static final AbiDecoder l1BlockAbi;

static {
try {
Path path = Paths.get(Objects.requireNonNull(Epoch.class.getResource("/abi/L1Block.json"))
.toURI());
l1BlockAbi = new AbiDecoder(path.toString());
} catch (URISyntaxException | IOException e) {
throw new AbiFileLoadException(e);
}
l1BlockAbi = new AbiDecoder(Objects.requireNonNull(Epoch.class.getResourceAsStream("/abi/L1Block.json")));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions hildr-node/src/main/java/io/optimism/driver/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static Driver<EngineApi> from(Config config, CountDownLatch latch)
try {
head = HeadInfo.from(finalizedBlock.getBlock());
} catch (Throwable throwable) {
LOGGER.warn("could not get head info. Falling back to the genesis head.");
LOGGER.warn("could not parse head info. Falling back to the genesis head.", throwable);
head = new HeadInfo(
config.chainConfig().l2Genesis(), config.chainConfig().l1StartEpoch(), BigInteger.ZERO);
}
Expand All @@ -212,7 +212,7 @@ public static Driver<EngineApi> from(Config config, CountDownLatch latch)
Epoch finalizedEpoch = head.l1Epoch();
BigInteger finalizedSeq = head.sequenceNumber();

LOGGER.info("starting from head: {}", finalizedHead.hash());
LOGGER.info("starting from head: number{}, hash{}", finalizedHead.number(), finalizedHead.hash());
BigInteger l1StartBlock =
finalizedEpoch.number().subtract(config.chainConfig().channelTimeout());
ChainWatcher watcher = new ChainWatcher(
Expand Down

0 comments on commit 2a31892

Please sign in to comment.