Skip to content

Commit

Permalink
Merge branch 'main' into 638-genesis-generator-use-already-built-dock…
Browse files Browse the repository at this point in the history
…er-image
  • Loading branch information
jonesho authored Feb 13, 2025
2 parents 18a7faf + 4c01e01 commit 04f9244
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 20 deletions.
8 changes: 4 additions & 4 deletions contracts/src/verifiers/PlonkVerifierSepoliaFull.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ contract PlonkVerifierSepoliaFull {
uint256 private constant VK_INV_DOMAIN_SIZE =
21888242219518804655518433051623070663413851959604507555939307129453691614729;
uint256 private constant VK_OMEGA = 19200870435978225707111062059747084165650991997241425080699860725083300967194;
uint256 private constant VK_QL_COM_X = 8791953269463341205557871101259507996780723286161819310325979428133900775536;
uint256 private constant VK_QL_COM_Y = 509930487306580615721389606402236408871893209891798072450417817936817028378;
uint256 private constant VK_QR_COM_X = 8974326848992709669299953046334946720217781537821165195144391546678806639398;
uint256 private constant VK_QR_COM_Y = 17578473770133360591125707558181258686792677713567182412011489664217399308642;
uint256 private constant VK_QL_COM_X = 12104249492201366014770601180218217087634620796947915554926430540079211471136;
uint256 private constant VK_QL_COM_Y = 16368765726039386816039137309462852696594764208022019346196751288531124781562;
uint256 private constant VK_QR_COM_X = 9249964688252027290429946387944339390798336608687465556729281806056054398592;
uint256 private constant VK_QR_COM_Y = 2523673455311573259139920347005827709063881352795501038091237656008079847495;
uint256 private constant VK_QM_COM_X = 5553410513240938543232634851474389708189012141911611575921923499176928976035;
uint256 private constant VK_QM_COM_Y = 21267989559503205894532435033155162591528358593663117280327683708498106399392;
uint256 private constant VK_QO_COM_X = 13140407506194185536762256003490074009791461766528862809770970563406607579309;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"finalShnarf": "0x7a136069d307ccefc5b6717ea36f57cb2b84a46252f5187eb33b97293014817b",
"parentAggregationFinalShnarf": "0x96753ec2fed56f5b394eb094eb5730e0f177f2a8da6b316c0d9af5a2922fb432",
"aggregatedProof": "0x177a72544b7f9a348229134444086a9aebb4ceb7926d9294c6a6ada22f60c70d04edba6b21762652bb0b6a9dc35a44aa9ce824ca5f070ab513cdc03de4820046138498bb54786094bd48356dd2cfa3f0818b773c20db2a88f139c4cb160893ab28ce46438d707c965f3c3e071ebea4bea19d756a991d017d1654e3fc3800501420e4cf7591a3440103081d56cdc4431cca7d6f3b6e06dca8fbfda2320ae3ab7c2fae1d18b54685fb34fae08b57cb965134f0ba722111405cc138932328e9c09225be749d7e2740523ba91f0654c201bdff05bc175c4794ddf24b3d0d59dd29bc076ea535bfff5d31e02d8281d520d74dd6a4161cee29fd0d9d2e1cff776607ce1403e48ada601a75f6ffbf3bdbab44b0e1790b896b09f749227837c23624f0b2159cb20de349abb2e12f9e735271035884b37365cafc1da5ff27586b7691cb9a1c52b1cc618d25a9bad94742a18b4ba68cbf2b557d84bb54f28c7ce5792a16e328937347a214a077b859d13f2a244d92723de8aa6fc517c7d1ff44d5a378bdcd1283e29f2abc87e8fb7034169da9633a4f92058b4f70ec99f1e7e46a518519c91dac2b9158394e406141bd1f0040b664d972db9485e708e8e5980ac15bffe52c272bb71f5930b8aad319eb59ca7af7dae0485c6afdc1e7070ab5add93d6ea3951fc29fcb36bcca011a1ec93cb9254491f9238d4be9fb59366bdb54a7919491be1d3fbd72d22998c3aace2cddb352117f06e6c5347d99fabd5addfcb33f81362d21b720f44db8d9e990b5ad01a31ea3f81ff37b0af83843d66f41e25af125b01e05ae002683c453bbb9a7fe339e5b1dfa386be40313ad4b54577d09f714228d721193128e34077f0405bf0f0463e534c62b1dd38fdaa62fba7e9cebd3489736391235753f7a90175c3d274533185b7a28cc817910c9d827c820063260c1d1c9251dbc882318ae3eb556e929643a6dad978cf03b184f1d42f3eab6d0761b7ad0492896d01258aa58caf3789c9a13c510ac60322b2aa07475644bf5b7d54065c037232af7903687bf08c04303b4fb58dbcc6469a7c044e37e2c696f354678aad0c2053c174b7040bb89c8e0909238880f0d11334c48d1343a51f8fbd492edfd32e105803424d34e8a8aaccca2bb811287951bd2f531d97f861a8a448e22d3af151014c155aafb33938fc4fc9bd1112195cd6992786cbbd29ae2a80e06bdbbd133fd",
"aggregatedProverVersion": "4.0.0",
"aggregatedProof": "0x05687c5c2adf1b532d6ce4638f0359198f26156f9c2ea89cce6bf053408ed1160d66657b0124ae30f27212ed97c7ca61b4e958ebfa04b01f386c2ecef78bca271f906ff7134d107ec21157f3876a40865fed12f18a4baad5f01308c5932bcc7d231a6bca20e7a08e0c8f33d2ca5607d8a2ba646145e212d81c20d4f7e00b268c2909e053d63cad8aed1a36e5c499c11faf08614e3ea83cbb17be7f5989fccb0401083ea500ce5a78284b8bfa879d7bff12458c6476f352309d692a9b2b1e96340215f01cf56e8943ff1689fd25020c17f3c3c55cb1d635c4bd3a3341f4d0a79522b7a40ed4453ba206d61fa63e6b23bad13a3748c38401f28da4d276847e4fb41c43ba1eb533e57604bc275946fafdb4e82d685b67d7f32aa34230c9865f53d42db12120fb351f2d9a15e8ba8bfef5151624d65f60d62efe74e688f6bdb289362fa2f2406ac44d66ea92804d6f46673d117ec3b15fef75956ca372261dc367bb260a46d3bc33b673021c12757cac1a7bf04db9710b7171a92fef1a386a12fd330affed20493852147106c6f4d2636fbefe19cfa453451b99da94614edb026dcf295669ea59bf0461c4b2b595f753707ce99a714648c7151b5ec72f2919b93c3e1dcb8c629483c89c4f34d0e77e4d49e7d6a87fd71084005c0c52a270ba7d88c70aacb5f5b1a9edb913e9893a9facecf30512f84aba72b7423d54daaad2a6c3bf08c58483bcbe69a729c259661a1ab66243d38856134c073cc41fd128827af018098e53a4b7102fb1d4d4389dae400dfd77bd28ad4dade082445ecc3aa2b123e11cdb55d81d4cdc46bf6fe1dab15b3706fd5b333e86c4a1c929b84f32d0ce36800d43ef6f6ee65cce9ea762ad4293e2f5ef66101b3a712a6e7536a5139b471d870575048e2f6ea52f756664dc0e981d5db52ce8213e84d4a32a1d6d1b091348660f476e377d69c3c38e83daaebdfa8f416d6a59c887997364d36ab6a7140eb0fd199f7611363ede4b6ac441fb321a2995093015e82c80b499948c270ebd963e0d1d73a65560047282c3a5dcf886a3c0927210e0f74567e63b9f5b1dcc0f9786271418d9206767b362e5201e60e0151569a7a6e6ea9aef3ae1f67b42bca343d6c6225649cfefb4b47729f28f75779dd5ad9c7223aca400ab84c370105491fd567f2d8a4a7f51ca01d53f0b48218a2ac617263b348718afc85281c63f67406ff4be",
"aggregatedProverVersion": "4.0.1",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x2bf2182cedb120b0498f6f5c21d3fded5814d1baaaaf0ad0095c4af66aa43760",
"dataHashes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class L2NetworkGasPricingService(

data class Config(
val feeHistoryFetcherConfig: FeeHistoryFetcherImpl.Config,
val jsonRpcPricingPropagationEnabled: Boolean,
val legacy: LegacyGasPricingCalculatorConfig,
val jsonRpcGasPriceUpdaterConfig: GasPriceUpdaterImpl.Config,
val jsonRpcGasPriceUpdaterConfig: GasPriceUpdaterImpl.Config?,
val jsonRpcPriceUpdateInterval: Duration,
val extraDataPricingPropagationEnabled: Boolean,
val extraDataUpdateInterval: Duration,
Expand Down Expand Up @@ -82,7 +81,7 @@ class L2NetworkGasPricingService(
}

private val minMineableFeesPricerService: MinMineableFeesPricerService? =
if (config.jsonRpcPricingPropagationEnabled) {
if (config.jsonRpcGasPriceUpdaterConfig != null) {
val l2SetGasPriceUpdater: GasPriceUpdater = GasPriceUpdaterImpl(
httpJsonRpcClientFactory = httpJsonRpcClientFactory,
config = config.jsonRpcGasPriceUpdaterConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ data class L2NetworkGasPricingTomlDto(

val legacy: LegacyGasPricingTomlDto,
val variableCostPricing: VariableCostPricingTomlDto,
val jsonRpcPricingPropagation: JsonRpcPricingPropagationTomlDto,
val jsonRpcPricingPropagation: JsonRpcPricingPropagationTomlDto?,
val extraDataPricingPropagation: ExtraDataPricingPropagationTomlDto
) : FeatureToggleable, RequestRetryConfigurable {
init {
require(feeHistoryBlockCount > 0) { "feeHistoryBlockCount must be greater than 0" }
require(blobSubmissionExpectedExecutionGas > 0) { "blobSubmissionExpectedExecutionGas must be greater than 0" }
require(l1BlobGas > 0) { "l1BlobGas must be greater than 0" }

require(disabled || (jsonRpcPricingPropagation.enabled || extraDataPricingPropagation.enabled)) {
require(disabled || (jsonRpcPricingPropagation?.enabled == true || extraDataPricingPropagation.enabled)) {
"There is no point of enabling L2 network gas pricing if " +
"both jsonRpcPricingPropagation and extraDataPricingPropagation are disabled"
}
Expand Down Expand Up @@ -151,18 +151,22 @@ data class L2NetworkGasPricingTomlDto(
)
}
}
val gasPriceUpdaterConfig = if (jsonRpcPricingPropagation?.enabled == true) {
GasPriceUpdaterImpl.Config(
gethEndpoints = jsonRpcPricingPropagation.gethGasPriceUpdateRecipients,
besuEndPoints = jsonRpcPricingPropagation.besuGasPriceUpdateRecipients,
retryConfig = requestRetryConfig
)
} else {
null
}
return L2NetworkGasPricingService.Config(
feeHistoryFetcherConfig = FeeHistoryFetcherImpl.Config(
feeHistoryBlockCount = feeHistoryBlockCount.toUInt(),
feeHistoryRewardPercentile = feeHistoryRewardPercentile
),
jsonRpcPricingPropagationEnabled = jsonRpcPricingPropagation.enabled,
legacy = legacyGasPricingConfig,
jsonRpcGasPriceUpdaterConfig = GasPriceUpdaterImpl.Config(
gethEndpoints = jsonRpcPricingPropagation.gethGasPriceUpdateRecipients,
besuEndPoints = jsonRpcPricingPropagation.besuGasPriceUpdateRecipients,
retryConfig = requestRetryConfig
),
jsonRpcGasPriceUpdaterConfig = gasPriceUpdaterConfig,
jsonRpcPriceUpdateInterval = priceUpdateInterval.toKotlinDuration(),
extraDataPricingPropagationEnabled = extraDataPricingPropagation.enabled,
extraDataUpdateInterval = priceUpdateInterval.toKotlinDuration(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ class CoordinatorConfigTest {
feeHistoryBlockCount = 50U,
feeHistoryRewardPercentile = 15.0
),
jsonRpcPricingPropagationEnabled = true,
legacy = L2NetworkGasPricingService.LegacyGasPricingCalculatorConfig(
legacyGasPricingCalculatorBounds = BoundableFeeCalculator.Config(
feeUpperBound = 10_000_000_000.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ class L2NetworkGasPricingConfigTest {
feeHistoryBlockCount = 50U,
feeHistoryRewardPercentile = 15.0
),
jsonRpcPricingPropagationEnabled = true,
legacy = L2NetworkGasPricingService.LegacyGasPricingCalculatorConfig(
naiveGasPricingCalculatorConfig = GasUsageRatioWeightedAverageFeesCalculator.Config(
baseFeeCoefficient = 0.1,
Expand Down Expand Up @@ -310,7 +309,6 @@ class L2NetworkGasPricingConfigTest {
feeHistoryBlockCount = 50U,
feeHistoryRewardPercentile = 15.0
),
jsonRpcPricingPropagationEnabled = true,
legacy = L2NetworkGasPricingService.LegacyGasPricingCalculatorConfig(
naiveGasPricingCalculatorConfig = null,
legacyGasPricingCalculatorBounds = BoundableFeeCalculator.Config(
Expand Down Expand Up @@ -360,4 +358,191 @@ class L2NetworkGasPricingConfigTest {
)
)
}

@Test
fun `Undefined json rpc pricing propagation reification is correct`() {
val undefinedJsonRpcPropagation = """
[l2-network-gas-pricing]
disabled = false
price-update-interval = "PT12S"
fee-history-block-count = 50
fee-history-reward-percentile = 15
blob-submission-expected-execution-gas = 213000.0 # Lower to 120k as we improve efficiency
# Defaults to expected-blob-gas
#bytes-per-data-submission=131072.0 # 2^17
l1-blob-gas = 131072 # 2^17
[l2-network-gas-pricing.request-retry]
max-retries = 3
timeout = "PT6S"
backoff-delay = "PT1S"
failures-warning-threshold = 2
[l2-network-gas-pricing.variable-cost-pricing]
gas-price-fixed-cost = 3000000
legacy-fees-multiplier = 1.2
margin = 4.0
variable-cost-upper-bound = 10000000001 # ~10 GWEI
variable-cost-lower-bound = 90000001 # ~0.09 GWEI
[l2-network-gas-pricing.extra-data-pricing-propagation]
extra-data-update-recipient = "http://sequencer:8545/"
[l2-network-gas-pricing.legacy]
type="SampleTransaction"
gas-price-upper-bound = 10000000000 # 10 GWEI
gas-price-lower-bound = 90000000 # 0.09 GWEI
""".trimIndent()
val config = parseConfig(undefinedJsonRpcPropagation).reified()
val l2NetworkGasPricingRequestretryConfig = RequestRetryConfig(
maxRetries = 3u,
timeout = 6.seconds,
backoffDelay = 1.seconds,
failuresWarningThreshold = 2u
)

assertThat(config).isEqualTo(
L2NetworkGasPricingService.Config(
feeHistoryFetcherConfig = FeeHistoryFetcherImpl.Config(
feeHistoryBlockCount = 50U,
feeHistoryRewardPercentile = 15.0
),
legacy = L2NetworkGasPricingService.LegacyGasPricingCalculatorConfig(
naiveGasPricingCalculatorConfig = null,
legacyGasPricingCalculatorBounds = BoundableFeeCalculator.Config(
10_000_000_000.0,
90_000_000.0,
0.0
),
transactionCostCalculatorConfig = TransactionCostCalculator.Config(
sampleTransactionCostMultiplier = 1.0,
fixedCostWei = 3000000u,
compressedTxSize = 125,
expectedGas = 21000
)
),
jsonRpcGasPriceUpdaterConfig = null,
jsonRpcPriceUpdateInterval = 12.seconds,
extraDataPricingPropagationEnabled = true,
extraDataUpdateInterval = 12.seconds,
variableFeesCalculatorConfig = VariableFeesCalculator.Config(
blobSubmissionExpectedExecutionGas = 213_000u,
bytesPerDataSubmission = 131072u,
expectedBlobGas = 131072u,
margin = 4.0
),
variableFeesCalculatorBounds = BoundableFeeCalculator.Config(
feeUpperBound = 10_000_000_001.0,
feeLowerBound = 90_000_001.0,
feeMargin = 0.0
),
extraDataCalculatorConfig = MinerExtraDataV1CalculatorImpl.Config(
fixedCostInKWei = 3000u,
ethGasPriceMultiplier = 1.2
),
extraDataUpdaterConfig = ExtraDataV1UpdaterImpl.Config(
sequencerEndpoint = URI(/* str = */ "http://sequencer:8545/").toURL(),
retryConfig = l2NetworkGasPricingRequestretryConfig
)
)
)
}

@Test
fun `Json rpc pricing propagation can be disabled without complete removal`() {
val disabledJsonRpcPricingPropagation = """
[l2-network-gas-pricing]
disabled = false
price-update-interval = "PT12S"
fee-history-block-count = 50
fee-history-reward-percentile = 15
blob-submission-expected-execution-gas = 213000.0 # Lower to 120k as we improve efficiency
# Defaults to expected-blob-gas
#bytes-per-data-submission=131072.0 # 2^17
l1-blob-gas = 131072 # 2^17
[l2-network-gas-pricing.request-retry]
max-retries = 3
timeout = "PT6S"
backoff-delay = "PT1S"
failures-warning-threshold = 2
[l2-network-gas-pricing.variable-cost-pricing]
gas-price-fixed-cost = 3000000
legacy-fees-multiplier = 1.2
margin = 4.0
variable-cost-upper-bound = 10000000001 # ~10 GWEI
variable-cost-lower-bound = 90000001 # ~0.09 GWEI
[l2-network-gas-pricing.extra-data-pricing-propagation]
extra-data-update-recipient = "http://sequencer:8545/"
[l2-network-gas-pricing.legacy]
type="SampleTransaction"
gas-price-upper-bound = 10000000000 # 10 GWEI
gas-price-lower-bound = 90000000 # 0.09 GWEI
[l2-network-gas-pricing.json-rpc-pricing-propagation]
disabled = true
geth-gas-price-update-recipients = []
besu-gas-price-update-recipients = []
""".trimIndent()
val config = parseConfig(disabledJsonRpcPricingPropagation).reified()
val l2NetworkGasPricingRequestretryConfig = RequestRetryConfig(
maxRetries = 3u,
timeout = 6.seconds,
backoffDelay = 1.seconds,
failuresWarningThreshold = 2u
)

assertThat(config).isEqualTo(
L2NetworkGasPricingService.Config(
feeHistoryFetcherConfig = FeeHistoryFetcherImpl.Config(
feeHistoryBlockCount = 50U,
feeHistoryRewardPercentile = 15.0
),
legacy = L2NetworkGasPricingService.LegacyGasPricingCalculatorConfig(
naiveGasPricingCalculatorConfig = null,
legacyGasPricingCalculatorBounds = BoundableFeeCalculator.Config(
10_000_000_000.0,
90_000_000.0,
0.0
),
transactionCostCalculatorConfig = TransactionCostCalculator.Config(
sampleTransactionCostMultiplier = 1.0,
fixedCostWei = 3000000u,
compressedTxSize = 125,
expectedGas = 21000
)
),
jsonRpcGasPriceUpdaterConfig = null,
jsonRpcPriceUpdateInterval = 12.seconds,
extraDataPricingPropagationEnabled = true,
extraDataUpdateInterval = 12.seconds,
variableFeesCalculatorConfig = VariableFeesCalculator.Config(
blobSubmissionExpectedExecutionGas = 213_000u,
bytesPerDataSubmission = 131072u,
expectedBlobGas = 131072u,
margin = 4.0
),
variableFeesCalculatorBounds = BoundableFeeCalculator.Config(
feeUpperBound = 10_000_000_001.0,
feeLowerBound = 90_000_001.0,
feeMargin = 0.0
),
extraDataCalculatorConfig = MinerExtraDataV1CalculatorImpl.Config(
fixedCostInKWei = 3000u,
ethGasPriceMultiplier = 1.2
),
extraDataUpdaterConfig = ExtraDataV1UpdaterImpl.Config(
sequencerEndpoint = URI(/* str = */ "http://sequencer:8545/").toURL(),
retryConfig = l2NetworkGasPricingRequestretryConfig
)
)
)
}
}

0 comments on commit 04f9244

Please sign in to comment.