Skip to content

Commit

Permalink
Merge branch 'main' into prover/feat/libdecompressor-abuseeth
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabaie authored Oct 14, 2024
2 parents 2aa44a8 + c186d66 commit 9866b5d
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/coordinator-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
build-and-publish:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Coordinator build
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,17 @@ jobs:
traces_api_facade_changed: ${{ needs.filter-commit-changes.outputs.traces-api-facade }}
secrets: inherit

docker-build:
manual-docker-build-and-e2e-tests:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images ]
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
steps:
- name: Deploy environment
run: |
echo "Build and e2e test environment deployed"
docker-build:
needs: [ store-image-name-and-tags, filter-commit-changes, check-and-tag-images, manual-docker-build-and-e2e-tests ]
uses: ./.github/workflows/build-and-publish.yml
with:
commit_tag: ${{ needs.store-image-name-and-tags.outputs.commit_tag }}
Expand Down Expand Up @@ -153,7 +162,7 @@ jobs:
secrets: inherit

run-e2e-tests-geth-tracing:
needs: [ store-image-name-and-tags, docker-build ]
needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests ]
if: ${{ always() && needs.docker-build.result == 'success' }}
concurrency:
group: run-e2e-tests-geth-tracing-${{ github.workflow }}-${{ github.ref }}
Expand All @@ -167,7 +176,7 @@ jobs:
secrets: inherit

run-e2e-tests:
needs: [ store-image-name-and-tags, docker-build ]
needs: [ store-image-name-and-tags, docker-build, manual-docker-build-and-e2e-tests ]
if: ${{ always() && needs.docker-build.result == 'success' }}
concurrency:
group: run-e2e-tests-${{ github.workflow }}-${{ github.ref }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/postman-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
build-and-publish:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Postman build
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/prover-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
build-and-publish:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Prover build
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/reuse-run-e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ jobs:
outputs:
tests_outcome: ${{ steps.run_e2e_tests.outcome }}
runs-on: [self-hosted, ubuntu-22.04, X64, large]
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
steps:
- name: Setup upterm session
if: ${{ inputs.e2e-tests-with-ssh }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/traces-api-facade-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
build-and-publish:
runs-on: [self-hosted, ubuntu-20.04, X64, small]
name: Traces api facade build
environment: ${{ github.ref != 'refs/heads/main' && 'docker-build-and-e2e' || '' }}
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,22 @@ expected-traces-api-version-v2="v0.8.0-rc3"
[traces.counters-v2]
endpoints=["http://traces-node-v2:8545/"]
request-limit-per-endpoint=20
request-retry.max-retries=4
request-retry.backoff-delay="PT1S"
request-retry.failures-warning-threshold=2
[traces.conflation-v2]
endpoints=["http://traces-node-v2:8545/"]
request-limit-per-endpoint=2
request-retry.max-retries=4
request-retry.backoff-delay="PT1S"
request-retry.failures-warning-threshold=2

[dynamic-gas-price-service]
geth-gas-price-update-recipients=[
"http://l2-node:8545/"
]

[l2-network-gas-pricing.legacy.sample-transaction-gas-pricing]
plain-transfer-cost-multiplier=1.0
# Ratio of 350 / 29400 is based on data from Mainnet. Only 0.3% of transactions are less profitable than this
# Meaning 99.7% of transactions will be includable if priced using eth_gasPrice
compressed-tx-size=350
expected-gas=29400
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,98 @@ class CoordinatorConfigTest {
}
}

@Test
fun parsesValidTracesV2ConfigOverride() {
val smartContractErrorCodes: SmartContractErrors =
CoordinatorAppCli.loadConfigsOrError<SmartContractErrorCodesConfig>(
listOf(File("../../config/common/smart-contract-errors.toml"))
).get()!!.smartContractErrors
val timeOfDayMultipliers =
CoordinatorAppCli.loadConfigsOrError<GasPriceCapTimeOfDayMultipliersConfig>(
listOf(File("../../config/common/gas-price-cap-time-of-day-multipliers.toml"))
)
val tracesLimitsConfigs =
CoordinatorAppCli.loadConfigsOrError<TracesLimitsV1ConfigFile>(
listOf(File("../../config/common/traces-limits-v1.toml"))
)
val tracesLimitsV2Configs =
CoordinatorAppCli.loadConfigsOrError<TracesLimitsV2ConfigFile>(
listOf(File("../../config/common/traces-limits-v2.toml"))
)

CoordinatorAppCli.loadConfigsOrError<CoordinatorConfigTomlDto>(
listOf(
File("../../config/coordinator/coordinator-docker.config.toml"),
File("../../config/coordinator/coordinator-docker-traces-v2-override.config.toml")
)
)
.onFailure { error: String -> fail(error) }
.onSuccess {
val configs = it.copy(
conflation = it.conflation.copy(
_tracesLimitsV1 = tracesLimitsConfigs.get()?.tracesLimits?.let { TracesCountersV1(it) },
_tracesLimitsV2 = tracesLimitsV2Configs.get()?.tracesLimits?.let { TracesCountersV2(it) },
_smartContractErrors = smartContractErrorCodes
),
l1DynamicGasPriceCapService = it.l1DynamicGasPriceCapService.copy(
gasPriceCapCalculation = it.l1DynamicGasPriceCapService.gasPriceCapCalculation.copy(
timeOfDayMultipliers = timeOfDayMultipliers.get()?.gasPriceCapTimeOfDayMultipliers
)
)
)

val expectedConfig =
coordinatorConfig.copy(
zkTraces = zkTracesConfig.copy(ethApi = URI("http://traces-node-v2:8545").toURL()),
l2NetworkGasPricingService = l2NetworkGasPricingServiceConfig.copy(
legacy =
l2NetworkGasPricingServiceConfig.legacy.copy(
transactionCostCalculatorConfig =
l2NetworkGasPricingServiceConfig.legacy.transactionCostCalculatorConfig?.copy(
compressedTxSize = 350,
expectedGas = 29400
)
)
),
traces = tracesConfig.copy(
switchToLineaBesu = true,
expectedTracesApiVersionV2 = "v0.8.0-rc3",
conflationV2 = tracesConfig.conflation.copy(
endpoints = listOf(URI("http://traces-node-v2:8545/").toURL())
),
countersV2 = TracesConfig.FunctionalityEndpoint(
listOf(
URI("http://traces-node-v2:8545/").toURL()
),
requestLimitPerEndpoint = 20U,
requestRetry = RequestRetryConfigTomlFriendly(
backoffDelay = Duration.parse("PT1S"),
failuresWarningThreshold = 2
)
)
),
proversConfig = proversConfig.copy(
proverA = proversConfig.proverA.copy(
execution = proversConfig.proverA.execution.copy(
requestsDirectory = Path.of("/data/prover/v3/execution/requests"),
responsesDirectory = Path.of("/data/prover/v3/execution/responses")
),
blobCompression = proversConfig.proverA.blobCompression.copy(
requestsDirectory = Path.of("/data/prover/v3/compression/requests"),
responsesDirectory = Path.of("/data/prover/v3/compression/responses")
),
proofAggregation = proversConfig.proverA.proofAggregation.copy(
requestsDirectory = Path.of("/data/prover/v3/aggregation/requests"),
responsesDirectory = Path.of("/data/prover/v3/aggregation/responses")
)
)
)
)

assertEquals(expectedConfig, configs.reified())
}
}

@Test
fun invalidConfigReturnsErrorResult() {
val configs =
Expand Down

0 comments on commit 9866b5d

Please sign in to comment.