Skip to content

Commit

Permalink
added optimism spec (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlavanet authored Feb 27, 2023
1 parent fe45197 commit e798667
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 1 deletion.
171 changes: 171 additions & 0 deletions cookbook/spec_add_optimism.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"proposal": {
"title": "Add Specs: Optimism",
"description": "Adding new specification support for relaying Optimism data on Lava, slow lookup for latest block to reduce provider load",
"specs": [
{
"index": "OPTM",
"name": "optimism mainnet",
"enabled": true,
"imports": [ "ETH1" ],
"reliability_threshold": 268435455,
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 1,
"blocks_in_finalization_proof": 1,
"average_block_time": "5000",
"allowed_block_lag_for_qos_sync": "200",
"min_stake_provider": {
"denom": "ulava",
"amount": "50000000000"
},
"min_stake_client": {
"denom": "ulava",
"amount": "5000000000"
},
"apis": [
{
"name": "eth_getBlockRange",
"block_parsing": {
"parser_arg": [
"1"
],
"parser_func": "PARSE_BY_ARG"
},
"compute_units": "20",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "rollup_getInfo",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "rollup_gasPrices",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": "10",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "eth_getAccounts",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": false,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "eth_sendTransaction",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": false,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
}
]
},
{
"index": "OPTMT",
"name": "optimism goerli testnet",
"enabled": true,
"imports": [ "OPTM" ],
"reliability_threshold": 268435455,
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 1,
"blocks_in_finalization_proof": 1,
"average_block_time": "5000",
"allowed_block_lag_for_qos_sync": "200",
"min_stake_provider": {
"denom": "ulava",
"amount": "50000000000"
},
"min_stake_client": {
"denom": "ulava",
"amount": "5000000000"
}
}
]
},
"deposit": "10000000ulava"
}
171 changes: 171 additions & 0 deletions cookbook/spec_add_optimism_fast_lookup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
"proposal": {
"title": "Add Specs: Optimism",
"description": "Adding new specification support for relaying Optimism data on Lava",
"specs": [
{
"index": "OPTM",
"name": "optimism mainnet",
"enabled": true,
"imports": [ "ETH1" ],
"reliability_threshold": 268435455,
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 1,
"blocks_in_finalization_proof": 1,
"average_block_time": "250",
"allowed_block_lag_for_qos_sync": "10",
"min_stake_provider": {
"denom": "ulava",
"amount": "50000000000"
},
"min_stake_client": {
"denom": "ulava",
"amount": "5000000000"
},
"apis": [
{
"name": "eth_getBlockRange",
"block_parsing": {
"parser_arg": [
"1"
],
"parser_func": "PARSE_BY_ARG"
},
"compute_units": "20",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "rollup_getInfo",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": false,
"local": true,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "rollup_gasPrices",
"block_parsing": {
"parser_arg": [
"latest"
],
"parser_func": "DEFAULT"
},
"compute_units": "10",
"enabled": true,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "eth_getAccounts",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": false,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
},
{
"name": "eth_sendTransaction",
"block_parsing": {
"parser_arg": [
""
],
"parser_func": "EMPTY"
},
"compute_units": "10",
"enabled": false,
"api_interfaces": [
{
"category": {
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "jsonrpc",
"type": "GET",
"extra_compute_units": "0"
}
]
}
]
},
{
"index": "OPTMT",
"name": "optimism goerli testnet",
"enabled": true,
"imports": [ "OPTM" ],
"reliability_threshold": 268435455,
"data_reliability_enabled": true,
"block_distance_for_finalized_data": 1,
"blocks_in_finalization_proof": 1,
"average_block_time": "250",
"allowed_block_lag_for_qos_sync": "10",
"min_stake_provider": {
"denom": "ulava",
"amount": "50000000000"
},
"min_stake_client": {
"denom": "ulava",
"amount": "5000000000"
}
}
]
},
"deposit": "10000000ulava"
}
7 changes: 6 additions & 1 deletion scripts/init_chain_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source $__dir/useful_commands.sh
killall screen
screen -wipe
GASPRICE="0.000000001ulava"
lavad tx gov submit-proposal spec-add ./cookbook/spec_add_ethereum.json,./cookbook/spec_add_cosmoshub.json,./cookbook/spec_add_lava.json,./cookbook/spec_add_osmosis.json,./cookbook/spec_add_fantom.json,./cookbook/spec_add_celo.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx gov submit-proposal spec-add ./cookbook/spec_add_ethereum.json,./cookbook/spec_add_cosmoshub.json,./cookbook/spec_add_lava.json,./cookbook/spec_add_osmosis.json,./cookbook/spec_add_fantom.json,./cookbook/spec_add_celo.json,./cookbook/spec_add_optimism.json -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx gov vote 1 yes -y --from alice --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE

