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

xmrswap: Work on testnet. #2942

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

JoeGruffins
Copy link
Member

closes #2919

@JoeGruffins
Copy link
Member Author

I can't sync xmr testnet at the moment. Getting lots of different errors. Most common seems to be:

2024-09-24 03:32:24.638 W Failed to commit a transaction to the db: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:32:24.638 E Exception in cleanup_handle_incoming_blocks: Failed to commit a transaction to the db: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.639 W Failed to query m_blocks: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.639 E Failed to get tx meta from txpool: Error finding txpool tx meta: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 E Failed to get tx meta from txpool: Error finding txpool tx meta: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 E Failed to get tx meta from txpool: Error finding txpool tx meta: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 E Failed to get tx meta from txpool: Error finding txpool tx meta: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 W Failed to open cursor: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 E Error adding transaction to txpool: Failed to open cursor: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 W Failed to commit a transaction to the db: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
2024-09-24 03:33:02.640 E Exception in cleanup_handle_incoming_blocks: Failed to commit a transaction to the db: MDB_BAD_TXN: Transaction must abort, has a child, or is invalid

I guess I try syncing again from zero? Seems like a bug though. Currently using Monero 'Fluorine Fermi' (v0.18.3.4-release)

@dev-warrior777
Copy link
Contributor

dev-warrior777 commented Sep 24, 2024

I can't sync xmr testnet at the moment. Getting lots of different errors. Most common seems to be:

I guess I try syncing again from zero? Seems like a bug though. Currently using Monero 'Fluorine Fermi' (v0.18.3.4-release)

  • Are you using stakenet or testnet?
  • Does it work for v0.18.3.3-release?

I have just downloaded v0.18.3.4-release which works just fine on mainnet for my normal XMR wallet

I will give this code a go on stakenet with the new release later today.

@JoeGruffins
Copy link
Member Author

I'm just running with --testnet flag

@dev-warrior777
Copy link
Contributor

I'm just running with --testnet flag

use --stakenet flag ... monerod --stakenet ... and let that chain sync.

@JoeGruffins
Copy link
Member Author

Do you mean --stagenet?

@dev-warrior777
Copy link
Contributor

Do you mean --stagenet?

yes

@dev-warrior777
Copy link
Contributor

Do you mean --stagenet?

..and maybe we should rename the PR Work on stagenet.?

@buck54321
Copy link
Member

..and maybe we should rename the PR Work on stagenet.?

Every testnet has a unique name. testnet3, testnet4, goerli, ... Using the generic "testnet" is good at this level.

@dev-warrior777
Copy link
Contributor

Sure .. fair enough.

@JoeGruffins
Copy link
Member Author

I'll add more info in a README

JoeGruffins and others added 10 commits October 1, 2024 14:00
Add a c library that has some primitive cryptographic functions needed
for working with adaptor signatures.
	get transaction development details from monerod
	including tx lock time; which is different from
	'locked'/'unlocked' which refer to when a tx
	has 10 confirmations. Tx locktime can be any
	number of blocks in the future.
	- Rename monero_functions.inc -> monero_functions
	- Tidy extra whitespace at eol for harness.sh &
	  monero_functions.
	New monero-wallet-rpc server with no attached wallet. This is
 	for programmatically creating/generating and using a new wallet.

	The wallet will be generated in "own" dir but can be named what-
	ever you need: "alice", "Bob", etc.
@JoeGruffins JoeGruffins force-pushed the xmrswaptestnet branch 2 times, most recently from 93e3c56 to 255b29c Compare October 1, 2024 13:35
@dev-warrior777
Copy link
Contributor

Just tested Simnet for 3 hours (while also downloading decred testnet) .. not a single error. Will leave it on all night and will test testnet/stagenet tomorrow.

@dev-warrior777
Copy link
Contributor

I would still propose a refresh for XMR after generating/opening a wallet though.

@JoeGruffins
Copy link
Member Author

I would still propose a refresh for XMR after generating/opening a wallet though.

Whats that?

@JoeGruffins
Copy link
Member Author

For refund on stagenet, seeing these errors for refund.
xmr wallet:

