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

chore: change one confusing log #20

Open
wants to merge 2 commits into
base: altlayer
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/build-orbit-setup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build orbit-setup Docker Image
on:
push:
tags: ["*"]
tags: ['*']

jobs:
docker:
Expand Down Expand Up @@ -45,4 +45,4 @@ jobs:
push: true
tags: ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ github.sha }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.SHORT_SHA }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.REF_NAME }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.REF_NAME }}-${{ env.SHORT_SHA }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:latest
file: ${{ matrix.dockerfile }}
provenance: false
provenance: false
4 changes: 2 additions & 2 deletions docker-compose/services/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file:
- ../envs/common-blockscout.env
- ../envs/common-blockscout.env
volumes:
- ./logs/:/app/logs/
- ./logs/:/app/logs/
8 changes: 4 additions & 4 deletions docker-compose/services/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ services:
container_name: 'db'
command: postgres -c 'max_connections=200' -c 'client_connection_check_interval=60000'
environment:
POSTGRES_DB: 'blockscout'
POSTGRES_USER: 'blockscout'
POSTGRES_PASSWORD: 'ceWb1MeLBEeOIfk65gU8EjF8'
POSTGRES_DB: 'blockscout'
POSTGRES_USER: 'blockscout'
POSTGRES_PASSWORD: 'ceWb1MeLBEeOIfk65gU8EjF8'
ports:
- target: 5432
published: 7432
volumes:
- ./blockscout-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U blockscout -d blockscout"]
test: ['CMD-SHELL', 'pg_isready -U blockscout -d blockscout']
interval: 10s
timeout: 5s
retries: 5
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/services/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ services:
restart: always
container_name: 'frontend'
env_file:
- ../envs/common-frontend.env
- ../envs/common-frontend.env
2 changes: 1 addition & 1 deletion docker-compose/services/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- "../proxy:/etc/nginx/templates"
- '../proxy:/etc/nginx/templates'
environment:
BACK_PROXY_PASS: ${BACK_PROXY_PASS:-http://backend:4000}
FRONT_PROXY_PASS: ${FRONT_PROXY_PASS:-http://frontend:3000}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/services/smart-contract-verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ services:
restart: always
container_name: 'smart-contract-verifier'
env_file:
- ../envs/common-smart-contract-verifier.env
- ../envs/common-smart-contract-verifier.env
10 changes: 5 additions & 5 deletions docker-compose/services/stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ services:
container_name: 'stats-postgres'
command: postgres -c 'max_connections=200'
environment:
POSTGRES_DB: 'stats'
POSTGRES_USER: 'stats'
POSTGRES_PASSWORD: 'n0uejXPl61ci6ldCuE2gQU5Y'
POSTGRES_DB: 'stats'
POSTGRES_USER: 'stats'
POSTGRES_PASSWORD: 'n0uejXPl61ci6ldCuE2gQU5Y'
ports:
- target: 5432
published: 7433
volumes:
- ./stats-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U stats -d stats"]
test: ['CMD-SHELL', 'pg_isready -U stats -d stats']
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -42,7 +42,7 @@ services:
extra_hosts:
- 'host.docker.internal:host-gateway'
env_file:
- ../envs/common-stats.env
- ../envs/common-stats.env
environment:
- STATS__DB_URL=postgres://stats:n0uejXPl61ci6ldCuE2gQU5Y@stats-db:5432/stats
- STATS__BLOCKSCOUT_DB_URL=${STATS__BLOCKSCOUT_DB_URL-postgresql://blockscout:ceWb1MeLBEeOIfk65gU8EjF8@db:5432/blockscout}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose/services/visualizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ services:
restart: always
container_name: 'visualizer'
env_file:
- ../envs/common-visualizer.env
- ../envs/common-visualizer.env
7 changes: 6 additions & 1 deletion scripts-altlayer/getExecutorAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ const L2Provider = new ethers.providers.JsonRpcProvider(L2_RPC_URL)
const L3Provider = new ethers.providers.JsonRpcProvider(L3_RPC_URL)

async function main() {
return await getExecutorAddress(TOKEN_BRIDGE_CREATOR, INBOX, L2Provider, L3Provider)
return await getExecutorAddress(
TOKEN_BRIDGE_CREATOR,
INBOX,
L2Provider,
L3Provider
)
}

// Run the script
Expand Down
5 changes: 3 additions & 2 deletions scripts-altlayer/setL1PricingRewardRecipient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export async function main() {
throw new Error('Required environment variable not found')
}

const JUST_GENERATE_TARGET_CALLDATA = process.env.JUST_GENERATE_TARGET_CALLDATA
const JUST_GENERATE_TARGET_CALLDATA =
process.env.JUST_GENERATE_TARGET_CALLDATA

// To determine UpgradeExecutor proxy, provide either TOKEN_BRIDGE_CREATOR and INBOX, or just UPGRADE_EXECUTOR_PROXY
const TOKEN_BRIDGE_CREATOR = process.env.TOKEN_BRIDGE_CREATOR || ''
Expand Down Expand Up @@ -57,7 +58,7 @@ export async function main() {
]
const iface = new ethers.utils.Interface(ABI)
const data = iface.encodeFunctionData('setL1PricingRewardRecipient', [
RECIPIENT
RECIPIENT,
])

// Constructing call data for setting L1 pricing reward rate on L3
Expand Down
31 changes: 31 additions & 0 deletions scripts-altlayer/transfer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { ethers } from 'ethers'

const privateKey = process.env.PRIVATE_KEY || ''
const to = process.env.TO || ''
const amount = process.env.AMOUNT || ''
const rpc = process.env.PRC || ''

const provider = new ethers.providers.JsonRpcProvider(rpc)
const signer = new ethers.Wallet(privateKey).connect(provider)

async function main() {
const start = new Date()
const tx = await signer.sendTransaction({
to: to,
value: ethers.utils.parseEther(amount),
})
console.log(`Transaction hash on target chain: ${tx.hash}`)
const receipt = await tx.wait()
console.log(
`Transaction was mined in block ${receipt.blockNumber} on parent chain`
)
const end = new Date()
const span = end.getTime() - start.getTime()
console.log('Time span: ', span)
}

// Run the script
main().catch(error => {
console.error(error)
process.exit(1)
})
10 changes: 8 additions & 2 deletions scripts/createTokenBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ function createPublicClientFromChainInfo({
testnet: true,
})

return createPublicClient({ chain, transport: http(rpcUrl, {timeout: 120_000}) })
return createPublicClient({
chain,
transport: http(rpcUrl, { timeout: 120_000 }),
})
}

export const TOKEN_BRIDGE_CREATOR_Arb_Sepolia =
Expand Down Expand Up @@ -406,7 +409,10 @@ export const createERC20Bridge = async (
},
},
}
fs.writeFileSync('./output/outputInfo.json', JSON.stringify(outputInfo, null, 2))
fs.writeFileSync(
'./output/outputInfo.json',
JSON.stringify(outputInfo, null, 2)
)

console.log('Done!')
}
17 changes: 10 additions & 7 deletions scripts/l3Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export async function l3Configuration(
console.log(
'Setting the L1PricingRewardRecipient address for the Orbit chain'
)
const tx4 = await ArbOwner.setL1PricingRewardRecipient(l1PricingRewardRecipient)
const tx4 = await ArbOwner.setL1PricingRewardRecipient(
l1PricingRewardRecipient
)

// Wait for the transaction to be mined
const receipt4 = await tx4.wait()
Expand All @@ -126,7 +128,7 @@ export async function l3Configuration(

// Setting L1 basefee on L3
const l2ChainId = (await L2Provider.getNetwork()).chainId
if ((l2ChainId === 421614) || (l2ChainId === 42161)) {
if (l2ChainId === 421614 || l2ChainId === 42161) {
console.log(`This is an L3 Orbit`)

const arbGasInfoAbi = ArbGasInfo__abi
Expand All @@ -136,30 +138,31 @@ export async function l3Configuration(
arbGasInfoAbi,
l2signer
)

if (setL1Price) {
console.log('Getting L1 base fee estimate')
const l1BaseFeeEstimate = await ArbOGasInfo.getL1BaseFeeEstimate()
console.log(`L1 Base Fee estimate on L2 is ${l1BaseFeeEstimate.toNumber()}`)
console.log(
`L1 Base Fee estimate on L2 is ${l1BaseFeeEstimate.toNumber()}`
)
const l2Basefee = await L2Provider.getGasPrice()
const totalGasPrice = await l1BaseFeeEstimate.add(l2Basefee)
console.log(`Setting L1 base fee estimate on L3 to ${totalGasPrice}`)
const tx5 = await ArbOwner.setL1PricePerUnit(totalGasPrice)

// Wait for the transaction to be mined
const receipt5 = await tx5.wait()
console.log(
`L1 base fee estimate is set on the block number ${await receipt5.blockNumber} on the Orbit chain`
)

// Check the status of the transaction: 1 is successful, 0 is failure
if (receipt5.status === 0) {
throw new Error('Base Fee Setting failed')
}
} else {
console.log(`Skipping setL1PricePerUnit`)
}

} else {
console.log(`This is an L2 Orbit`)
if (setL1Price) {
Expand Down
14 changes: 11 additions & 3 deletions scripts/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function main() {
const INITIAL_FUND_AMOUNT_BATCH_POSTER =
process.env.INITIAL_FUND_AMOUNT_BATCH_POSTER
const INITIAL_FUND_AMOUNT_STAKER = process.env.INITIAL_FUND_AMOUNT_STAKER
const setL1Price = process.env.SKIP_SET_L1_PRICE != "true"
const setL1Price = process.env.SKIP_SET_L1_PRICE != 'true'

if (
!privateKey ||
Expand Down Expand Up @@ -139,15 +139,23 @@ async function main() {
'Running Orbit Chain Native token deposit to Deposit ETH or native ERC20 token from parent chain to your account on Orbit chain ... 💰💰💰💰💰💰'
)
const oldBalance = await L3Provider.getBalance(config.chainOwner)
await ethOrERC20Deposit(privateKey, L2_RPC_URL, INITIAL_FUND_AMOUNT_CREATOR)
await ethOrERC20Deposit(
privateKey,
L2_RPC_URL,
INITIAL_FUND_AMOUNT_CREATOR
)
let depositCheckTime = 0

// Waiting for 30 secs to be sure that ETH/Native token deposited is received on L3
// Repeatedly check the balance until it changes by INITIAL_FUND_AMOUNT_CREATOR native tokens
while (true) {
depositCheckTime++
const newBalance = await L3Provider.getBalance(config.chainOwner)
if (newBalance.sub(oldBalance).gte(ethers.utils.parseEther(INITIAL_FUND_AMOUNT_CREATOR))) {
if (
newBalance
.sub(oldBalance)
.gte(ethers.utils.parseEther(INITIAL_FUND_AMOUNT_CREATOR))
) {
console.log(
'Balance of your account on Orbit chain increased by the native token you have just sent.'
)
Expand Down
7 changes: 6 additions & 1 deletion scripts/transferOwnership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import UpgradeExecutor from '@arbitrum/nitro-contracts/build/contracts/src/mocks
import ArbOwner from '@arbitrum/nitro-contracts/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.json'
import fs from 'fs'
import { L3Config } from './l3ConfigType'
import { TOKEN_BRIDGE_CREATOR_Arb_Sepolia, TOKEN_BRIDGE_CREATOR_Sepolia, TOKEN_BRIDGE_CREATOR_Arb_One, TOKEN_BRIDGE_CREATOR_Holesky } from './createTokenBridge'
import {
TOKEN_BRIDGE_CREATOR_Arb_Sepolia,
TOKEN_BRIDGE_CREATOR_Sepolia,
TOKEN_BRIDGE_CREATOR_Arb_One,
TOKEN_BRIDGE_CREATOR_Holesky,
} from './createTokenBridge'
import L1AtomicTokenBridgeCreator from '@arbitrum/token-bridge-contracts/build/contracts/contracts/tokenbridge/ethereum/L1AtomicTokenBridgeCreator.sol/L1AtomicTokenBridgeCreator.json'

export const getSigner = (provider: JsonRpcProvider, key?: string) => {
Expand Down