-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor stages #211
Refactor stages #211
Conversation
BigInteger l1FeeOverhead = Numeric.toBigInt(Arrays.copyOfRange(input, offset, offset + 32)); | ||
offset += 32; | ||
BigInteger l1FeeScalar = Numeric.toBigInt(Arrays.copyOfRange(input, offset, offset + 32)); | ||
BigInteger l1BlockNum = Numeric.toBigInt(Arrays.copyOfRange(input, 28, 36)); |
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.
这个改动之前的代码好啊,全是magic number
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.
bedrock的有效数据位很少,现在只读有效的数据位。
如果用offset计算,每次跳的位数不同,并且读下一个字段的数据长度也不一样,反而不好理解。
@@ -370,9 +371,31 @@ public boolean isGranite(BigInteger time) { | |||
* @return true if the time is the granite activation block, otherwise false. | |||
*/ | |||
public boolean isGraniteActivationBlock(BigInteger time) { | |||
return isFjord(time) | |||
return isGranite(time) |
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.
这个是bug吧,应该放到单独的pr里面提交,需要立即发布版本的
public class LruCacheProvider { | ||
|
||
static <K, V> Cache<K, V> create() { | ||
return CacheBuilder.newBuilder().maximumSize(1000L).build(); |
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.
magic number 1000L
看是不是要加个配置
@@ -0,0 +1,30 @@ | |||
package io.optimism.v2.derive.exception; | |||
|
|||
/** |
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.
注释看起来没有原来规范,建议都用ide或者ai生成
* | ||
* @return The bytes of encoded L1InfoTx | ||
*/ | ||
public byte[] encodeForBedrock() { |
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.
很多magic number,建议用AI修改,用有意义的变量名
No description provided.