-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rename payouts failure file #81
Changes from 1 commit
ff83184
6fcd4af
a290d03
10f4a94
055a66d
239ee6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ use std::sync::Arc; | |
use tabled::{settings::object::Object, Table, Tabled}; | ||
use url::Url; | ||
|
||
const FAILURE_FILE: &str = "./SuccessfulPayouts{}"; | ||
const ADMIN_ROLE: [u8; 32] = [0; 32]; | ||
|
||
const LOTUS_RPC_URL: &str = "http://127.0.0.1:1234/rpc/v1"; | ||
|
@@ -450,7 +451,7 @@ pub async fn propose_payout_batch( | |
Ok(message) => message, | ||
Err(error) => { | ||
let date = chrono::offset::Utc::now().to_string(); | ||
let file_path = PathBuf::from(&format!("./FailedPayouts{}", date)); | ||
let file_path = PathBuf::from(&format!("{}{}", FAILURE_FILE, date)); | ||
write_payout_csv(&file_path, &payees, &shares).unwrap(); | ||
panic!( | ||
"Error signing multisig propose message for batch payout at index range {:?} .. {:?}: {:?}", | ||
|
@@ -466,7 +467,7 @@ pub async fn propose_payout_batch( | |
Ok(mpool_push) => mpool_push, | ||
Err(error) => { | ||
let date = chrono::offset::Utc::now().to_string(); | ||
let file_path = PathBuf::from(&format!("./FailedPayouts{}", date)); | ||
let file_path = PathBuf::from(&format!("{}{}", FAILURE_FILE, date)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similarly, if this failed I think the transaction never actually made it to the network - this is a nuanced failure, as the signature succeeded so theoretically there is a valid transaction somewhere - I'm unclear whether this could be a partial failure to push into the mempool (maybe one validator got the transaction and another didn't or something?) - probably worth calling this something specific too - |
||
write_payout_csv(&file_path, &payees, &shares).unwrap(); | ||
panic!( | ||
"MpoolPush error for proposing batch payout at index range {:?} .. {:?}: {:?}", | ||
|
@@ -1107,7 +1108,7 @@ pub async fn deploy_payout_batch<S: Middleware + 'static>( | |
Ok(gas) => gas, | ||
Err(error) => { | ||
let date = chrono::offset::Utc::now().to_string(); | ||
let file_path = PathBuf::from(&format!("./FailedPayouts{}", date)); | ||
let file_path = PathBuf::from(&format!("{}{}", FAILURE_FILE, date)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also seems like a real failure - if gas couldn't be estimated I think we would not send the transaction? probably a good idea for this to have a bespoke name too - maybe |
||
write_payout_csv(&file_path, &payees, &shares).unwrap(); | ||
panic!( | ||
"Error estimating gas for batch payout at index range {:?} .. {:?}: {:?}", | ||
|
@@ -1128,7 +1129,7 @@ pub async fn deploy_payout_batch<S: Middleware + 'static>( | |
Ok(receipt) => receipt, | ||
Err(error) => { | ||
let date = chrono::offset::Utc::now().to_string(); | ||
let file_path = PathBuf::from(&format!("./FailedPayouts{}", date)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok if I had to guess this is the one we actually saw - the transaction was send but the receipt is an error for some reason? in this case it seems possible that the transaction did in fact get sent, but we ran into an error getting the receipt - seems like it might be possible that the transactions succeeded OR failed, so maybe yet another name - |
||
let file_path = PathBuf::from(&format!("{}{}", FAILURE_FILE, date)); | ||
write_payout_csv(&file_path, &payees, &shares).unwrap(); | ||
panic!( | ||
"Error deploying batch payout at index range {:?} .. {:?}: {:?}", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this actually should be called something like "FailedPayouts" - the error happened trying to get a signature, so I think these payouts really wouldn't have gone forward.
I do think "FailedPayouts" implies that it contains all payouts that weren't done, which is also wrong! maybe this file should be called something like "SignatureFailedPayouts"?