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

EIP-2930: Access List Transactions #1712

Merged
merged 128 commits into from
Feb 1, 2021
Merged

Conversation

RatanRSur
Copy link
Contributor

@RatanRSur RatanRSur commented Dec 15, 2020

PR description

https://eips.ethereum.org/EIPS/eip-2930

Fixed Issue(s)

fixes #1504

Changelog

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>
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>
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);
Copy link
Contributor Author

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>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
RLP.encode(
rlpOutput ->
TransactionRLPEncoder.encodeForTransactionTrie(
transactions.get(i), rlpOutput))));
Copy link
Contributor Author

@RatanRSur RatanRSur Jan 28, 2021

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>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Comment on lines -371 to -372
assertPrivateStateRoot(
privateStateRootResolver, blockchain, STATE_ROOT_AFTER_TRANSACTION_APPENDED_TO_EMPTY_STATE);
Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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>
@RatanRSur RatanRSur changed the title eip 2930 EIP-2930: Access List Transactions Jan 28, 2021
@RatanRSur RatanRSur marked this pull request as ready for review January 28, 2021 02:33
Copy link
Contributor

@AbdelStark AbdelStark left a 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
Copy link
Contributor

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 ?

Copy link
Contributor Author

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>>> {
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 have some practices guidelines around using inheritance rather than composition/aggregation ?

Copy link
Contributor Author

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.

Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
Signed-off-by: Ratan Rai Sur <ratan.r.sur@gmail.com>
@RatanRSur RatanRSur enabled auto-merge (squash) February 1, 2021 17:49
@RatanRSur RatanRSur merged commit 39b2c6e into hyperledger:master Feb 1, 2021
davemec pushed a commit to davemec/besu that referenced this pull request Feb 8, 2021
Comment on lines +331 to +346
// 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)))));
Copy link
Contributor Author

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?

shemnon pushed a commit to shemnon/besu that referenced this pull request Feb 9, 2021
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>
@shemnon shemnon mentioned this pull request Feb 9, 2021
1 task
shemnon pushed a commit that referenced this pull request Feb 10, 2021
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>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
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.

Implement EIP-2930
3 participants