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

feat: delay buffer #160

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ca528d9
feat: delay buffer
shotaronowhere Mar 13, 2024
7db8e74
test: delay buffer blob tests
shotaronowhere Mar 13, 2024
55a68bf
chore: add storage to sequencer inbox
shotaronowhere Mar 13, 2024
6c80b4d
feat: upgradability and tests
shotaronowhere Mar 15, 2024
5ebd0fa
chore: refactoring
shotaronowhere Mar 18, 2024
a9f9e08
chore: deploy config
shotaronowhere Mar 18, 2024
aad9450
chore: refactor delay buffer types
shotaronowhere Mar 18, 2024
b95f82b
chore: refactor buffer types in foundry tests
shotaronowhere Mar 18, 2024
beea9d6
chore: storage test refactor struct
shotaronowhere Mar 18, 2024
e6192ec
chore: update function selectors
shotaronowhere Mar 18, 2024
2c885f4
Merge branch 'develop' into delay-buffer
gzeoneth Mar 19, 2024
de09c0a
chore: proxy upgrade int flexibility and refactoring
shotaronowhere Mar 25, 2024
2657f87
chore: refactor
shotaronowhere Mar 27, 2024
a49b867
chore: fn selector update
shotaronowhere Mar 27, 2024
fbefcc3
chore: slither
shotaronowhere Mar 27, 2024
ffb1c75
chore: slither exceptions
shotaronowhere Mar 27, 2024
3d546d0
chore: slither
shotaronowhere Mar 27, 2024
e679a2d
chore: refactor seq inbox function order
shotaronowhere Mar 27, 2024
a9ceec9
feat: simplified replenishment and refactoring
shotaronowhere Apr 5, 2024
217ee7e
feat: delay buffer depend on blocks only, no time dependence
shotaronowhere Apr 8, 2024
b91139b
chore: fn selector updates
shotaronowhere Apr 8, 2024
103ed98
feat: remove sync batch post path and pack buffer config w data
shotaronowhere Apr 9, 2024
deec15a
chore: refactor
shotaronowhere Apr 10, 2024
b26deed
chore: visibility
shotaronowhere Apr 11, 2024
5d73ac0
feat: bridge creator refactor
shotaronowhere Apr 11, 2024
7e98b86
chore: style
shotaronowhere Apr 11, 2024
9bda58a
fix: blob posting test
shotaronowhere Apr 11, 2024
e494578
feat: add addSequencerL2BatchDelayProof method
shotaronowhere Apr 12, 2024
8efab16
chore: bridge creator refactor
shotaronowhere Apr 12, 2024
87a9488
chore: test refactor
shotaronowhere Apr 12, 2024
0082e9d
chore: bump slither
shotaronowhere Apr 12, 2024
69b0e42
fix: deployment variables
shotaronowhere Apr 12, 2024
fba99fb
fix: config variable name
shotaronowhere Apr 12, 2024
39ab0a8
fix: config var naming
shotaronowhere Apr 12, 2024
be99953
chore: natspec fix
shotaronowhere Apr 15, 2024
2a04d96
fix: deploy seq inbox param
shotaronowhere Apr 15, 2024
506e91c
feat: deplete opt
shotaronowhere Apr 15, 2024
99431bb
chore: remove comment
shotaronowhere Apr 15, 2024
db0ba96
fix: 3074 support (#168)
gzeoneth Apr 15, 2024
a6cf5f8
feat: always replenish on buffer update
shotaronowhere Apr 15, 2024
428fcac
feat: sync validity opt
shotaronowhere Apr 15, 2024
eb07a71
feat: sync expiry simplification
shotaronowhere Apr 16, 2024
dc9d555
fix: delay udpate tests
shotaronowhere Apr 16, 2024
307c96c
chore: bump slither
shotaronowhere Apr 16, 2024
097d255
chore: bump slither
shotaronowhere Apr 16, 2024
3547f0b
chore: bump slither
shotaronowhere Apr 16, 2024
3f8e711
chore: refactor buffer update fn name
shotaronowhere Apr 16, 2024
e4c90d1
chore: post audit nat spec and custom error refactor
shotaronowhere Apr 30, 2024
1c6858d
fix: test fixed and added mutation testing
shotaronowhere Apr 30, 2024
e2d2b62
chore: rename test var
shotaronowhere Apr 30, 2024
a2a5879
Merge remote-tracking branch 'origin/develop' into delay-buffer
shotaronowhere May 3, 2024
7ed6725
Merge remote-tracking branch 'origin/develop' into delay-buffer
shotaronowhere May 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions scripts/config.ts.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,31 @@ export const config = {
chainConfig:
'{"chainId":13331370,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x1234123412341234123412341234123412341234","GenesisBlockNum":0}}',
genesisBlockNum: ethers.BigNumber.from('0'),
sequencerInboxMaxTimeVariation: {
delayBlocks: ethers.BigNumber.from('5760'),
maxTimeVariation: {
delayBlocks: ethers.BigNumber.from('7200'),
futureBlocks: ethers.BigNumber.from('12'),
delaySeconds: ethers.BigNumber.from('86400'),
futureSeconds: ethers.BigNumber.from('3600'),
},
delayConfig: {
thresholdBlocks: ethers.BigNumber.from('600'),
thresholdSeconds: ethers.BigNumber.from('7200'),
maxBufferBlocks: ethers.BigNumber.from('14400'),
maxBufferSeconds: ethers.BigNumber.from('172800'),
replenishRate: {
blocksPerPeriod: ethers.BigNumber.from('1'),
secondsPerPeriod: ethers.BigNumber.from('1'),
periodBlocks: ethers.BigNumber.from('12'),
periodSeconds: ethers.BigNumber.from('12'),
},
}
},
validators: [
'0x1234123412341234123412341234123412341234',
'0x1234512345123451234512345123451234512345',
],
batchPoster: '0x1234123412341234123412341234123412341234',
batchPosterManager: '0x1234123412341234123412341234123412341234',
batchPosters: [
'0x1234123412341234123412341234123412341234'
]
}
38 changes: 35 additions & 3 deletions scripts/deploymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export async function deployContract(
signer: any,
constructorArgs: any[] = [],
verify: boolean = true,
overrides?: Overrides
overrides?: Overrides,
contractPathAndName?: string // optional
): Promise<Contract> {
const factory: ContractFactory = await ethers.getContractFactory(contractName)
const connectedFactory: ContractFactory = factory.connect(signer)
Expand All @@ -66,10 +67,12 @@ export async function deployContract(

const contract: Contract = await connectedFactory.deploy(...deploymentArgs)
await contract.deployTransaction.wait()
// sleep 3 slots to ensure contract is mined
await new Promise((r) => setTimeout(r, 3*12000))
console.log(`New ${contractName} created at address:`, contract.address)

if (verify)
await verifyContract(contractName, contract.address, constructorArgs)
await verifyContract(contractName, contract.address, constructorArgs, contractPathAndName)

return contract
}
Expand All @@ -91,7 +94,7 @@ export async function deployAllContracts(
): Promise<Record<string, Contract>> {
const isOnArb = await _isRunningOnArbitrum(signer)

const ethBridge = await deployContract('Bridge', signer, [])
const ethBridge = await deployContract('Bridge', signer, [],true, undefined ,'src/bridge/Bridge.sol:Bridge')
const reader4844 = isOnArb
? ethers.constants.AddressZero
: (await Toolkit4844.deployReader4844(signer)).address
Expand All @@ -100,6 +103,14 @@ export async function deployAllContracts(
maxDataSize,
reader4844,
false,
false
])

const ethDelayBufferableSequencerInbox = await deployContract('SequencerInbox', signer, [
maxDataSize,
reader4844,
false,
true
])

const ethInbox = await deployContract('Inbox', signer, [maxDataSize])
Expand All @@ -115,6 +126,13 @@ export async function deployAllContracts(
maxDataSize,
reader4844,
true,
false
])
const erc20DelayBufferableSequencerInbox = await deployContract('SequencerInbox', signer, [
maxDataSize,
reader4844,
true,
false
shotaronowhere marked this conversation as resolved.
Show resolved Hide resolved
])
const erc20Inbox = await deployContract('ERC20Inbox', signer, [maxDataSize])
const erc20RollupEventInbox = await deployContract(
Expand All @@ -139,6 +157,20 @@ export async function deployAllContracts(
erc20RollupEventInbox.address,
erc20Outbox.address,
],
[
ethBridge.address,
ethDelayBufferableSequencerInbox.address,
ethInbox.address,
ethRollupEventInbox.address,
ethOutbox.address,
],
[
erc20Bridge.address,
erc20DelayBufferableSequencerInbox.address,
erc20Inbox.address,
erc20RollupEventInbox.address,
erc20Outbox.address,
],
])
const prover0 = await deployContract('OneStepProver0', signer)
const proverMem = await deployContract('OneStepProverMemory', signer)
Expand Down
3 changes: 2 additions & 1 deletion scripts/rollupCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ export async function createRollup(feeToken?: string) {
console.log('Calling createRollup to generate a new rollup ...')
const deployParams = {
config: config.rollupConfig,
batchPoster: config.batchPoster,
validators: config.validators,
maxDataSize: maxDataSize,
nativeToken: feeToken,
deployFactoriesToL2: true,
maxFeePerGasForRetryables: MAX_FER_PER_GAS,
batchPosters: config.batchPosters,
batchPosterManager: config.batchPosterManager
}
const createRollupTx = await rollupCreator.createRollup(deployParams, {
value: feeCost,
Expand Down
Loading
Loading