Skip to content

Commit d7e415c

Browse files
AnkushinDaniiljoshuacolvin0prestonvanloonForostoveceljobe
authored
sync (#19)
* Close part files after the copy is done * fix: resolve race condition in storage test goroutines (OffchainLabs#3509) Co-authored-by: Pepper Lebeck-Jobe <[email protected]> * Fix relay backlog corruption at segment boundaries (OffchainLabs#3516) There was a bug where if a duplicate message was processed at a segment boundary, then it would cause an empty segment to be inserted, which broke the invariants of the backlog data structure. The invariants being violated wer: 1. Monotonic sequence number order 2. Segment Continuity: segment[n].End() + 1 == segment[n+1].Start() 3. Non-empty Segments: All segments should contain messages 4. Lookup Uniqueness: Each sequence number maps to exactly one segment 5. Cumulative Size Ordering: Later messages have higher cumulative sizes This bug would break most operations on the backlog (eg Get() which uses a binary search) and cause them to have unpredictable behavior. * Revert "Disable HTTP/2 for das aggregator by default" (OffchainLabs#3517) * Optimize signer * Return a fatal error instead of stopping the StopWaiter in case of ErrGlobalStateNotInChain * Return a fatal error instead of stopping the StopWaiter in case of ErrGlobalStateNotInChain * fix(backend): fix error handling and add comprehensive tests (OffchainLabs#3510) * fix(backend): fix error handling in GetCollectMachineHashes * test(backend): add comprehensive test coverage for GetCollectMachineHashes * fix test * test parallel batch posters with and without redis lock use * Add 10 minutes to bold tests (OffchainLabs#3514) For some reason, this is frequently timing out on CI builds. The builds and tests are passing locally, so, I assume the reason the CI jobs are failing is a timeout. The logs are far too verbose to understand if there is some actual failure in CI. Also, this commits some updates to the mod files generated by `go get -v -t ./...` and updates the workflow not to pass the now-deprecated `-d` option to `go get` * cleanup batch poster segments on lock acquiry failure * add batch poster handoff test * Don't log error if unable to return expired nonce cache failure (OffchainLabs#3486) * Don't log error if unable to return expired nonce cache failure When a nonce failure cache entry expires, don't error if unable to return original error to user because there is a good chance that user already disconnected * Remove code duplication * Add multi-dimensional gas collector (OffchainLabs#3453) * Add multi-deminsional gas collector * Enhance Multigas collector with StopWaiter * Multigas collector start and finalise block separation * Collect multigas in `ProduceBlockAdvanced` * Strat Multigas collector from execution engine * Re-wire multigas collector and apply review fixes * Multigas collector review fixes * Move Multigas collector from arbos to execution and some review fixes * Split Multigas collector interface from implementation * Add system test for multigas collector and add copyrights * Move multigas collector start/stop block message to ExecutionEngine * Fixup multigas collector comments * support both miniredis and redis version of batch poster handoff test * prevent nil deref when reading from queue in data paster * don't parallellise batch poster redis tests when using single external redis * Refactor move multigascollector to arbos (OffchainLabs#3524) This allows docker buildx build nitro-node-dev . to build. The reason is that that docker image builds the replay.wasm with strictly the directories that are supposed to contain code which affects the state transition function. When the multigascollector package was in execution, it pulled in all of the dependencies of that go package. So, things got a bit upside-down. * Add debug flag to enable deep copy of backlog msgs (OffchainLabs#3519) Co-authored-by: Aman Sanghi <[email protected]> * remove empty duplicate of TestBidValidatorAuctioneerRedisStream * add IsSharedTestRedisInstance helper * add comment to AttemptLock call * Update geth post merge of v1.16.0 (OffchainLabs#3523) * Update geth pin post geth merge v1.16.0 * update geth pin * fix CI * copy ancients in db conversion test * code cleanup * update geth pin * fix ci * TestGettingState is hashScheme specific so skip it in pathDB test runs * Consider arbos version for batch calldata gas calculation * Consider arbos version for batch calldata gas calculation * Update go-ethereum version * attempt locking redislock just before PostTransaction * shorten batch poster handoff test * cleanup newline * discard closed batch in defer as it cannot be reused * remove no longer needed line * Update geth post merge of v1.16.1 (OffchainLabs#3528) * Use the parent chain for BlobFeePerByte instead of an RPC call The value can be calculated from the configuration of the parent chain and shouldn't require an RPC call. Fixes: NIT-3335 * fix: correct error aggregation for multi-target compile results * Account multi-gas in StartTxHook (OffchainLabs#3533) * Instrument StartTxHook with multigas * And add new calldata multi gas types to collector --------- Co-authored-by: Pepper Lebeck-Jobe <[email protected]> * Add GetNativeTokenManagementFrom precompile to ArbOwnerPublic (OffchainLabs#3534) * Add the GetNativeTokenManagementFrom precompile This precompile is available in ArbosVersion_50 on the ArbOwnerPublic contract. * Add the implementation of GetNativeTokenManagementFrom This commit also allows arbos to initialize to arbos 50. * Update precompiles pin * Allow same prevTimestamp in eth_simulateV1 (OffchainLabs#3535) * Allow same prevTimestamp in eth_simulateV1 * fix test * Return False When Checking if Deposit Tx Type Has Poster Costs (OffchainLabs#3536) * return false for deposit tx type * test * Add arb-owner methods to get and set the calldata price * Applied new pricing only for STF * Removed unnecessary methods * Update geth post merge of v1.16.2 (OffchainLabs#3537) * Added arbos version in the l1pricing state * Updated go-ethereum version * Removed getL1CalldataPrice from ArbOwner * Reverted contracts hash * Removed arbos version check from getter * Fixed compilation error * Updated precompiles version * Fix test * Fix test * Improve CPU performance when processing blocks (OffchainLabs#3541) Pull the changes from OffchainLabs/go-ethereum#519 Close NIT-3769 * Added tests * Nit 3568 fix eip 2537 in nitro enable it as part of arbos 50 dia (OffchainLabs#3492) * NIT-3568: Fix EIP-2537 in Nitro (enable it as part of ArbOS 50 Dia) * Updated submodule reference * fixup! NIT-3568: Fix EIP-2537 in Nitro (enable it as part of ArbOS 50 Dia) * Update go-ethereum version * Extracted contract/address adding logic * Added Osaka precompiles * Update go-ethereum pin --------- Co-authored-by: Pepper Lebeck-Jobe <[email protected]> * Setting arbos version on opening the l1 pricing state * Fixed test for arbos version = 0 * Fixed tests * Addressed review comments * Fixed linting error * Fixed linting error * Fixed test * Support passing multi gas by value (OffchainLabs#3543) * Skip block size cap for arbitrum chains (OffchainLabs#3544) * Skip block size cap for arbitrum chains * RecordBlockCreation receives list of wasm targets * Only retrieve StylusArchs after spawner was started * Includes StylusArchs from redisValidator * Adds missing local target in ArbitratorSpawner * ValidationInputsAt provides the targets that needs to be recorded * Renames targets to wasmTargets * Fix comment * Don't compile TargetWasm * TestValidationInputsAtWithWasmTarget * Always adds local target before NewMessageCommitContext call * Remove rust nightly dependency * Implement EIP-7825 (OffchainLabs#3545) Implement EIP-7825 register new precompiles * CustomDA core Arbitrator & WASM infra CustomDA is a new Nitro feature that allows for 3rd parties to use their own logic data availability logic including storing, retrieving, validating, and proving without needing to modify Nitro code or the stock contracts. This is the first PR and it concerns adding the core validation and proving infrastructure. This commit adds the new WAVM opcode ValidateCertificate, and modifies the existing WAVM opcode ReadPreImage to add handling for the new CustomDA preimage type. The ValidateCertificate opcode will always be called before ReadPreImage by the replay binary. It will always skip calling ReadPreImage if ValidateCertificate returns false. When there is a dispute on a ValidateCertificate opcode there are two possibilities. The certificate posted to the parent chain might be invalid, but a malicious validator claims that it is valid, or it might be valid but a malicious validator claims it is invalid. Having ValidateCertificate as a separate opcode not part of ReadPreImage allows for us to narrow down disputes to either being about the validity of certificate, or about if the data matches the ceritficate. This makes the proofs individually smaller, especially in the case of the ceritifcate validity proof. When used by the block validator in reexecution mode, for CustomDA preimages ValidateCertificate simply checks that the preimage for the certificate was included by the block validator and returns valid if so, otherwise it returns invalid. The block validator does its own validation of the certificate by calling the 3rd party daprovider and only includes it if it is valid. For non CustomDA preimages it always returns valid. In reexecution mode ReadPreImage doesn't need any modification, since the certificate was already validated by the replay binary calling ValidateCertificate and therefore the preimage should be available. In proving mode for CustomDA preimage types, these opcodes both return an incomplete proof that needs enhancement by the Nitro process which is orchestrating the challenge. To indicate that the proof needs enhancement they OR 0x80 with the machine status byte of the proof, this is safe becasue the MSB of the first byte doesn't overlap with any of the existing machine statuses (0x00-0x03). The final byte of the proof is used as a marker to indicate the type enhancment needed: 0xDA is for CustomDA ReadPreImage proofs, and 0xDB is for CustomDA ValidateCertificate proofs. The final byte so the enhancer doesn't need to scan through the data to find the marker, it just looks at the final byte, and then can know how to interpret prior bytes depending on the type. Data needed by the enhancer from the opcode is returned via the proof. The enhancer in Nitro will call the 3rd party daprovider to get the rest of the proof. This commit contains the plumbing for the new and modified opcode to be used from the replay binary. ValidateCertificate: ``` wavmio.ValidateCertificate (wavmio/higher.go) ↓ wavmio.validateCertificate (wavmio/raw.go - stub/import declaration) ↓ [WASM boundary] wavmio__validateCertificate (wasm-libraries/host-io/src/lib.rs) ↓ wavm_validate_certificate (C FFI declaration) ↓ [Runtime resolution] WavmValidateCertificate (arbitrator/prover/src/host.rs) ↓ [Mapped to WAVM instruction] ValidateCertificate (arbitrator/prover/src/machine.rs - instruction handler) ``` ReadPreImage: ``` (existing path using wavmio.ResolveTypedPreimage) ↓ wavmio__resolveTypedPreimage (wasm-libraries/host-io/src/lib.rs) ↓ wavm_read_customda_preimage (C FFI declaration) ↓ [Runtime resolution] WavmReadCustomDAPreimage (arbitrator/prover/src/host.rs) ↓ [Mapped to WAVM instruction] ReadPreImage (arbitrator/prover/src/machine.rs - instruction handler) ``` * Enable arbos 50 (OffchainLabs#3547) * Fix linter issue * treat precompile code as empty during delegation after arbos 50 (OffchainLabs#3549) * Enable ArbOS 50 in system tests (OffchainLabs#3550) * Enable ArbOS 50 in system tests * fix remaining tests * code refactor * fix TestTimeboostTxsTimeoutByBlock system test * Add fd_tell wasi stub The usage of fd_tell was introduced in Rust 1.87 by rust-lang/rust#137165 * Update Rust to 1.89.0 (latest stable) Close NIT-3562 * Downgrade Rust to 1.88.0 Rust 1.89 breaks the wasmer build. So we need to upgrade wasmer before updating to 1.89. See: wasmerio/wasmer#5690 * Add consensus v41 to Dockerfile Also removed deprecated v42-rc.1 since no one should ever use it * prover: remove unnecessary wasm exports (OffchainLabs#3554) prover's unnecessary exports add lots of dependencies to user_host which imports it. They are only required for native and not when compiling to wasm. * Move the MaxTxGas limit enforcement (OffchainLabs#3557) * Revert "Enable ArbOS 50 in system tests (OffchainLabs#3550)" This reverts commit e167107. * Correctly implement EIP-7825 * Fix tests that need to set max block gas limit * Add support for consensus v50 to Docker (OffchainLabs#3551) * Revert "Add fd_tell wasi stub" This reverts commit 94c70b7. * Store single-gas in multi-gas collector (OffchainLabs#3552) * Fix cargo clippy warnings for Rust 1.88 * Fix cargo clippy warning Use variables directly in the `format!` string. * Prevent HTTP response body leaks in restful DAS client (OffchainLabs#3558) * Custom GH action for unified installing Rust (OffchainLabs#3559) * Create new action for installing Rust * Use the new action in arbitrator-ci.yml * Use the new action in the other workflows * Fix merge conflict * Instrument multi-gas in StylusPrograms (just for getBytes32) (OffchainLabs#3539) * Multigas collector support for WASM computation resource type * Instrument with multigas stylus contracts (getBytes32) * Add test for GetBytes32 multi gas usage * Add multigas system test for getBytes32 stylus program * Correct WasmStateLoadCost multigas cost * Attribute Wasm computation gas for OOG branch * chore: Update TODO comment for expectedWasmComputation * Remove hardcoded check for wasm multi gas * Correct attributeWasmComputation usedGas for both scenarios * Correct rightshift linter documentation (OffchainLabs#3562) * Update gammazero dependency Pulls in OffchainLabs/go-ethereum#530 Fixes: NIT-3760 * Update go-ethereum pin * Run go.mod tidy * Update go version to 1.24.x across github workflows Fixes: OffchainLabs#3566 Fixes: NIT-3799 * Merge v1.16.3 (OffchainLabs#3568) * Merge v1.16.3 * skip EIP-7825 for arbitrum chain * fix blob gas * Test Genesis assertion on nitro init * Change ValidatePreimage return type to u8 where possible This changes the exported declaration of wavmio__validateCertificate to have a u8 return type. In practice when it is built with the rust wasm32-unknown-unknown target, sizes smaller than WASM's minimum size type of i32 are extended. On the Go side, go:wasmimport only supports at least 32 bit types in order to match the wasm ABI requirements. So this change has no functional impact but it makes it slightly clearer what the return type represents. * Add error logging from jit on invalid preimage type * Multigas: support geth multigas api changes (OffchainLabs#3569) * chore(ci): update GitHub Actions to latest versions (OffchainLabs#3573) * Update nightly-ci.yml * Update arbitrator-ci.yml * Update EIP-7910 implementation (OffchainLabs#3571) * Update EIP-7910 implementation There are a few different things going on in this pull request. 1. Implementing the Name() function for precompiles. 2. Adding a system test for calling the new eth_config RPC method. Fixes: NIT-3679 * Remove system contracts which aren't needed for Arbitrum These contracts are related to Ethereum's consensus and beacon chain functionality. * Add suppoort for Consensus V50 (rc.3) to Docker * Rename CustomDA preimage type to DACertificate * Move new ValidateCertificate opcode to end, add note * add extra logs to figure out a round causing NO_ONCHAIN_CONTROLLER * chore: Add require-exhaustive-init linter to structs (1/n) (OffchainLabs#3575) * chore(lint): add require-exhaustive-init linter to structs * fix lint * Use `nil` as the default for slice --------- Co-authored-by: Tuan Tran <[email protected]> * fix: Correctly count struct fields in the structinit linter (OffchainLabs#3579) * Turn on linter for all structs (no opt-in) * Count fields in a correct way * Add verification Python script * Fix counting (include single-type-multi-name fields) * Remove script * Restore conditional linting * Fix PublishedMachine test to handle cases when latest release is behind latest ArbOS (OffchainLabs#3581) * Multigas: Instrument GasChargingHook with multi-gas (OffchainLabs#3576) * Instrument multi-gas in GasChargingHook * Fixup comments in tx processor * Run execution-spec-tests in nightly CI (OffchainLabs#3577) * Update restful_client.go * Update dasRpcServer.go * Move output dir setup to constructor; make Start launch-only (OffchainLabs#3578) * Move output dir setup to constructor; make Start launch-only * fix lint * rpc_test: remove typo and redundant checks * Improve error reporting in the batch poster * fix: Make structinit linter work cross packages (OffchainLabs#3586) * New linter approach: checkpoint (FieldCountAnalyzer without exporting facts) * Merge field counts across packages * Working cross packages * Fixing MessageSequencer 1/2 * Fixing MessageSequencer 2/2 * fieldcount tests * Merge analyzers * Finish tests * Add documentation * Lint linter * Fmt test fixes * Fix wording in the comment about linter tip * Add reference to the 'want' comments * Add copyright lines * Remove redundant Background context initialization in poster_test (OffchainLabs#3595) * Include msg.SetCodeAuthorizations field when constructing arbitrum.TransactionArgs (OffchainLabs#3598) * Fail instead of panic when building second node if first node was not built with L1 (OffchainLabs#3601) * Fail instead of panic when building second node if first node was not built with L1 * fix grammar * Unify DAS interfaces * Turn bold into a sub-package of nitro (OffchainLabs#3599) * Remove unnecessary files * fix readme.md * Replace github.com/offchainlabs/bold/ with github.com/offchainlabs/nitro/bold/ * fix dockerfile * remove bold specific workflow * Fix l1 pricing state field order * Data streamer * Stream parameters * Make DAS signing public * Add licence header * Move to das module. Revert making signing public * Start streaming protocol * Do stream * Finalize streaming * Plug in the new API * Simplify DASRPCClient * Docs * Do not rename const * Update license to trigger CI * Add to chain_info: feed-signed * Disable `feed-signed`` for arb1 and nova * // #nosec G115 * Named initializer linter * Use named init for all structs with more than 5 fields * Update the implementation of EIP-7825 (OffchainLabs#3589) * Update the implementation of EIP-7825 The previous implementation was incorrect and caused the gas to be limited in the wrong part of gas estimation and execution. * Simplify the implementation of EIP-7825 * Restore some files that don't need to change There were some spurious changes leftover from previous commits. * Clean up branching logic in GasChargingHook This produces one less arbos state access after the ArbOS 50 upgrade. * Fix l1 pricing state field order (OffchainLabs#3602) * Multigas: Add multi gas to transaction receipt and remove collector (OffchainLabs#3594) * Replace multigas collector with receipts in system tests * Delete multigas collector (use receipts instead) * Fixup TODO and bump go-ethereum version * Simplify TestMultigasDataFromReceipts * Remove the dryRun boolean If the tests are run in dryRun mode, they don't trigger the findings expected. * bugfix: genesis validation without l1 reader (OffchainLabs#3607) * Rename namedfields to namedfieldsinit * Added more test cases * Test cross-package init * Remove dryRun flag * Linters cleanup (OffchainLabs#3609) * Properly detect diagnostics in tests (structinit linter) * Properly detect diagnostics in tests (koanf linter) * Properly detect diagnostics in tests (pointcheck linter) * Properly detect diagnostics in tests (rightshift linter) * Add license headers * Fix license position in the structinit test files * Hide multi-gas behind feature flag (OffchainLabs#3613) * Hide multi-gas behind feature flag Ensure we don't expose a wrong multi-gas before finishing all instrumentation milestones. Close NIT-3838 * Test expose multi-gas set to false * Arbos50 block gaslimit (OffchainLabs#3606) * block_builder: use block gas limit as a soft boundary * arbosstate: increase gas limit on upgrade to arbos50 * gas limit: test new behavior * make lint * block_processor: check arbos-version before other conditions * gas-limit-test fixes * gas-limit-test: touch-ups * arbosstate: reduce arbos-50 block-gas-limit multiplier * Ignore the go.work and go.work.sum files These files can make certain IDEs and go tooling work better with the repository for local development, but they also complicate some of the CI workflows in unexpected ways. Therefore, let's ignore them from diffs to prevent their accidentally being checked-in by developers who use them. * bold/e2e: fix Anvil startup race causing RPC hangs in end-to-end tests (OffchainLabs#3612) * e2e: start backend before rollup deployment to avoid RPC on unready Anvil * anvil backend: create RPC client in Start and add robust readiness check * Recursively fetch submodules (OffchainLabs#3621) * Rename the old module to '..._sender' * Migrate and refactor partial message management * Implement receiver logic * Fix test * Extract consts * Extract endpoint names * Document * Add linter check * Multigas: remove hardcoded value in TestMultigasStylus_GetBytes32 (OffchainLabs#3614) * Fix ProduceBlockAdvanced handling of txs that don't need sequencing hooks (OffchainLabs#3627) Co-authored-by: Pepper Lebeck-Jobe <[email protected]> * [config] Handle node.staker.strategy and node.bold.strategy appropriately (OffchainLabs#3582) * Handle node.staker.strategy and node.bold.strategy appropriately * Update nitro-testnode * Gas floor (OffchainLabs#3618) * update contracts for internal batch posting report fields * batch-gas-cost: check for floor-gas-cost in arbos-50 * replace calldataprice with parentGasFloorPerToken * internal_tx: use floorGasPerToken * update acts and support legacy feed * contracts: revert to version on master * precompiles: updates for parent-gas-floor * internal_tx: add per-batch-gas even if using floor * eth-config: update forkid * Add a test for gas floor * Enable delayed sequencer, satisfy finality requirements * internal_tx: use a constant instead of PerBatchGasCost * update gas floor price test * incomingmessage: fix comments * Remove leftover comment --------- Co-authored-by: Joshua Colvin <[email protected]> Co-authored-by: Preston Van Loon <[email protected]> Co-authored-by: Forostovec <[email protected]> Co-authored-by: Pepper Lebeck-Jobe <[email protected]> Co-authored-by: Tristan-Wilson <[email protected]> Co-authored-by: Chihyun Song <[email protected]> Co-authored-by: Alexandros Filios <[email protected]> Co-authored-by: Tsahi Zidenberg <[email protected]> Co-authored-by: radik878 <[email protected]> Co-authored-by: Maciej Kulawik <[email protected]> Co-authored-by: Mikhail Rogachev <[email protected]> Co-authored-by: Maciej Kulawik <[email protected]> Co-authored-by: Aman Sanghi <[email protected]> Co-authored-by: Ganesh Vanahalli <[email protected]> Co-authored-by: Pepper Lebeck-Jobe <[email protected]> Co-authored-by: sashass1315 <[email protected]> Co-authored-by: Raul Jordan <[email protected]> Co-authored-by: Gabriel de Quadros Ligneul <[email protected]> Co-authored-by: Alexandros Filios <[email protected]> Co-authored-by: Diego Ximenes <[email protected]> Co-authored-by: Gabriel de Quadros Ligneul <[email protected]> Co-authored-by: Tristan Wilson <[email protected]> Co-authored-by: strmfos <[email protected]> Co-authored-by: Piotr Mikołajczyk <[email protected]> Co-authored-by: Ruslan Granger <[email protected]> Co-authored-by: Hopium <[email protected]> Co-authored-by: Tuan Tran <[email protected]> Co-authored-by: Kolby Moroz Liebl <[email protected]> Co-authored-by: sashaodessa <[email protected]> Co-authored-by: Alvarez <[email protected]> Co-authored-by: Galoretka <[email protected]> Co-authored-by: GarmashAlex <[email protected]>
1 parent 19e42ea commit d7e415c

File tree

500 files changed

+48474
-11411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

500 files changed

+48474
-11411
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM golang:alpine
2+
3+
COPY entrypoint.sh /entrypoint.sh
4+
5+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: 'Go mod tidy checker'
2+
description: 'Checks that `go mod tidy` has been applied.'
3+
runs:
4+
using: 'docker'
5+
image: 'Dockerfile'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh -l
2+
set -e
3+
export PATH="$PATH:/usr/local/go/bin"
4+
5+
cd "$GITHUB_WORKSPACE"
6+
7+
cp go.mod go.mod.orig
8+
cp go.sum go.sum.orig
9+
10+
go mod tidy -compat=1.17
11+
12+
echo "Checking go.mod and go.sum:"
13+
checks=0
14+
if [ "$(diff -s go.mod.orig go.mod | grep -c 'Files go.mod.orig and go.mod are identical')" = 1 ]; then
15+
echo "- go.mod is up to date."
16+
checks=$((checks + 1))
17+
else
18+
echo "- go.mod is NOT up to date."
19+
fi
20+
21+
if [ "$(diff -s go.sum.orig go.sum | grep -c 'Files go.sum.orig and go.sum are identical')" = 1 ]; then
22+
echo "- go.sum is up to date."
23+
checks=$((checks + 1))
24+
else
25+
echo "- go.sum is NOT up to date."
26+
fi
27+
28+
if [ $checks -eq 2 ]; then
29+
exit 0
30+
fi
31+
32+
# Notify of any issues.
33+
echo "Run 'go mod tidy' to update."
34+
exit 1
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Install stable Rust'
2+
description: 'Installs stable Rust toolchain with appropriate targets and components.'
3+
4+
inputs:
5+
toolchain:
6+
required: true
7+
description: 'Toolchain to install'
8+
default: '1.88.0'
9+
targets:
10+
required: true
11+
description: 'Compilation targets to install'
12+
default: 'wasm32-wasip1, wasm32-unknown-unknown'
13+
components:
14+
required: true
15+
description: 'Cargo components to include'
16+
default: 'llvm-tools-preview, rustfmt, clippy'
17+
18+
outputs:
19+
version:
20+
description: 'The installed Rust version'
21+
value: ${{ steps.get-version.outputs.version }}
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Install Rust stable
27+
id: install-rust
28+
uses: dtolnay/rust-toolchain@stable
29+
with:
30+
toolchain: ${{ inputs.toolchain }}
31+
targets: ${{ inputs.targets }}
32+
components: ${{ inputs.components }}
33+
34+
- name: Get Rust version
35+
id: get-version
36+
shell: bash
37+
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT

.github/workflows/arbitrator-ci.yml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
detached: true
3838

3939
- name: Checkout
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141
with:
4242
submodules: recursive
4343

@@ -48,46 +48,27 @@ jobs:
4848
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
4949
5050
- name: Install go
51-
uses: actions/setup-go@v4
51+
uses: actions/setup-go@v5
5252
with:
53-
go-version: 1.23.x
53+
go-version: 1.24.x
5454

5555
- name: Install custom go-ethereum
5656
run: |
5757
cd /tmp
58-
git clone --branch v1.14.11 --depth 1 https://github.com/ethereum/go-ethereum.git
58+
git clone --branch v1.15.11 --depth 1 https://github.com/ethereum/go-ethereum.git
5959
cd go-ethereum
6060
go build -o /usr/local/bin/geth ./cmd/geth
6161
6262
- name: Setup nodejs
6363
uses: actions/setup-node@v4
6464
with:
65-
node-version: '18'
65+
node-version: '24'
6666
cache: 'yarn'
6767
cache-dependency-path: '**/yarn.lock'
6868

69-
- name: Install rust nightly
70-
uses: dtolnay/rust-toolchain@nightly
71-
id: install-rust-nightly
72-
with:
73-
toolchain: 'nightly-2025-02-14'
74-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
75-
components: 'rust-src, rustfmt, clippy'
76-
77-
- name: Install rust stable
69+
- name: Install rust
7870
id: install-rust
79-
uses: dtolnay/rust-toolchain@stable
80-
with:
81-
toolchain: '1.84.1'
82-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
83-
components: 'llvm-tools-preview, rustfmt, clippy'
84-
85-
- name: Set STYLUS_NIGHTLY_VER environment variable
86-
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"
87-
88-
- name: Get Rust version
89-
id: rust-version
90-
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
71+
uses: ./.github/actions/install-rust
9172

9273
- name: Cache Rust intermediate build products
9374
uses: actions/cache@v4
@@ -99,10 +80,10 @@ jobs:
9980
~/.cargo/git/db/
10081
arbitrator/target/
10182
arbitrator/wasm-libraries/target/
102-
key: ${{ runner.os }}-cargo-${{ steps.rust-version.outputs.version }}-full-${{ hashFiles('arbitrator/Cargo.lock') }}
83+
key: ${{ runner.os }}-cargo-${{ steps.install-rust.outputs.version }}-full-${{ hashFiles('arbitrator/Cargo.lock') }}
10384
restore-keys: |
104-
${{ runner.os }}-cargo-${{ steps.rust-version.outputs.version }}-full-
105-
${{ runner.os }}-cargo-${{ steps.rust-version.outputs.version }}-
85+
${{ runner.os }}-cargo-${{ steps.install-rust.outputs.version }}-full-
86+
${{ runner.os }}-cargo-${{ steps.install-rust.outputs.version }}-
10687
10788
- name: Cache wabt build
10889
id: cache-wabt
@@ -127,6 +108,7 @@ jobs:
127108
uses: foundry-rs/foundry-toolchain@v1
128109
with:
129110
cache: false
111+
version: v1.0.0
130112

131113
- name: Cache cbrotli
132114
uses: actions/cache@v4
@@ -138,16 +120,16 @@ jobs:
138120
target/lib/libbrotlicommon-static.a
139121
target/lib/libbrotlienc-static.a
140122
target/lib/libbrotlidec-static.a
141-
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}-arbitrator
142-
restore-keys: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
123+
key: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yml') }}-arbitrator
124+
restore-keys: ${{ runner.os }}-brotli-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yml') }}
143125

144126
- name: Build cbrotli-local
145127
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
146128
run: ./scripts/build-brotli.sh -l
147129

148130
- name: Setup emsdk
149131
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
150-
uses: mymindstorm/setup-emsdk@v12
132+
uses: mymindstorm/setup-emsdk@v14
151133
with:
152134
# Make sure to set a version number!
153135
version: 3.1.6

.github/workflows/ci.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,58 +29,40 @@ jobs:
2929

3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333
with:
34-
submodules: true
34+
submodules: recursive
3535

3636
- name: Install dependencies
3737
run: sudo apt update && sudo apt install -y wabt gotestsum
3838

3939
- name: Setup nodejs
4040
uses: actions/setup-node@v4
4141
with:
42-
node-version: '18'
42+
node-version: '24'
4343
cache: 'yarn'
4444
cache-dependency-path: '**/yarn.lock'
4545

4646
- name: Install go
4747
uses: actions/setup-go@v5
4848
with:
49-
go-version: 1.23.x
49+
go-version: 1.24.x
5050

5151
- name: Install wasm-ld
5252
run: |
5353
sudo apt-get update && sudo apt-get install -y lld-14
5454
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld
5555
56-
- name: Install rust stable
57-
uses: dtolnay/rust-toolchain@stable
56+
- name: Install rust
5857
id: install-rust
59-
with:
60-
toolchain: '1.84.1'
61-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
62-
components: 'llvm-tools-preview, rustfmt, clippy'
63-
64-
- name: Install rust nightly
65-
uses: dtolnay/rust-toolchain@nightly
66-
id: install-rust-nightly
67-
with:
68-
toolchain: 'nightly-2025-02-14'
69-
targets: 'wasm32-wasip1, wasm32-unknown-unknown'
70-
components: 'rust-src, rustfmt, clippy'
71-
72-
- name: Set STYLUS_NIGHTLY_VER environment variable
73-
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV"
74-
75-
- name: Get Rust version
76-
id: rust-version
77-
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT
58+
uses: ./.github/actions/install-rust
7859

7960
- name: Install Foundry
8061
uses: foundry-rs/foundry-toolchain@v1
8162
with:
8263
cache: false
83-
64+
version: v1.0.0
65+
8466
- name: Install cbindgen
8567
run: cargo install --force cbindgen
8668

@@ -102,8 +84,8 @@ jobs:
10284
arbitrator/wasm-libraries/soft-float/
10385
target/etc/initial-machine-cache/
10486
/home/runner/.rustup/toolchains/
105-
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.rust-version.outputs.version }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
106-
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.rust-version.outputs.version }}-
87+
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.version }}-min-${{ hashFiles('arbitrator/Cargo.lock') }}
88+
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.install-rust.outputs.version }}-
10789

10890
- name: Cache cbrotli
10991
uses: actions/cache@v4
@@ -115,7 +97,7 @@ jobs:
11597
target/lib/libbrotlicommon-static.a
11698
target/lib/libbrotlienc-static.a
11799
target/lib/libbrotlidec-static.a
118-
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yaml') }}
100+
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yml') }}
119101

120102
- name: Build cbrotli-local
121103
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
@@ -207,7 +189,7 @@ jobs:
207189
path: full.log
208190

209191
- name: Upload coverage to Codecov
210-
uses: codecov/codecov-action@v2
192+
uses: codecov/codecov-action@v5
211193
if: matrix.test-mode == 'defaults'
212194
with:
213195
fail_ci_if_error: false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Close trivial PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
7+
jobs:
8+
close-trivial-pr:
9+
if: github.event.label.name == 'trivial'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
14+
steps:
15+
- name: Fetch CONTRIBUTING.md snippet
16+
id: snippet
17+
env:
18+
REPO: ${{ github.repository }}
19+
run: |
20+
SNIPPET=$(curl -sSfL "https://raw.githubusercontent.com/${REPO}/refs/heads/master/CONTRIBUTING.md" \
21+
| sed -n '/<!-- start-trivial-prs -->/,/<!-- end-trivial-prs -->/p' \
22+
| sed '/<!--.*-->/d')
23+
24+
# Use GitHub Actions heredoc-style output to preserve multiline content
25+
echo "snippet<<EOF" >> $GITHUB_OUTPUT
26+
echo "$SNIPPET" >> $GITHUB_OUTPUT
27+
echo "EOF" >> $GITHUB_OUTPUT
28+
29+
- name: Comment and Close PR
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
PR_NUMBER=${{ github.event.pull_request.number }}
34+
REPO=${{ github.repository }}
35+
DEF_BRANCH=${{ github.event.repository.default_branch }}
36+
SNIPPET="${{ steps.snippet.outputs.snippet }}"
37+
38+
gh pr close $PR_NUMBER --repo $REPO --comment "Thank you for your contribution. However, this PR has been automatically closed because it was labeled as **trivial**. As stated in our [CONTRIBUTING.md](../blob/${DEF_BRANCH}/CONTRIBUTING.md):
39+
40+
---
41+
42+
${SNIPPET}
43+
44+
---
45+
46+
We appreciate meaningful contributions!"

0 commit comments

Comments
 (0)