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

https://bsc-dataseed.binance.org - Request timeout error only in ios 17 devices. #7020

Open
Broem43 opened this issue Oct 7, 2023 · 7 comments

Comments

@Broem43
Copy link

Broem43 commented Oct 7, 2023

          https://bsc-dataseed.binance.org  - Request timeout error only in ios 17 devices.

convertToUserFriendlyError URL: https://bsc-dataseed.binance.org error: connectionError(Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x10951cad0 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <9A26F30F-242E-4051-BB66-A63EA51E6236>.<565>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <9A26F30F-242E-4051-BB66-A63EA51E6236>.<565>"
), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://bsc-dataseed.binance.org/, NSErrorFailingURLKey=https://bsc-dataseed.binance.org/, _kCFStreamErrorDomainKey=4})

Originally posted by @akhilccrb in #7008 (comment)

@akhilccrb
Copy link

did you fix this @Broem43 ??

@hboon
Copy link
Member

hboon commented Oct 17, 2023

@akhilccrb Hi! Is there a simple way I can reproduce this reliably?

@akhilccrb
Copy link

public func signTransaction(_ transaction: UnsignedTransaction, prompt: String) -> Result<Data, KeystoreError> {
    let signer: Signer
    if transaction.server.chainID == 0 {
        signer = HomesteadSigner()
    } else {
        signer = EIP155Signer(server: transaction.server)
    }

    do {
        let hash = try signer.hash(transaction: transaction)
        switch getPrivateKeyForSigning(forAccount: transaction.account, prompt: prompt) {
        case .seed, .seedPhrase:
            return .failure(.failedToExportPrivateKey)
        case .key(let key):
            let signature = try EthereumSigner().sign(hash: hash, withPrivateKey: key)
            let (r, s, v) = signer.values(transaction: transaction, signature: signature)
            let values: [Any] = [
                transaction.nonce,
                transaction.gasPrice,
                transaction.gasLimit,
                transaction.to?.data ?? Data(),
                transaction.value,
                transaction.data,
                v, r, s,
            ]
            //NOTE: avoid app crash, returns with return error, Happens when amount to send less then 0
            guard let data = RLP.encode(values) else {
                return .failure(.failedToSignTransaction)
            }
            return .success(data)
        case .userCancelled:
            return .failure(.userCancelled)
        case .notFound, .otherFailure:
            return .failure(.accountMayNeedImportingAgainOrEnablePasscode)
        }
    } catch {
        return .failure(.failedToSignTransaction)
    }
}

@akhilccrb
Copy link

This is signing error so how to change signer class ? @hboon

@YangJian2014
Copy link

@hboon @akhilccrb Encounter same issue, need help!

@YangJian2014
Copy link

public func signTransaction(_ transaction: UnsignedTransaction, prompt: String) -> Result<Data, KeystoreError> {
    let signer: Signer
    if transaction.server.chainID == 0 {
        signer = HomesteadSigner()
    } else {
        signer = EIP155Signer(server: transaction.server)
    }

    do {
        let hash = try signer.hash(transaction: transaction)
        switch getPrivateKeyForSigning(forAccount: transaction.account, prompt: prompt) {
        case .seed, .seedPhrase:
            return .failure(.failedToExportPrivateKey)
        case .key(let key):
            let signature = try EthereumSigner().sign(hash: hash, withPrivateKey: key)
            let (r, s, v) = signer.values(transaction: transaction, signature: signature)
            let values: [Any] = [
                transaction.nonce,
                transaction.gasPrice,
                transaction.gasLimit,
                transaction.to?.data ?? Data(),
                transaction.value,
                transaction.data,
                v, r, s,
            ]
            //NOTE: avoid app crash, returns with return error, Happens when amount to send less then 0
            guard let data = RLP.encode(values) else {
                return .failure(.failedToSignTransaction)
            }
            return .success(data)
        case .userCancelled:
            return .failure(.userCancelled)
        case .notFound, .otherFailure:
            return .failure(.accountMayNeedImportingAgainOrEnablePasscode)
        }
    } catch {
        return .failure(.failedToSignTransaction)
    }
}

Same issue, any solution? @akhilccrb

@akhilccrb
Copy link

No , i update repository and created new rpc with quicknode

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

No branches or pull requests

4 participants