2024-10-02 06:14:51.694 E HTTP_CLIENT: Failed to SEND
2024-10-02 06:14:51.694 I Failed to invoke http request to  /getblocks.bin
2024-10-02 06:14:51.694 E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2024-10-02 06:14:51.694 W /usr/src/debug/monero/monero/src/wallet/wallet2.cpp:15137:N5tools5error23no_connection_to_daemonE: no connection to daemon, request = getblocks.bin
2024-10-02 06:14:51.694 I Another try pull_blocks (try_count=0)...
2024-10-02 06:14:51.694 D Pulling blocks: start_height 0
2024-10-02 06:14:51.694 D Reconnecting...
2024-10-02 06:14:51.966 D SSL handshake success
2024-10-02 06:14:51.971 I Failed to invoke http request to  /getblocks.bin, wrong response code: 500
2024-10-02 06:14:51.971 E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2024-10-02 06:14:51.971 W /usr/src/debug/monero/monero/src/wallet/wallet2.cpp:15137:N5tools5error23no_connection_to_daemonE: no connection to daemon, request = getblocks.bin
2024-10-02 06:14:51.972 I Another try pull_blocks (try_count=1)...
2024-10-02 06:14:51.972 D Pulling blocks: start_height 0
2024-10-02 06:14:51.972 I Failed to invoke http request to  /getblocks.bin
2024-10-02 06:14:51.972 E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2024-10-02 06:14:51.972 W /usr/src/debug/monero/monero/src/wallet/wallet2.cpp:15137:N5tools5error23no_connection_to_daemonE: no connection to daemon, request = getblocks.bin
2024-10-02 06:14:51.972 I Another try pull_blocks (try_count=2)...
2024-10-02 06:14:51.972 D Pulling blocks: start_height 0
2024-10-02 06:14:51.972 E HTTP_CLIENT: Failed to SEND
2024-10-02 06:14:51.972 I Failed to invoke http request to  /getblocks.bin
2024-10-02 06:14:51.972 E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2024-10-02 06:14:51.972 W /usr/src/debug/monero/monero/src/wallet/wallet2.cpp:15137:N5tools5error23no_connection_to_daemonE: no connection to daemon, request = getblocks.bin
2024-10-02 06:14:51.973 E pull_blocks failed, try_count=3
2024-10-02 06:14:51.973 E Exception at while refreshing, what=no connection to daemon

and monerod:

2024-10-02 06:14:30.392 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:14:31.692 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:14:51.971 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:15:12.250 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:15:12.529 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:15:32.806 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type
2024-10-02 06:15:53.085 W DB error attempting to fetch transaction from hashMDB_CORRUPTED: Located page was wrong type

@JoeGruffins
Copy link
Member Author

JoeGruffins commented Oct 2, 2024

Adding a restore height seems to have fixed the issue. I guess was a sync issue.

@dev-warrior777
Copy link
Contributor

dev-warrior777 commented Oct 2, 2024

I would still propose a refresh for XMR after generating/opening a wallet though.

Whats that?

After generate/open of a wallet doing a refresh will query the monerod for any new transactions not yet in the wallet. The response will say if any new funds were added for any new txs.
Basicswap does this.

@dev-warrior777
Copy link
Contributor

Adding a restore height seems to have fixed the issue. I guess was a sync issue.

Great! .. and will also make the request much faster usually

@JoeGruffins JoeGruffins marked this pull request as ready for review October 2, 2024 08:40
Copy link
Contributor

@dev-warrior777 dev-warrior777 left a comment

Choose a reason for hiding this comment

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

Working just fine simnet, testnet for me

internal/cmd/xmrswap/main.go Show resolved Hide resolved
@JoeGruffins
Copy link
Member Author

JoeGruffins commented Oct 4, 2024

Do we need to refresh? Seems like something that would happen automatically, but maybe not for xmr? Is it like a rescan or not so deep?

@dev-warrior777
Copy link
Contributor

dev-warrior777 commented Oct 4, 2024

Do we need to refresh? Seems like something that would happen automatically, but maybe not for xmr? Is it like a rescan or not so deep?

From reading the wallet server logs it sometimes is done but not always. So when I start the xmr simnet harness and fund other wallets from bob the miner I found it necessary to refresh the wallets which can be seen from the harness script output which reports "received money" after the refresh. Other monero scripts I have read seem to do this - maybe as a precaution - basicswap tends to do this also.

It is a direct or pass-thru request from the wallet server to monerod for an update on new txs owned by the wallet.

refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xmr: Add testnet functionality.
5 participants