-
Notifications
You must be signed in to change notification settings - Fork 153
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
Disable MESS #592
Disable MESS #592
Changes from 4 commits
56f6679
c29d869
9e274d0
05877c4
46d5236
0b1b8e1
e4b7dd2
84b98d9
907295d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ package coregeth | |
|
||
import ( | ||
"math/big" | ||
"reflect" | ||
"runtime" | ||
"strings" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/common/math" | ||
|
@@ -424,6 +427,15 @@ func (c *CoreGethChainConfig) SetECBP1100Transition(n *uint64) error { | |
return nil | ||
} | ||
|
||
func (c *CoreGethChainConfig) GetECBP1100DisableTransition() *uint64 { | ||
return bigNewU64(c.ECBP1100DisableFBlock) | ||
} | ||
|
||
func (c *CoreGethChainConfig) SetECBP1100DisableTransition(n *uint64) error { | ||
c.ECBP1100DisableFBlock = setBig(c.ECBP1100DisableFBlock, n) | ||
return nil | ||
} | ||
|
||
func (c *CoreGethChainConfig) GetEIP2315Transition() *uint64 { | ||
return bigNewU64(c.EIP2315FBlock) | ||
} | ||
|
@@ -669,6 +681,13 @@ func (c *CoreGethChainConfig) IsEnabled(fn func() *uint64, n *big.Int) bool { | |
if f == nil || n == nil { | ||
return false | ||
} | ||
fnName := runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice hack in order to check if both are enabled, either way it will not stay for too long. p.s.: I hope I don't read back this comment in 1-2 years and the code is still here :) |
||
if strings.Contains(fnName, "ECBP1100Transition") { | ||
disabledTransition := c.GetECBP1100DisableTransition() | ||
if disabledTransition != nil { | ||
return big.NewInt(int64(*disabledTransition)).Cmp(n) > 0 && big.NewInt(int64(*f)).Cmp(n) <= 0 | ||
} | ||
} | ||
return big.NewInt(int64(*f)).Cmp(n) <= 0 | ||
} | ||
|
||
|
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.
@meowsbits this is probably better to be removed (I added it).
A node operator might indeed want the
nodisable
functionality, so if he still wants to enable ECBP-1100 he has to do--ecbp1100.disable=69420123 --ecbp1100.nodisable
.The thing is that with the above check, this is not allowed.