-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
The revert reason returned from the EVM has been changed to a bytes value to better represent the specificiation (of it being an ABI encoded data block). This has meant that the TransactionReceipt returned from ethGetTransactionReceipt now provides a hex-encoded string (rather than UTF-8).
if (input.isEndOfCurrentList()) { | ||
revertReason = Optional.empty(); | ||
} else { | ||
if (!revertReasonAllowed) { | ||
throw new RLPException("Unexpected value at end of TransactionReceipt"); | ||
} | ||
final byte[] bytes = input.readBytesValue().getArrayUnsafe(); | ||
revertReason = Optional.of(new String(bytes, StandardCharsets.UTF_8)); | ||
revertReason = Optional.of(BytesValue.wrap(bytes)); |
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.
We don't need to re-wrap the byte array here, just use the BytesValue
returned from input
.
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.
.map( | ||
revertReason -> | ||
new String(revertReason.extractArray(), StandardCharsets.UTF_8)) | ||
.orElse(null))); |
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.
This is still wrong, the revert reason isn't a string - we need to output the result as a hex array in the trace output.
@@ -36,7 +37,7 @@ | |||
private final int pc; | |||
private final String[] stack; | |||
private final Object storage; | |||
private final String reason; | |||
private final BytesValue reason; |
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 think this should be a String here, but calculated from the BytesValue
with BytesValue.toUnprefixedString
. That would then match how the stack and return values are all formatted.
…gaSysEng#1741) * PIE-1792: Added chainId validation to PrivateTransactionValidator
…egaSysEng#1747) To allow us to reset the timestamp in the blockchain for Retesteth support we need to pass a Clock to affected APIs and use that instead of the static method System.currentTimeMillis(). The most consistent way to do this that will ensure that the API does not sneak back in is to ban the method via ErrorProne. TestClock.fixed() was altered to return the "now" time of the first time the fixed clock was requested, needed for many header validation tasks validating headers are not from the future.
…sEng#1758) Matches behaviour expected of eth_coinbase call by ethstats.net reporter.
…ed docs (PegaSysEng#1736) * Renames various eea methods to priv methods, with associated docs * Restructures packages * Adds priv commandline switch * Refactors eea_getTransactionCount and eea_getPrivateTransaction to priv * Changes package structure and fixes TODO * Remove whitespace * Update docs with new method names
…f Sync (PegaSysEng#1759) -- Verify that while a new node is being added and is out of sync, it doesn't accept connections, it accepts connection once it is synced
…ng#1764) * PAN-2723: Created Miner API transactions and conditions * PAN-2723: Added static nodes options to permissioned node builder * PAN-2723: Implemented permissioned node with static-nodes AT * PAN-2723: Renaming test * Refactoring test to use the waitForBlockHeight method
…illis()" (PegaSysEng#1768) This reverts commit 814b36e The needed chantes to get rid of Instant.now (which is also needed to get rid of the wall clock dependency) are too deep and intrusive into IBFT to try and speed patch them in that some APIs require re-work, so in the interst of test stability this gets sheleved until it is all ready.
* Typo doc in word "exceptoinal" * also remaining as a typo
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.
LGTM.
this.revertReason = | ||
receipt | ||
.getRevertReason() | ||
.map(reason -> reason.isEmpty() ? "" : reason.toString()) |
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 think this should just be:
.map(reason -> reason.isEmpty() ? "" : reason.toString()) | |
.map(BytesValue::toUnprefixedString) |
as we want to output it as a hex value in the same way as StructLog
does above.
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.
that means you get "revertReason": "0x" ... which ... seemed odd to me - but if thats the preferred solution ...
The revert reason returned from the EVM has been changed to a bytes value to better represent the specification (of it being an ABI encoded data block). This has meant that the TransactionReceipt returned from ethGetTransactionReceipt now provides a hex-encoded string (rather than UTF-8).
The revert reason returned from the EVM has been changed to a bytes value to better represent the specification (of it being an ABI encoded data block). This has meant that the TransactionReceipt returned from ethGetTransactionReceipt now provides a hex-encoded string (rather than UTF-8).
The revert reason returned from the EVM has been changed to a bytes value to
better represent the specification (of it being an ABI encoded data block).
This has meant that the TransactionReceipt returned from
ethGetTransactionReceipt now provides a hex-encoded string (rather than UTF-8).