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

ROLLUP-471/fix-deployment #109

Merged
merged 17 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 12 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
2 changes: 1 addition & 1 deletion contracts/scripts/governance-add-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ethTestConfig = JSON.parse(fs.readFileSync(`${testConfigPath}/eth.json`, {
const deployer = new Deployer({ deployWallet: ethers.Wallet.createRandom() });
const provider = web3Provider();
const governorWallet = process.env.MNEMONIC
? Wallet.fromMnemonic(process.env.MNEMONIC, "m/44'/137'/0'/0/1").connect(provider)
? Wallet.fromMnemonic(process.env.MNEMONIC, "m/44'/37310'/0'/0/0").connect(provider)
: new Wallet(Buffer.from(ethTestConfig.account_with_rbtc_cow1_privK, 'hex'), provider);

async function governanceAddToken(address: string) {
Expand Down
4 changes: 2 additions & 2 deletions core/bin/zksync_api/src/bin/dev_ticker_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
};
use structopt::StructOpt;
use tokio::sync::Mutex;
use zksync_config::ZkSyncConfig;
use zksync_config::ChainConfig;
use zksync_types::{network::Network, TokenInfo};
use zksync_utils::parse_env;

Expand All @@ -37,7 +37,7 @@ fn load_tokens(path: impl AsRef<Path>) -> Result<Vec<TokenInfo>, serde_json::Err
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let _vlog_guard = vlog::init();
let network = ZkSyncConfig::from_env().chain.eth.network;
let network = ChainConfig::from_env().eth.network;

let opts = FeeTickerOpts::from_args();
if opts.sloppy {
Expand Down
2 changes: 1 addition & 1 deletion core/bin/zksync_api/src/fee_ticker/ticker_api/coingecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl TokenPriceAPI for CoinGeckoAPI {
.query(&[
("vs_currency", "usd"),
("days", "1"),
// Removed ("interval", "hourly"), parameter as hourly charts are only available to coingecko enterprice plan customers
// Removed ("interval", "hourly"), parameter as hourly charts are only available to coingecko enterprise plan customers
// The default interval is daily
])
.send()
Expand Down
2 changes: 1 addition & 1 deletion core/bin/zksync_api/src/fee_ticker/ticker_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl FeeTickerInfo for TickerInfo {
};

// TODO: remove hardcode for tokens
if ["RDOC", "USDRIF"].contains(&token.symbol.as_str()) {
if ["RDOC", "USDRIF"].contains(&token.symbol.to_uppercase().as_str()) {
metrics::histogram!(TICKET_INFO_GET_LAST_TOKEN_PRICE, start.elapsed(), "type" => token.symbol);
return Ok(price_1_usd);
}
Expand Down
17 changes: 16 additions & 1 deletion core/bin/zksync_api/src/fee_ticker/validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::{
use bigdecimal::BigDecimal;
use chrono::Utc;

use itertools::Itertools;
// Workspace uses
use zksync_types::{
tokens::{Token, TokenLike, TokenMarketVolume},
Expand Down Expand Up @@ -73,10 +74,24 @@ impl<W: TokenWatcher> MarketUpdater<W> {
pub async fn keep_updated(mut self, duration_secs: u64) {
let mut error_counter = 0;

// Market volume is not available for these tokens and
// we don't need it because they're added among the unconditionally_valid_tokens
let unavailable_market_volume_tokens = ["RDOC", "RBTC", "USDRIF"];
loop {
let tokens = self.tokens_cache.get_all_tokens().await;
let result = match tokens {
Ok(tokens) => self.update_all_tokens(tokens).await,
Ok(tokens) => {
self.update_all_tokens(
tokens
.into_iter()
.filter(|token| {
!unavailable_market_volume_tokens
.contains(&token.symbol.to_uppercase().as_str())
})
.collect_vec(),
)
.await
}
Err(e) => Err(e),
};

Expand Down
5 changes: 4 additions & 1 deletion docker-compose-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ services:
- ./docker/rskj/node.conf:/etc/rsk/node.conf

dev-ticker:
image: "rsksmart/rollup-dev-ticker:1.0.0-beta"
image: "rsksmart/rollup-dev-ticker:1.1.1-beta"
env_file:
- ./etc/env/${ZKSYNC_ENV-dev}.env
- ./etc/env/docker.env
environment:
- ZKSYNC_HOME=/
volumes:
- ./etc/tokens/:/etc/tokens

Expand Down
7 changes: 5 additions & 2 deletions docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.2'
services:

server:
image: "rsksmart/rollup-server:1.0.1-beta"
image: "rsksmart/rollup-server:1.1.1-beta"
ports: #Ports that where configured using the environment variables
- 3001:3001 # RestApi
- 3002:3002 # Web3
Expand Down Expand Up @@ -51,9 +51,12 @@ services:
- ./etc/env/${ENV_OVERRIDE-deploy}.env

dev-ticker:
image: "rsksmart/rollup-dev-ticker:1.0.0-beta"
image: "rsksmart/rollup-dev-ticker:1.1.1-beta"
env_file:
- ./etc/env/${ZKSYNC_ENV-dev}.env
- ./etc/env/${ENV_OVERRIDE-deploy}.env
environment:
- ZKSYNC_HOME=/
ports:
- "9876:9876"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
start_period: 15s

dev-ticker:

Choose a reason for hiding this comment

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

I guess that locally we dont need the ZKSYNC_HOME, since the component in the dev-ticker that use it, is not necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you're right we don't need it, but I preferred to include it to avoid confusion about it in the different envs.
If we want to remove it from here, we could just add a comment in the other docker-compose.*.yml files

image: "rsksmart/rollup-dev-ticker:1.1.0-beta"
image: "rsksmart/rollup-dev-ticker:1.1.1-beta"
env_file:
- ./etc/env/${ZKSYNC_ENV-dev}.env
- ./etc/env/${ENV_OVERRIDE-deploy}.env
Expand Down
3 changes: 1 addition & 2 deletions docker/dev-ticker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo build --bin dev_ticker_server --release

FROM debian:bullseye
RUN apt update
RUN apt install openssl -y
RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/*
EXPOSE 9876
ENV RUST_BACKTRACE "full"
ENV RUST_LOG info
Expand Down
Loading