-
Notifications
You must be signed in to change notification settings - Fork 880
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
EIP-2930: Access List Transactions #1712
Conversation
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
…ansaction-type-refactor
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
… logic Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
@@ -400,7 +400,7 @@ public void getOmmerByBlockHashAndIndexShouldReturnEmptyWhenIndexIsOutOfRange() | |||
|
|||
@Test | |||
public void getOmmerByBlockHashAndIndexShouldReturnExpectedOmmerHeader() { | |||
final BlockchainWithData data = setupBlockchain(3); | |||
final BlockchainWithData data = setupBlockchain(4); |
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.
Since BlockDataGenerator
changed, the blocks these tests tested had an empty ommer list. I bumped up the number of blocks to get a block with a non empty ommer list.
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
RLP.encode( | ||
rlpOutput -> | ||
TransactionRLPEncoder.encodeForTransactionTrie( | ||
transactions.get(i), rlpOutput)))); |
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.
Because i
had to be final
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
assertPrivateStateRoot( | ||
privateStateRootResolver, blockchain, STATE_ROOT_AFTER_TRANSACTION_APPENDED_TO_EMPTY_STATE); |
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.
@lucassaldanha does this make sense? We're testing that the state root hash is EMPTY_ROOT_HASH
still.
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 we might need to take a look at this. My understanding is that at the end, we are adding a 3rd block to the new chain, and that the block contains a PMT.Therefore, I would expect the private state root hash to be different from the empty state root hash (assuming this private tx in the 3rd block was processed and altered the state).
I'll ask someone from the team to take a look at it.
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.
Ok cool, I merged because it had bugfixes important for 1559 but let me know if there's anything more that needs to be done with the test.
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
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.
Looks good to me. Left some minor comments
@@ -80,7 +80,6 @@ | |||
import org.junit.rules.TemporaryFolder; | |||
|
|||
@SuppressWarnings("rawtypes") | |||
// todo request lucas look at this pr |
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.
did you get some feedback ?
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 did on that iteration. I'll ping him again for this one. 👍
|
||
import org.apache.tuweni.bytes.Bytes32; | ||
|
||
public class AccessList extends ArrayList<Map.Entry<Address, List<Bytes32>>> { |
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.
Do we have some practices guidelines around using inheritance rather than composition/aggregation ?
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.
The reason I did it this way was because I was really looking to do a type alias but java doesn't have them. This was the closest analog.
https://eips.ethereum.org/EIPS/eip-2930 Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
// the warmed up addresses will always be a superset of the address keys in the warmed up | ||
// storage so we can do both warm ups in one pass | ||
accessListWarmAddresses | ||
.parallelStream() | ||
.forEach( | ||
address -> | ||
Optional.ofNullable(worldState.get(address)) | ||
.ifPresent( | ||
account -> | ||
warmedUpStorage | ||
.get(address) | ||
.parallelStream() | ||
.forEach( | ||
storageKeyBytes -> | ||
account.getStorageValue( | ||
UInt256.fromBytes(storageKeyBytes))))); |
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.
@shemnon What are your thoughts on this? Pure rocksdb caching. Should we consider explicit caching for just the access list entries?
https://eips.ethereum.org/EIPS/eip-2930 Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com> (cherry picked from commit 39b2c6e) Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
https://eips.ethereum.org/EIPS/eip-2930 Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com> (cherry picked from commit 39b2c6e) Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
https://eips.ethereum.org/EIPS/eip-2930 Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
PR description
https://eips.ethereum.org/EIPS/eip-2930
Fixed Issue(s)
fixes #1504
Changelog