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

Removed whitelist, added timeout #548

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
4 changes: 3 additions & 1 deletion evm_loader/lib/src/commands/get_holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct GetHolderResponse {
pub accounts: Option<Vec<Pubkey>>,

pub steps_executed: u64,
pub last_slot: u64,
}

impl GetHolderResponse {
Expand Down Expand Up @@ -139,7 +140,7 @@ pub fn read_holder(program_id: &Pubkey, info: AccountInfo) -> NeonResult<GetHold
// StateAccount::from_account doesn't work here because state contains heap
// and transaction inside state account has been allocated via this heap.
// Data should be read by pointers with offsets.
let (transaction, owner, origin, accounts, steps) =
let (transaction, owner, origin, accounts, steps, last_used_slot) =
StateAccount::get_state_account_view(program_id, &info)?;

let tx_params = TxParams::from_transaction(origin, &transaction);
Expand All @@ -157,6 +158,7 @@ pub fn read_holder(program_id: &Pubkey, info: AccountInfo) -> NeonResult<GetHold
origin: Some(origin),
accounts: Some(accounts),
steps_executed: steps,
last_slot: last_used_slot,
})
}
_ => Err(ProgramError::InvalidAccountData.into()),
Expand Down
8 changes: 0 additions & 8 deletions evm_loader/program-macro/src/config_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use toml::Table;
#[derive(Deserialize)]
pub struct NetSpecificConfig {
pub program_id: String,
pub operators_whitelist: Vec<String>,
pub neon_chain_id: u64,
pub neon_token_mint: String,
pub chains: Vec<Chain>,
Expand All @@ -32,12 +31,6 @@ impl Parse for NetSpecificConfig {
let root = file_contents.parse::<Table>().unwrap();

let program_id = root["program_id"].as_str().unwrap().to_string();
let operators_whitelist = root["operators_whitelist"]
.as_array()
.unwrap()
.iter()
.map(|v| v.as_str().unwrap().to_string())
.collect::<Vec<_>>();

let no_update_tracking_owners = root["no_update_tracking_owners"]
.as_array()
Expand Down Expand Up @@ -73,7 +66,6 @@ impl Parse for NetSpecificConfig {

Ok(Self {
program_id,
operators_whitelist,
neon_chain_id,
neon_token_mint,
chains,
Expand Down
13 changes: 0 additions & 13 deletions evm_loader/program-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,10 @@ pub fn net_specific_config_parser(tokens: TokenStream) -> TokenStream {
program_id,
neon_chain_id,
neon_token_mint,
operators_whitelist,
no_update_tracking_owners,
mut chains,
} = parse_macro_input!(tokens as NetSpecificConfig);

let mut operators: Vec<Vec<u8>> = operators_whitelist
.iter()
.map(|key| bs58::decode(key).into_vec().unwrap())
.collect();

operators.sort_unstable();
let operators_len = operators.len();

let mut no_update_tracking_owners: Vec<Vec<u8>> = no_update_tracking_owners
.iter()
.map(|key| bs58::decode(key).into_vec().unwrap())
Expand Down Expand Up @@ -108,10 +99,6 @@ pub fn net_specific_config_parser(tokens: TokenStream) -> TokenStream {
neon_elf_param!(NEON_CHAIN_ID, #neon_chain_id_str);
neon_elf_param!(NEON_TOKEN_MINT, #neon_token_mint);

pub const AUTHORIZED_OPERATOR_LIST: [::solana_program::pubkey::Pubkey; #operators_len] = [
#(::solana_program::pubkey::Pubkey::new_from_array([#((#operators),)*]),)*
];

pub const NO_UPDATE_TRACKING_OWNERS: [::solana_program::pubkey::Pubkey; #no_update_tracking_owners_len] = [
#(::solana_program::pubkey::Pubkey::new_from_array([#((#no_update_tracking_owners),)*]),)*
];
Expand Down
1 change: 1 addition & 0 deletions evm_loader/program/config/common.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gas_limit_multiplier_no_chainid = 1000
storage_entries_in_contract_account = [64, "usize"]
treasury_pool_count = 128
treasury_pool_seed = "treasury_pool"
cancel_timeout = 100
34 changes: 0 additions & 34 deletions evm_loader/program/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,6 @@ program_id = "53DfF883gyixYNXnM7s5xhdeyV8mVk9T4i2hGV9vG9io"

no_update_tracking_owners = []

operators_whitelist = [
"9kPRbbwKL5SYELF4cZqWWFmP88QkKys51DoaUBx8eK73",
"BMp6gEnveANdvSvspESJUrNczuHz1GF5UQKjVLCkAZih",
"CVAimMqtcmSUCV4RLZSJAreDpEd7JEZmrvCVj85yaRzZ",
"5mszzfV23zRfcAdn9d7kmW6Qn57SGkpGywyqyVCVc817",
"AdtXr9yGAsTokY75WernsmQdcBPu2LE2Bsh8Nx3ApbbR",
"2k8NURTZ8xd1qD2JhujP2MjxkLgLHUmwpXP8FNSP7ntd",
"EkEBZJmw4uKfvruf3c6EFJeWeAY3rev3hRsp2S4BDV3M",
"9LosHtRuxtFYtj2bJfvkcZpDywtdktpAabRQ7hCQasmt",
"FHYUtkDhNaMdaKzP2y7ZXmy6HtiKz7uahz19CPUkjeiD",
"3NqgsSRfjpmDfzRH4PLKrzBvMc8MgFXgU58Yy8n41KF5",
"8HStt6KLgRY8CBNmDjwMTZhCFrXeVrEgVp3jTS4gaRYR",
"V6fr3EgLUYFSGgzPBxTnhrieeAratBX46AGvAtmQ2Xe",
"7r5GAh4SDhBwxg98vT86Q8sA8c9zEgJduSWWCV1y48V",
"GwUnjJs6i7TKGjy71PvFpGN7yu9xqA8Cs1oyV4zSVPvq",
"EdSEh9UxXjbrrHLrH5manpxfXi7HxzkAMDAotPC5DggQ",
"9s7umnvnGqT1nvrCgzvBwWFyaaYABj64LxiBpjAayLiv",
"2Ma3MxGpKmk2KPbp631bNhm2NcSMU6oxFgtj2FfzkiBF",
"2v3dnQQaBALRmaQ1Jr7GbCVagTqEBKHPZ65b4nAmdDmN",
"47dYMgKdKxRGuGBpjH58eGuj1n4FXC6v4QTcpCSaVC2c",
"5dyQQATyk4yga4f4m8BCrUF1jdfGQ1mShV4ezFLxyCqW",
"7C6iuRYzEJEwe878X2TeMDoCHPEw85ZhaxapNEBuqwL9",
"82YcsM5eN83trdhdShGUF4crAC4CGgFJ7EWd2vnGiSs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