-
Notifications
You must be signed in to change notification settings - Fork 7
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
401 fix issues of connecting to stellar overlay network on testnet #414
401 fix issues of connecting to stellar overlay network on testnet #414
Conversation
@@ -37,6 +37,7 @@ pub(crate) fn from_authenticated_message(message: &AuthenticatedMessage) -> Resu | |||
message_to_bytes(message) | |||
} | |||
|
|||
// todo: move to substrate-stellar-sdk |
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.
Just the macro?
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.
I'm fine if we address this in a later PR.
We should keep in mind though that there are quite some changes here that still need to be refined (eg. out-commented code)
} | ||
|
||
impl AddTxSet<TransactionSetType> for ScpMessageCollector { | ||
fn add_txset(&self, tx_set: TransactionSetType) -> Result<(), String> { |
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.
Should we rename this function to add_txset_type
instead? I was a little confused reading the functions having all of them share the name.
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.
done
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.
Overall really great changes @b-yap 👍. Thanks for cleaning up the dependencies in the pallets, and also nice how you implemented the traits on the TransactionSetType
such that we need to add as little changes as possible.
pallets/stellar-relay/src/tests.rs
Outdated
let TransactionSetType::TransactionSet(mut set) = tx_set else { | ||
panic!("must be of type `TransactionSet`") | ||
}; |
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.
Do we need to make this assumption here? If for some reason we change the tx_set
returned by create_valid_dummy_scp_envelopes
to return a GeneralizedTransactionSet
in the future, this would break. Can we support both cases maybe?
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.
done
everything is green! :D :D :D |
i'm going to merge this already @ebma |
* partial of 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring; partial of STL-03 | Lack of Validation for `destination_address` on `send_payment_to_address()` * 257 FIx Informational Issues - Logic Should be Moved To an Separate Function - Refactoring (#388) * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - partial * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - for System's fn run_service() * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - fix from previous commit * remove stray log * remove extra space * https://github.com/pendulum-chain/spacewalk/pull/388/files#r1312732850, #388 (comment) * 257 Fix informational issues part 3 (#390) * IML-01 | Same Behavior Defined For Different Conditions * LI7-05 | Mismatch in Variable Name and Pallet Name * 9B2-02 | Inconsistent Comments * PRF-01 | Unhandled Error * LIH-03 | Values Length Not Validated in `feed_values` Function * CLI-01 | Confusing Function Naming * CLI-03 | Incorrect Error Type Thrown partial * CLI-03 | Incorrect Error Type Thrown * #390 (comment), #390 (comment), #390 (comment), #390 (comment), #390 (comment), https://github.com/pendulum-chain/spacewalk/actions/runs/6048709746/job/16414585252?pr=390#step:12:38 * https://github.com/pendulum-chain/spacewalk/actions/runs/6069946336/job/16465120232?pr=390#step:11:1573 * fix rustfmt error: https://github.com/pendulum-chain/spacewalk/actions/runs/6072497871/job/16472578544?pr=390 * CLI-01 | Confusing Function Naming * #390 (comment), #390 (comment), #390 (comment), #390 (comment), #390 (comment), https://github.com/pendulum-chain/spacewalk/actions/runs/6048709746/job/16414585252?pr=390#step:12:38 * STL-02 | Code Duplication * SRC-01 | Unused Methods and Storage * 9B2-05 | Commented Out Code (partial) * LBC-03 | Inconsistent `match` Expression * LIY-03 | Reduce Using `unwrap()` and `expect()` in Production Codebase * TYL-01 | Confusing Variable Naming * put back the removed dependencies * https://github.com/pendulum-chain/spacewalk/actions/runs/6095148657/job/16538119439?pr=393#step:11:91 * https://github.com/pendulum-chain/spacewalk/actions/runs/6096401270/job/16541879632#step:11:93 * https://github.com/pendulum-chain/spacewalk/actions/runs/6096401270/job/16541879632#step:11:93 * https://github.com/pendulum-chain/spacewalk/actions/runs/6097368982/job/16544863469?pr=393#step:11:94 * https://github.com/pendulum-chain/spacewalk/actions/runs/6098205449/job/16547533143?pr=393#step:13:19 * #393 (comment), partly #393 (review) * #393 (comment) * #393 (comment), #393 (review) for vault * #393 (comment) * fix https://github.com/pendulum-chain/spacewalk/actions/runs/6263576242/job/17008273208?pr=393#step:12:894 * https://github.com/pendulum-chain/spacewalk/actions/runs/6272775696/job/17034964214?pr=393#step:12:434 * https://github.com/pendulum-chain/spacewalk/actions/runs/6275148901/job/17041998689?pr=393#step:12:587 * https://github.com/pendulum-chain/spacewalk/actions/runs/6276542346/job/17091576766#step:12:476 * #393 (comment) * #393 (comment) and fix rebase * 401 fix issues of connecting to stellar overlay network on testnet (#414) * a 3rd try of #409 * cargo fmt and fix warnings in https://github.com/pendulum-chain/spacewalk/actions/runs/6459806136/job/17536291785?pr=414 * update the `substrate-stellar-sdk` version * #414 (comment), #414 (comment), #414 (comment), #414 (comment) * LIL-01 Dead Code in execute_replace() LIT-03 Panic can happen between correlated storage modifications * LIL-01 Dead Code in execute_replace() add back the comment
* SYT-03 | Unnecessary Variable * STL-03 | Lack of Validation for `destination_address` on `send_payment_to_address()` * SRL-01 | Usage of Hard-coded Strings * PAL-03 | Usage of Magic Numbers * PAL-02 | Unnecessary `Result<...>` Return Type * CLI-02 | Typos * 9B2-03 | Unused Errors * code cleanup for PAL-03 | Usage of Magic Numbers * code cleanup for PAL-02 | Unnecessary Result<...> Return Type * partial of 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring; partial of STL-03 | Lack of Validation for `destination_address` on `send_payment_to_address()` * code cleanup * #385 (comment), #385 (comment), #385 (comment), #385 (comment), #385 (comment), #385 (comment), #385 (comment), #385 (comment) https://github.com/pendulum-chain/spacewalk/actions/runs/5936258794/job/16098086016?pr=385#step:10:33 * #385 (comment) * Use vault vs user wallet in integration tests * fix Unable to get required collateral for amount issue * #385 (comment) * removing the "last_known_cursor" and let the CI run it * https://github.com/pendulum-chain/spacewalk/actions/runs/5972713032/job/16203688884#step:9:144 * Fix `test_replace_succeeds` test case * fix test case due to changed `HorizonSubmissionError` * 257 FIx Informational Issues - Logic Should be Moved To an Separate Function - Refactoring (#388) * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - partial * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - for System's fn run_service() * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - fix from previous commit * remove stray log * remove extra space * https://github.com/pendulum-chain/spacewalk/pull/388/files#r1312732850, #388 (comment) * 257 Fix informational issues part 3 (#390) * IML-01 | Same Behavior Defined For Different Conditions * LI7-05 | Mismatch in Variable Name and Pallet Name * 9B2-02 | Inconsistent Comments * PRF-01 | Unhandled Error * LIH-03 | Values Length Not Validated in `feed_values` Function * CLI-01 | Confusing Function Naming * CLI-03 | Incorrect Error Type Thrown partial * CLI-03 | Incorrect Error Type Thrown * #390 (comment), #390 (comment), #390 (comment), #390 (comment), #390 (comment), https://github.com/pendulum-chain/spacewalk/actions/runs/6048709746/job/16414585252?pr=390#step:12:38 * https://github.com/pendulum-chain/spacewalk/actions/runs/6069946336/job/16465120232?pr=390#step:11:1573 * fix rustfmt error: https://github.com/pendulum-chain/spacewalk/actions/runs/6072497871/job/16472578544?pr=390 * from https://github.com/pendulum-chain/spacewalk/pull/392/files#diff-0f76594421d4493b3bba1c9ed7864cdab7148f19c5d3a18a9bcc9a174bb85aa8 * from https://github.com/pendulum-chain/spacewalk/pull/392/files#diff-0f76594421d4493b3bba1c9ed7864cdab7148f19c5d3a18a9bcc9a174bb85aa8 * 257 fix informational issues part 4 (#393) * partial of 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring; partial of STL-03 | Lack of Validation for `destination_address` on `send_payment_to_address()` * 257 FIx Informational Issues - Logic Should be Moved To an Separate Function - Refactoring (#388) * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - partial * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - for System's fn run_service() * 9B2-04 | Logic Should be Moved To an Separate Function - Refactoring - fix from previous commit * remove stray log * remove extra space * https://github.com/pendulum-chain/spacewalk/pull/388/files#r1312732850, #388 (comment) * 257 Fix informational issues part 3 (#390) * IML-01 | Same Behavior Defined For Different Conditions * LI7-05 | Mismatch in Variable Name and Pallet Name * 9B2-02 | Inconsistent Comments * PRF-01 | Unhandled Error * LIH-03 | Values Length Not Validated in `feed_values` Function * CLI-01 | Confusing Function Naming * CLI-03 | Incorrect Error Type Thrown partial * CLI-03 | Incorrect Error Type Thrown * #390 (comment), #390 (comment), #390 (comment), #390 (comment), #390 (comment), https://github.com/pendulum-chain/spacewalk/actions/runs/6048709746/job/16414585252?pr=390#step:12:38 * https://github.com/pendulum-chain/spacewalk/actions/runs/6069946336/job/16465120232?pr=390#step:11:1573 * fix rustfmt error: https://github.com/pendulum-chain/spacewalk/actions/runs/6072497871/job/16472578544?pr=390 * CLI-01 | Confusing Function Naming * #390 (comment), #390 (comment), #390 (comment), #390 (comment), #390 (comment), https://github.com/pendulum-chain/spacewalk/actions/runs/6048709746/job/16414585252?pr=390#step:12:38 * STL-02 | Code Duplication * SRC-01 | Unused Methods and Storage * 9B2-05 | Commented Out Code (partial) * LBC-03 | Inconsistent `match` Expression * LIY-03 | Reduce Using `unwrap()` and `expect()` in Production Codebase * TYL-01 | Confusing Variable Naming * put back the removed dependencies * https://github.com/pendulum-chain/spacewalk/actions/runs/6095148657/job/16538119439?pr=393#step:11:91 * https://github.com/pendulum-chain/spacewalk/actions/runs/6096401270/job/16541879632#step:11:93 * https://github.com/pendulum-chain/spacewalk/actions/runs/6096401270/job/16541879632#step:11:93 * https://github.com/pendulum-chain/spacewalk/actions/runs/6097368982/job/16544863469?pr=393#step:11:94 * https://github.com/pendulum-chain/spacewalk/actions/runs/6098205449/job/16547533143?pr=393#step:13:19 * #393 (comment), partly #393 (review) * #393 (comment) * #393 (comment), #393 (review) for vault * #393 (comment) * fix https://github.com/pendulum-chain/spacewalk/actions/runs/6263576242/job/17008273208?pr=393#step:12:894 * https://github.com/pendulum-chain/spacewalk/actions/runs/6272775696/job/17034964214?pr=393#step:12:434 * https://github.com/pendulum-chain/spacewalk/actions/runs/6275148901/job/17041998689?pr=393#step:12:587 * https://github.com/pendulum-chain/spacewalk/actions/runs/6276542346/job/17091576766#step:12:476 * #393 (comment) * #393 (comment) and fix rebase * 401 fix issues of connecting to stellar overlay network on testnet (#414) * a 3rd try of #409 * cargo fmt and fix warnings in https://github.com/pendulum-chain/spacewalk/actions/runs/6459806136/job/17536291785?pr=414 * update the `substrate-stellar-sdk` version * #414 (comment), #414 (comment), #414 (comment), #414 (comment) * LIL-01 Dead Code in execute_replace() LIT-03 Panic can happen between correlated storage modifications * LIL-01 Dead Code in execute_replace() add back the comment * https://github.com/pendulum-chain/spacewalk/actions/runs/6482197215/job/17610217546?pr=385#step:12:560 * https://github.com/pendulum-chain/spacewalk/actions/runs/6491793772/job/17629635299?pr=385#step:11:58 * fix clippy issues * cargo fmt --all --------- Co-authored-by: Marcel Ebert <[email protected]>
closes #401;
Coming from #409
General overview of the changes:
This is to support both
StellarMessage::TxSet
andStellarMessage::GeneralizedTxSet
after sending aStellarMessage::GetTxSet
.spacewalk-primitives
lib, I removed thesubstrate-stellar-sdk
dependency.offchain
andall-types
ofsubstrate-stellar-sdk
are used.TransactionSetType
.GeneralizedTxSet
methods for retrieving a TransactionSet for pendulum-chain/spacewalk#401 substrate-stellar-sdk#21 for reference.type.rs
inside vault/oracle to multiple files contained in the newtype
dir.TxSetMap
change its value type fromTransactionSet
toTransactionSetType
TxSetMap
. They have been commented out, marked astodo
GeneralizedTransactionSet
message and to useTransactionSetType
when creating proofs.stellar-relay-lib
How to begin the review:
pallet
dirspacewalk-primitives
as a dependency.substrate-stellar-sdk
substrate_stellar_sdk
toprimitives::stellar
fn validate_stellar_transaction(...)
MUST REPLACETransactionSet
datatype param toTransactionSetType
construct_from_raw_encoded_xdr()
MUST REPLACETransactionSet
datatype generic toTransactionSetType
vault/oracle
dirtypes
dirlimited_fifo_map.rs
-TxSetMap
MUST REPLACETransactionSet
toTransactionSetType
storage/impls.rs
- comment out allTxSetMap
orTxSetFIleHandler
testscollector
dirproof_builder.rs
-Proof
struct MUST REPLACETransactionSet
toTransactionSetType
collector.rs
fn add_txset()
to support 2 types:TransactionSet
,GeneralizedTransactionSet
TxSetMap
tests (todo
)agent.rs
- should handle bothStellarMessage::TxSet
andStellarMessage::GeneralizedTxSet
messagesstellar-relay-lib
service.rs
- functions called inside atokio::spawn()
ofoverlay_connection.rs
should log the errors instead of propagating them:fn receiving_service(...)
fn connection_handler(...)
stellar_overlay_should_receive_tx_set
test case to use the testnet rather than mainnet (overlay_infos(false);
)StellarMessage::GetTxSet
andStellarMessage::GeneralizedTxSet
are THE SAME