Skip to content
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
60 changes: 44 additions & 16 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,24 +200,44 @@ function getChainInfo(): ChainInfo {
}

function applyTxFilteringConfig(config: any) {
config.execution["address-filter"] = {
"enable": true,
"s3": {
"access-key": "minioadmin",
"secret-key": "minioadmin",
"region": "us-east-1",
"endpoint": "http://minio:9000",
"bucket": "tx-filtering",
"object-key": "address-hashes.json"
},
"poll-interval": "30s"
};
config.execution["transaction-filterer-rpc-client"] = {
"url": "http://transaction-filterer:8547"
config.execution.sequencer["transaction-filtering"] = {
"address-filter": {
"enable": true,
"s3": {
"access-key": "minioadmin",
"secret-key": "minioadmin",
"region": "us-east-1",
"endpoint": "http://minio:9000",
"bucket": "tx-filtering",
"object-key": "address-hashes.json"
},
"poll-interval": "30s"
},
"transaction-filterer-rpc-client": {
"url": "http://transaction-filterer:8547"
}
};
config["init"] = {
"transaction-filtering-enabled": true
}

function generateL2GenesisJson() {
const chainConfigPath = path.join(consts.configpath, "l2_chain_config.json");
const chainConfigStr = fs.readFileSync(chainConfigPath).toString();

const genesis = {
"serializedChainConfig": chainConfigStr,
"arbOSInit": {
"transactionFilteringEnabled": true,
"nativeTokenSupplyManagementEnabled": false
},
"gasLimit": "0x0",
"difficulty": "0x0",
"alloc": {}
};

fs.writeFileSync(
path.join(consts.configpath, "l2_genesis.json"),
JSON.stringify(genesis)
);
}

function writeConfigs(argv: any) {
Expand Down Expand Up @@ -335,6 +355,13 @@ function writeConfigs(argv: any) {
}
}

if (argv.txfiltering) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any issue with generating genesis.json for all cases?

generateL2GenesisJson();
(baseConfig as any)["init"] = {
"genesis-json-file": "/config/l2_genesis.json"
};
}

const baseConfJSON = JSON.stringify(baseConfig)

if (argv.simple) {
Expand Down Expand Up @@ -395,6 +422,7 @@ function writeConfigs(argv: any) {
}

let l3Config = JSON.parse(baseConfJSON)
delete l3Config["init"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is that needed?

l3Config["parent-chain"].connection.url = argv.l2url
// use the same account for l2 and l3 staker
// l3Config.node.staker["parent-chain-wallet"].account = namedAddress("l3owner")
Expand Down
2 changes: 1 addition & 1 deletion test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eu

NITRO_NODE_VERSION=offchainlabs/nitro-node:v3.9.2-52e8959
: ${NITRO_NODE_VERSION:=offchainlabs/nitro-node:v3.9.2-52e8959}
BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8

# nitro-contract workaround for testnode
Expand Down