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

Fix eth_sendTransaction test compliance #110

Merged
merged 35 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0e4fb48
pass RevertErrors up in full node
ben-chain Apr 24, 2020
413a98f
revert messages working, receipts not
ben-chain Apr 24, 2020
291a4d5
receipts working for failed txs
ben-chain Apr 24, 2020
f5cb2a0
test receipt generation for reverting txns'
ben-chain Apr 24, 2020
60afc74
bugfix, linting
ben-chain Apr 24, 2020
038c2ff
fix eth_call reversion errors
ben-chain Apr 25, 2020
9ce3e33
linting
ben-chain Apr 25, 2020
2102ae3
fix test sendTransaction endpoint to match spec
ben-chain Apr 26, 2020
6be870f
lint
ben-chain Apr 26, 2020
1bd4cfd
Merge branch 'master' into bug/eth_sendTransaction
ben-chain Apr 26, 2020
571a68a
everything working
ben-chain Apr 28, 2020
cce8691
linting
ben-chain Apr 28, 2020
9d3fd63
linting
ben-chain Apr 28, 2020
7c1b3cc
bad multi level filter
ben-chain Apr 29, 2020
021917a
handle unsupported filter handler
ben-chain Apr 29, 2020
ba3f5de
merge updated error code
ben-chain Apr 29, 2020
ebd81f3
linting
ben-chain Apr 29, 2020
ec8c861
merge master
ben-chain Apr 29, 2020
36ee32e
fix merge accidents
ben-chain Apr 29, 2020
b4bddc1
linting
ben-chain Apr 29, 2020
ee41892
linting
ben-chain Apr 29, 2020
96cb62a
fix log indexing bug
ben-chain Apr 29, 2020
051bbfd
add filtering multi-event test
ben-chain Apr 29, 2020
0287a08
merge future master
ben-chain Apr 29, 2020
0ffa719
linting
ben-chain Apr 29, 2020
7baf8d2
linting
ben-chain Apr 29, 2020
212f700
linting
ben-chain Apr 29, 2020
cc8f675
Merge branch 'bug/eth_getLogs/incorrect-address' into bug/eth_sendTra…
ben-chain Apr 29, 2020
9b8180c
use already existing EM interface
ben-chain Apr 29, 2020
04fa273
linting
ben-chain Apr 29, 2020
6c4914d
linting
ben-chain Apr 29, 2020
6049829
Preemptive Merge branch 'bug/eth_getLogs/incorrect-address' into bug/…
ben-chain Apr 29, 2020
3de4502
Merge branch 'master' into bug/eth_sendTransaction
ben-chain Apr 29, 2020
5db1f40
remove unused var
ben-chain Apr 29, 2020
e3c3e0a
linting
ben-chain Apr 29, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions packages/core-utils/src/app/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,22 +290,3 @@ export const runInDomain = async (
export const getCurrentTime = (): number => {
return Math.round(Date.now() / 1000)
}
/**
* Encodes a transaction in RLP format, using a random signature
* @param {object} Transaction object
*/
export const rlpEncodeTransactionWithRandomSig = (
transaction: object
): string => {
return RLP.encode([
hexlify(transaction['nonce']),
hexlify(transaction['gasPrice']),
hexlify(transaction['gasLimit']),
hexlify(transaction['to']),
hexlify(transaction['value']),
hexlify(transaction['data']),
'0x11', // v
'0x' + '11'.repeat(32), // r
'0x' + '11'.repeat(32), // s
])
}
8 changes: 7 additions & 1 deletion packages/rollup-full-node/src/app/fullnode-rpc-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ export class FullnodeRpcServer extends ExpressHttpServer {
)
return buildJsonRpcError('INVALID_PARAMS', request.id)
}
logError(log, `Uncaught exception at endpoint-level`, err)
logError(
log,
`Uncaught exception at endpoint-level for request [${JSON.stringify(
request
)}]:`,
err
)
return buildJsonRpcError(
'INTERNAL_ERROR',
request && request.id ? request.id : null
Expand Down
15 changes: 8 additions & 7 deletions packages/rollup-full-node/src/app/test-web3-rpc-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
getLogger,
numberToHexString,
castToNumber,
rlpEncodeTransactionWithRandomSig,
ZERO_ADDRESS,
} from '@eth-optimism/core-utils'
import { GAS_LIMIT } from '@eth-optimism/ovm'
Expand Down Expand Up @@ -144,16 +143,18 @@ export class TestWeb3Handler extends DefaultWeb3Handler {
if (!ovmTx.to) {
ovmTx.to = '0x'
}
if (!ovmTx.gasPrice) {
ovmTx.gasPrice = 0
}
if (!ovmTx.gasLimit) {
if (!ovmTx.gas) {
ovmTx.gasLimit = GAS_LIMIT
} else {
ovmTx.gasLimit = ovmTx.gas
delete ovmTx.gas
}
const ovmTxFrom = ovmTx.from
delete ovmTx.from
ovmTx.value = 0
return this.sendRawTransaction(
rlpEncodeTransactionWithRandomSig(ovmTx),
ovmTx.from
await this.getNewWallet().sign(ovmTx),
ovmTxFrom
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-full-node/test/app/web-rpc-handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ZERO_ADDRESS,
hexStrToBuf,
} from '@eth-optimism/core-utils'
import { CHAIN_ID } from '@eth-optimism/ovm'
import { CHAIN_ID, convertInternalLogsToOvmLogs } from '@eth-optimism/ovm'

Choose a reason for hiding this comment

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

I think this can be reverted. If it was used, it'd show up in a diff, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah that's definitely unused


import {
ethers,
Expand Down