question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Shard` class and `ShardVM` class

See original GitHub issue

What is wrong?

Create a Shard class which mirrors the Chain class and a ShardVM which mirrors the VM class.

How can it be fixed

Fill this in if you know how to fix it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pipermerriamcommented, Jan 26, 2018

Approach looks sound. Make it so!

628b747f8ccdfb757062f36a27eedecfc2295f515c0586e05fbfb0620c0571a2

1reaction
hwwhwwcommented, Jan 26, 2018

@pipermerriam

New BaseVM class with common/shared methods between VM and ShardVM.

I’m looking into this, it seems easy to drag out some functions that related to gas_limit and uncles to be VM-only. But on the other side, so many functions are using block as their prefix, suffix, or are related to block_class and I’m not sure which of them could be reused in ShardVM at this moment.

I suggest that we can start with a simple overriding at the beginning, and then implement the new logic with collation in Stage 2:

  1. In base.py, rename VM to BaseVM.

  2. Create vm.py, VM, simply inherit BaseVM:

    class VM(BaseVM):
        pass
    
  3. Create shard_vm.py, also inherit BaseVM:

    class ShardVM(BaseVM):
        pass
    
  4. Rewire the ShardingVM fork to inherit this new ShardVM:

    ShardingVM = ShardVM.configure(
        name='ShardingVM',
        # classes
        _block_class=ShardingBlock,
        _state_class=ShardingVMState,
        # implementations from other VM forks
        create_header_from_parent=staticmethod(create_frontier_header_from_parent),
        compute_difficulty=staticmethod(compute_frontier_difficulty),
        configure_header=configure_frontier_header,
        ....
    )
    
  5. When we start to apply Collation as the container, we override the basic functions in ShardVM if we need.

  6. Refactor and clean up the common/shared methods.

I guess it would be less pain of backporting by this way. Any advice and suggestions will be greatly appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shared class cache - IBM
Using a Java shared class cache provides a means of improving JVM startup time, reducing overall storage usage, and optimizing the compilation process....
Read more >
Shard class | Memory Beta, non-canon Star Trek Wiki - Fandom
The Shard-class is a type of Tholian starship utilized in the late 23rd century. These vessels were also used by the Tholians of...
Read more >
and IgG-class antibodies to cyclic citrullinated peptides in ...
Associations with smoking and shared epitope differ between IgA- and IgG-class antibodies to cyclic citrullinated peptides in early rheumatoid arthritis.
Read more >
Variant Classes - Shard Tabletop
Variant classes are versions of classes that can be modified as needed, but share the subclasses of the base class. Typically a variant...
Read more >
Class Skin Concept #2 - Reddit
Probably one of the most iconic and requested classes in WoW, the Necromancer Class Skin is primarily unlocked for Warlocks and Deathknights but ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found