Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change constants to immutable format. #87

Merged
merged 13 commits into from
May 30, 2024
Merged

Change constants to immutable format. #87

merged 13 commits into from
May 30, 2024

Conversation

iteyelmp
Copy link
Contributor

@iteyelmp iteyelmp commented May 16, 2024

immutable can be initialized in the constructor, and the value will be used as part of the bytecode.

old constants

 17, // maxKvSizeBits, 131072
 39, // shardSizeBits ~ 512G
 2, // randomChecks
 4718592000, // minimumDiff 5 * 3 * 3600 * 1024 * 1024 / 12 = 4718592000 for 5 replicas that can have 1M IOs in one epoch
 7200, // cutoff = 2/3 * target internal (3 hours), 3 * 3600 * 2/3
 32, // diffAdjDivisor
 100, // treasuryShare, means 1%

 startTime, // startTime
 1500000000000000, // storageCost - 1,500,000Gwei forever per blob - https://ethresear.ch/t/ethstorage-scaling-ethereum-storage-via-l2-and-da/14223/6#incentivization-for-storing-m-physical-replicas-1
 340282366367469178095360967382638002176n, // dcfFactor, it mean 0.95 for yearly discount
 1048576, // nonceLimit 1024 * 1024 = 1M samples and finish sampling in 1.3s with IO rate 6144 MB/s: 4k * 2(random checks) / 6144 = 1.3s
 treasuryAddress, // treasury
 3145728000000000000000n, // prepaidAmount - 50% * 2^39 / 131072 * 1500000Gwei, it also means 3145 ETH for half

put blob gas use:
https://dashboard.tenderly.co/tx/sepolia/0x0364e1e03435154398f25c47db94676e8cf00c14ad1980459c60ccdb2271d182/gas-usage

replace blob gas use:
https://dashboard.tenderly.co/tx/sepolia/0x59cf5e73c2e06cc8631382f463d43f53524155eba1419ed96e3e36f63f6809ad/gas-usage

@iteyelmp iteyelmp requested a review from qzhodl May 23, 2024 07:13
scripts/deploy.js Outdated Show resolved Hide resolved
@iteyelmp iteyelmp requested a review from syntrust May 28, 2024 09:11
@iteyelmp iteyelmp merged commit d5e3987 into main May 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants