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

Polygon basic support #1644

Merged
merged 9 commits into from
Oct 18, 2021
Merged

Polygon basic support #1644

merged 9 commits into from
Oct 18, 2021

Conversation

scx1332
Copy link
Collaborator

@scx1332 scx1332 commented Oct 13, 2021

No description provided.

@scx1332 scx1332 requested a review from a team October 13, 2021 09:37
@nieznanysprawiciel nieznanysprawiciel linked an issue Oct 13, 2021 that may be closed by this pull request
@prekucki prekucki requested a review from maaktweluit October 14, 2021 13:20
Copy link
Contributor

@maaktweluit maaktweluit left a comment

Choose a reason for hiding this comment

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

LGTM!

Some small comments / questions

Does this also make polygon default? then we should wait with merging till goth is updated.

format!("Goerli faucet not supported")
}
Network::Polygon => format!(
r#"Your mainnet/polygon ethereum address is {}.
Copy link
Contributor

Choose a reason for hiding this comment

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

do we still (manually) donate mainnet funds to requestors?

if so its better to copy the text from the zksync / mainnet / fund call and update it to polygon / matic:

https://github.com/golemfactory/yagna/blob/master/core/payment-driver/zksync/src/driver.rs#L301

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

.unwrap_or("0x33af15c79d64b85ba14aaffaa4577949104b22e8".to_string())
)
.unwrap(),
glm_faucet_address: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

no faucet on goerli?

we can deploy the faucet from the GNT2 repo if needed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No faucet on Goerli, more important is faucet on Mumbai.

.unwrap_or("0x2036807B0B3aaf5b1858EE822D0e111fDdac7018".to_string())
)
.unwrap(),
glm_faucet_address: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

no faucet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately there is no faucet available yet, we can add feature request to task to prepare faucet for MUMBAI

network is under-utilised right now so 30.1 should result in express transactions
USD cost as of 2021-10-08 of transaction is about 0,16 cents (USD)
*/

Copy link
Contributor

Choose a reason for hiding this comment

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

very nitty, but i would move this whitespace above the comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

let str_addr = format!("0x{:x}", &address);
let db_nonce = dao.get_next_nonce(&str_addr, network).await?;
Ok(std::cmp::max(network_nonce, db_nonce))

if network_nonce != db_nonce {
Copy link
Contributor

Choose a reason for hiding this comment

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

we had a lot of cases with slow syncing geth nodes where the db_nonce > network_nonce

Are you sure you want to use the network as default? recommend to still return the max()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll resolve this problem in the next version of payment driver.

@scx1332 scx1332 merged commit cbc72c4 into master Oct 18, 2021
@scx1332 scx1332 deleted the polygon-payments branch October 18, 2021 10:50
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.

Merge Matic payment driver from Rekuc branches
3 participants