Skip to content

state surgery: test infra#1565

Merged
smartcontracts merged 4 commits intosc/surgery-testingfrom
state-surgery/test-infra
Oct 13, 2021
Merged

state surgery: test infra#1565
smartcontracts merged 4 commits intosc/surgery-testingfrom
state-surgery/test-infra

Conversation

@tynes
Copy link
Copy Markdown
Contributor

@tynes tynes commented Oct 12, 2021

Description
Adds in initial test infra for the state surgery testing

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 12, 2021

⚠️ No Changeset found

Latest commit: f2b4b41

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the A-pkg-core-utils Area: packages/core-utils label Oct 12, 2021
@tynes tynes force-pushed the state-surgery/test-infra branch from cc62959 to 6c1d163 Compare October 12, 2021 23:12
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 12, 2021

Codecov Report

❗ No coverage uploaded for pull request base (sc/surgery-testing@0e6f406). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                  Coverage Diff                  @@
##             sc/surgery-testing    #1565   +/-   ##
=====================================================
  Coverage                      ?   73.82%           
=====================================================
  Files                         ?       67           
  Lines                         ?     2227           
  Branches                      ?      326           
=====================================================
  Hits                          ?     1644           
  Misses                        ?      583           
  Partials                      ?        0           
Flag Coverage Δ
batch-submitter 61.74% <0.00%> (?)
contracts 91.17% <0.00%> (?)
core-utils 54.76% <0.00%> (?)
data-transport-layer 38.23% <0.00%> (?)
message-relayer 83.17% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e6f406...f2b4b41. Read the comment docs.

})
}


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs a lint

let eoas: StateDump
before(async () => {
await testEnv.init()
eoas = testEnv.surgeryDataSources.dump.filter(a => eoaClassifier(a, testEnv.surgeryDataSources))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be better to do:

testEnv.surgeryDataSources.dump.filter((acc) => {
  return classify(a, testEnv.surgeryDataSources))
})

So that we follow the same classification algorithm (only matching one classification). I don't think this actually matters for this specific test, but it will matter for other tests and we should be consistent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a feeling we will need this function in multiple places. Could abstract into:

function findAccountsByType(dump: StateDump, accountType: AccountType): Account[]

import { AccountType, StateDump } from '../../scripts/types'
import { classifiers } from '../../scripts/classifiers'

const eoaClassifier = classifiers[AccountType.EOA]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it's necessary to keep a copy of this here

it('should have the null code hash', async () => {})
// Iterate through all of the EOAs and check that they have no code
// in the new node
it('should not have any code', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checking every EOA is safer, but if it's too slow we could always just check a subset of every EOA for testnet + only check every EOA for mainnet.

})

it('should have the null storage root', async () => {})
it.skip('should have the null code hash', async () => {})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be accessibly by using eth_getProof

@smartcontracts smartcontracts merged commit a3b6346 into sc/surgery-testing Oct 13, 2021
@smartcontracts smartcontracts deleted the state-surgery/test-infra branch October 13, 2021 20:41
theochap pushed a commit that referenced this pull request Dec 10, 2025
### Description

Implements peer id blocking using the `ConnectionGater` on the gossip
driver.

Closes #1565 
Closes #1564

---------

Co-authored-by: clabby <ben@clab.by>
theochap pushed a commit that referenced this pull request Jan 14, 2026
### Description

Implements peer id blocking using the `ConnectionGater` on the gossip
driver.

Closes #1565 
Closes #1564

---------

Co-authored-by: clabby <ben@clab.by>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-pkg-core-utils Area: packages/core-utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants