diff --git a/.circleci/config.yml b/.circleci/config.yml index 4993de619..a0da0e0df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -433,7 +433,7 @@ aliases: api-cpu-threshold: 75 api-memory-limit: 1Gi api-memory-request: 500Mi - stateful-service-replicas: 2 + stateful-service-replicas: 1 service-name-1: daemon service-image-1: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101315.2 service-cpu-limit-1: "2" @@ -473,7 +473,7 @@ aliases: api-replicas: 1 api-max-replicas: 2 api-memory-limit: 500Mi - stateful-service-replicas: 1 + stateful-service-replicas: 0 - &bnbsmartchain assetName: bnbsmartchain diff --git a/node/coinstacks/optimism/api/src/controller.ts b/node/coinstacks/optimism/api/src/controller.ts index 34251c393..caab55b18 100644 --- a/node/coinstacks/optimism/api/src/controller.ts +++ b/node/coinstacks/optimism/api/src/controller.ts @@ -135,14 +135,19 @@ export class Optimism extends EVM implements BaseAPI, API { // ecotone l1GasPrice = ((l1BaseFee * baseFeeScalar * 16) + (blobBaseFee * baseFeeScalar)) / (16 * 10^decimals) if (isEcotone) { - const l1BaseFee = BigNumber.from(await gpo.l1BaseFee()) - const baseFeeScalar = BigNumber.from(await gpo.baseFeeScalar()) - const blobBaseFee = BigNumber.from(await gpo.blobBaseFeeScalar()) - const blobBaseFeeScalar = BigNumber.from(await gpo.blobBaseFeeScalar()) + const [l1BaseFee, baseFeeScalar, blobBaseFee, blobBaseFeeScalar, decimals] = ( + await Promise.all([ + gpo.l1BaseFee(), + gpo.baseFeeScalar(), + gpo.blobBaseFeeScalar(), + gpo.blobBaseFeeScalar(), + gpo.decimals(), + ]) + ).map((value) => BigNumber.from(value)) + const scaledBaseFee = l1BaseFee.mul(baseFeeScalar).mul(16) const scaledBlobBaseFee = blobBaseFee.mul(blobBaseFeeScalar) - const decimals = BigNumber.from(await gpo.decimals()) const l1GasPrice = new BN(scaledBaseFee.add(scaledBlobBaseFee).toString()).div( new BN(16).times(new BN(10).exponentiatedBy(decimals.toString())) ) @@ -151,8 +156,10 @@ export class Optimism extends EVM implements BaseAPI, API { } // legacy l1GasPrice = l1BaseFee * scalar - const l1BaseFee = BigNumber.from(await gpo.l1BaseFee()) - const scalar = BigNumber.from(await gpo.scalar()) + const [l1BaseFee, scalar] = (await Promise.all([gpo.l1BaseFee(), gpo.scalar()])).map((value) => + BigNumber.from(value) + ) + const l1GasPrice = l1BaseFee.mul(scalar) return { l1GasPrice: l1GasPrice.toString(), ...gasFees }