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

Refactor stages #211

Merged
merged 11 commits into from
Oct 21, 2024
Merged

Refactor stages #211

merged 11 commits into from
Oct 21, 2024

Conversation

thinkAfCod
Copy link
Collaborator

No description provided.

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

Choose a reason for hiding this comment

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

这个改动之前的代码好啊,全是magic number

Copy link
Collaborator Author

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)
Copy link
Member

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();
Copy link
Member

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;

/**
Copy link
Member

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() {
Copy link
Member

Choose a reason for hiding this comment

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

很多magic number,建议用AI修改,用有意义的变量名

@GrapeBaBa GrapeBaBa merged commit 760271b into optimism-java:main Oct 21, 2024
2 checks passed
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.

2 participants