sleep 4
Expand Down Expand Up @@ -34,6 +34,7 @@ lavad tx pairing stake-client "JUN1" $CLIENTSTAKE 1 -y --from user1 --gas-adju
lavad tx pairing stake-client "COS5" $CLIENTSTAKE 1 -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-client "POLYGON1" $CLIENTSTAKE 1 -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-client "EVMOS" $CLIENTSTAKE 1 -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-client "OPTM" $CLIENTSTAKE 1 -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-client "BASET" $CLIENTSTAKE 1 -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE


Expand Down Expand Up @@ -88,6 +89,10 @@ lavad tx pairing stake-provider "POLYGON1" $PROVIDERSTAKE "127.0.0.1:4344,jsonrp
lavad tx pairing stake-provider "POLYGON1" $PROVIDERSTAKE "127.0.0.1:4345,jsonrpc,1" 1 -y --from servicer2 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-provider "POLYGON1" $PROVIDERSTAKE "127.0.0.1:4346,jsonrpc,1" 1 -y --from servicer3 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE

# Optimism Providers
lavad tx pairing stake-provider "OPTM" $PROVIDERSTAKE "127.0.0.1:6003,jsonrpc,1" 1 -y --from servicer1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-provider "OPTM" $PROVIDERSTAKE "127.0.0.1:6004,jsonrpc,1" 1 -y --from servicer2 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-provider "OPTM" $PROVIDERSTAKE "127.0.0.1:6005,jsonrpc,1" 1 -y --from servicer3 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE4
# Base Providers
lavad tx pairing stake-provider "BASET" $PROVIDERSTAKE "127.0.0.1:6000,jsonrpc,1" 1 -y --from servicer1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
lavad tx pairing stake-provider "BASET" $PROVIDERSTAKE "127.0.0.1:6001,jsonrpc,1" 1 -y --from servicer2 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE
Expand Down
5 changes: 5 additions & 0 deletions scripts/setup_providers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ screen -d -m -S polygon_providers bash -c "source ~/.bashrc; lavad server 127.0.
screen -S polygon_providers -X screen -t win1 -X bash -c "source ~/.bashrc; lavad server 127.0.0.1 4345 $POLYGON_MAINNET_RPC POLYGON1 jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer2 2>&1 | tee $LOGS_DIR/POLYGON_4345.log"
screen -S polygon_providers -X screen -t win2 -X bash -c "source ~/.bashrc; lavad server 127.0.0.1 4346 $POLYGON_MAINNET_RPC POLYGON1 jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer3 2>&1 | tee $LOGS_DIR/POLYGON_4346.log"

# Optimism providers
screen -d -m -S optimism_providers bash -c "source ~/.bashrc; lavad server 127.0.0.1 6003 $OPTIMISM_RPC OPTM jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer1 2>&1 | tee $LOGS_DIR/OPTM_6003.log"
screen -S optimism_providers -X screen -t win1 -X bash -c "source ~/.bashrc; lavad server 127.0.0.1 6004 $OPTIMISM_RPC OPTM jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer2 2>&1 | tee $LOGS_DIR/OPTM_6004.log"
screen -S optimism_providers -X screen -t win2 -X bash -c "source ~/.bashrc; lavad server 127.0.0.1 6005 $OPTIMISM_RPC OPTM jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer3 2>&1 | tee $LOGS_DIR/OPTM_6005.log"
# Base providers
screen -d -m -S base_providers bash -c "source ~/.bashrc; lavad server 127.0.0.1 6000 $BASE_GOERLI_RPC BASET jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer1 2>&1 | tee $LOGS_DIR/BASET_6000.log"
screen -S base_providers -X screen -t win1 -X bash -c "source ~/.bashrc; lavad server 127.0.0.1 6001 $BASE_GOERLI_RPC BASET jsonrpc $EXTRA_PROVIDER_FLAGS --geolocation 1 --log_level debug --from servicer2 2>&1 | tee $LOGS_DIR/BASET_6001.log"
Expand Down Expand Up @@ -148,6 +152,7 @@ screen -S portals -X screen -t win13 -X bash -c "source ~/.bashrc; lavad rpccons
screen -S portals -X screen -t win14 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3347 STRK jsonrpc $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_3347.log"
screen -S portals -X screen -t win15 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3348 APT1 rest $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_3348.log"
screen -S portals -X screen -t win18 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3351 POLYGON1 jsonrpc $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_3351.log"
screen -S portals -X screen -t win21 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3362 OPTM jsonrpc $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_OPTM.log"
screen -S portals -X screen -t win20 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3361 BASET jsonrpc $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_BASET.log"
# Cosmos-SDK based chains
screen -S portals -X screen -t win1 -X bash -c "source ~/.bashrc; lavad rpcconsumer 127.0.0.1:3334 COS3 rest 127.0.0.1:3335 COS3 tendermintrpc 127.0.0.1:3353 COS3 grpc $EXTRA_PORTAL_FLAGS --geolocation 1 --log_level debug --from user1 2>&1 | tee $LOGS_DIR/PORTAL_COS3_3334.log"
Expand Down

0 comments on commit e798667

Please sign in to comment.