Skip to content

Commit

Permalink
bsc: Fix bohr block parser
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnie307 committed Sep 29, 2024
1 parent 998ca74 commit e42e7e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bmv/bsc2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = '0.7.2'
version = '0.7.3'

dependencies {
compileOnly("foundation.icon:javaee-api:$javaeeVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public BTPMessageVerifier(Address _bmc, BigInteger _chainId, @Optional byte[] _h

@External(readonly = true)
public String getVersion() {
return "0.7.2";
return "0.7.3";
}

@External(readonly = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,15 @@ public VoteAttestation getVoteAttestation(ChainConfig config) {
blob = Arrays.copyOfRange(extra, EXTRA_VANITY, extra.length - EXTRA_SEAL);
} else {
int num = extra[EXTRA_VANITY];
if (extra.length <= EXTRA_VANITY + EXTRA_SEAL + VALIDATOR_NUMBER_SIZE + num * VALIDATOR_BYTES_LENGTH) {
int turnLengthSize = 0;
if (config.isBohr(time)) {
turnLengthSize = TURN_LENGTH_SIZE;
}

if (extra.length <= EXTRA_VANITY + EXTRA_SEAL + VALIDATOR_NUMBER_SIZE + num * VALIDATOR_BYTES_LENGTH + turnLengthSize) {
return null;
}

int start = EXTRA_VANITY + VALIDATOR_NUMBER_SIZE + num * VALIDATOR_BYTES_LENGTH;
if (config.isBohr(time)) {
start += TURN_LENGTH_SIZE;
Expand Down

0 comments on commit e42e7e2

Please sign in to comment.